ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding race conditions.
More...
#include <BodyID.h>
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding race conditions.
◆ BodyID() [1/3]
Construct invalid body ID.
◆ BodyID() [2/3]
Construct from index and sequence number combined in a single uint32 (use with care!)
◆ BodyID() [3/3]
Construct from index and sequence number.
◆ GetIndex()
uint32 BodyID::GetIndex |
( |
| ) |
const |
|
inline |
◆ GetIndexAndSequenceNumber()
uint32 BodyID::GetIndexAndSequenceNumber |
( |
| ) |
const |
|
inline |
Returns the index and sequence number combined in an uint32.
◆ GetSequenceNumber()
uint8 BodyID::GetSequenceNumber |
( |
| ) |
const |
|
inline |
Get sequence number of body. The sequence number can be used to check if a body ID with the same body index has been reused by another body. It is mainly used in multi threaded situations where a body is removed and its body index is immediately reused by a body created from another thread. Functions querying the broadphase can (after acquiring a body lock) detect that the body has been removed (we assume that this won't happen more than 128 times in a row).
◆ IsInvalid()
bool BodyID::IsInvalid |
( |
| ) |
const |
|
inline |
Check if the ID is valid.
◆ operator!=()
bool BodyID::operator!= |
( |
const BodyID & |
inRHS | ) |
const |
|
inline |
◆ operator<()
bool BodyID::operator< |
( |
const BodyID & |
inRHS | ) |
const |
|
inline |
Smaller than operator, can be used for sorting bodies.
◆ operator==()
bool BodyID::operator== |
( |
const BodyID & |
inRHS | ) |
const |
|
inline |
◆ operator>()
bool BodyID::operator> |
( |
const BodyID & |
inRHS | ) |
const |
|
inline |
Greater than operator, can be used for sorting bodies.
◆ cBroadPhaseBit
constexpr uint32 BodyID::cBroadPhaseBit = 0x00800000 |
|
staticconstexpr |
This bit is used by the broadphase.
◆ cInvalidBodyID
The value for an invalid body ID.
◆ cMaxBodyIndex
constexpr uint32 BodyID::cMaxBodyIndex = 0x7fffff |
|
staticconstexpr |
Maximum value for body index (also the maximum amount of bodies supported - 1)
◆ cMaxSequenceNumber
constexpr uint8 BodyID::cMaxSequenceNumber = 0xff |
|
staticconstexpr |
Maximum value for the sequence number.
The documentation for this class was generated from the following file: