Utility namespace used by physics. More...
Enumerations | |
enum | EPartIds { PARTID_MAX_SLOTS_log2 = 9, PARTID_MAX_SLOTS = 1 << PARTID_MAX_SLOTS_log2, PARTID_MAX_ATTACHMENTS = 32, PARTID_LINKED = 1 << 30 } |
Functions | |
int | ParsePartId (int partId, int &nLevels, int &nSlotBits) |
int | AllocPartIdRange (int partId, int nSlots) |
Allocate next level of slots. | |
int | GetSlotIdx (int partId, int level=0) |
Extract slot index from partid; 0 = top level. | |
Utility namespace used by physics.
|
inline |
Phys part id format:. Bit 31 = 0 (since partids can't be negative). Bit 30 - 1 if part belongs to an attached entity. Bits 29,28 - count of nested levels (numLevels) - 1, i.e. compound statobj within a cga within an entity. Lowest PARTID_MAX_SLOTS_log2*numLevels bits - indices of slots at the corresponding level. Bits directly above those - attachment id if bit 30 is set.