Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Physics::PhysicsBodyHandle Struct Reference

Runtime handle for a registered physics body component. More...

#include <CollisionProfile.h>

Public Member Functions

bool isValid () const
 Checks whether this handle contains a body slot and generation.

Public Attributes

std::uint32_t id = 0
 One-based body slot index, or 0 for an invalid handle.
std::uint32_t generation = 0
 Slot generation used to reject stale handles.

Detailed Description

Runtime handle for a registered physics body component.

The generation field rejects stale handles after a body slot is unregistered and reused. The default handle {0, 0} is invalid.

Definition at line 88 of file CollisionProfile.h.

Member Function Documentation

◆ isValid()

bool Engine::Physics::PhysicsBodyHandle::isValid ( ) const
inlinenodiscard

Checks whether this handle contains a body slot and generation.

Returns
True when both id and generation are non-zero.

Definition at line 97 of file CollisionProfile.h.

References generation.

Member Data Documentation

◆ generation

std::uint32_t Engine::Physics::PhysicsBodyHandle::generation = 0

Slot generation used to reject stale handles.

Definition at line 91 of file CollisionProfile.h.

Referenced by isValid().

◆ id

std::uint32_t Engine::Physics::PhysicsBodyHandle::id = 0

One-based body slot index, or 0 for an invalid handle.

Definition at line 90 of file CollisionProfile.h.


The documentation for this struct was generated from the following file: