Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
CharacterID Class Reference

ID of a character. Used primarily to identify deleted characters and to sort deterministically. More...

#include <CharacterID.h>

Public Member Functions

 CharacterID ()
 Construct invalid character ID.
 
 CharacterID (uint32 inID)
 Construct from index and sequence number combined in a single uint32 (use with care!)
 
uint32 GetValue () const
 
bool IsInvalid () const
 Check if the ID is valid.
 
bool operator== (const CharacterID &inRHS) const
 Equals check.
 
bool operator!= (const CharacterID &inRHS) const
 Not equals check.
 
bool operator< (const CharacterID &inRHS) const
 Smaller than operator, can be used for sorting characters.
 
bool operator> (const CharacterID &inRHS) const
 Greater than operator, can be used for sorting characters.
 
uint64 GetHash () const
 Get the hash for this character ID.
 

Static Public Member Functions

static CharacterID sNextCharacterID ()
 Generate the next available character ID.
 
static void sSetNextCharacterID (uint32 inNextValue=1)
 Set the next available character ID, can be used after destroying all character to prepare for a second deterministic run.
 

Static Public Attributes

static JPH_OVERRIDE_NEW_DELETE constexpr uint32 cInvalidCharacterID = 0xffffffff
 The value for an invalid character ID.
 

Detailed Description

ID of a character. Used primarily to identify deleted characters and to sort deterministically.

Constructor & Destructor Documentation

◆ CharacterID() [1/2]

CharacterID::CharacterID ( )
inline

Construct invalid character ID.

◆ CharacterID() [2/2]

CharacterID::CharacterID ( uint32  inID)
inlineexplicit

Construct from index and sequence number combined in a single uint32 (use with care!)

Member Function Documentation

◆ GetHash()

uint64 CharacterID::GetHash ( ) const
inline

Get the hash for this character ID.

◆ GetValue()

uint32 CharacterID::GetValue ( ) const
inline

◆ IsInvalid()

bool CharacterID::IsInvalid ( ) const
inline

Check if the ID is valid.

◆ operator!=()

bool CharacterID::operator!= ( const CharacterID inRHS) const
inline

Not equals check.

◆ operator<()

bool CharacterID::operator< ( const CharacterID inRHS) const
inline

Smaller than operator, can be used for sorting characters.

◆ operator==()

bool CharacterID::operator== ( const CharacterID inRHS) const
inline

Equals check.

◆ operator>()

bool CharacterID::operator> ( const CharacterID inRHS) const
inline

Greater than operator, can be used for sorting characters.

◆ sNextCharacterID()

static CharacterID CharacterID::sNextCharacterID ( )
inlinestatic

Generate the next available character ID.

◆ sSetNextCharacterID()

static void CharacterID::sSetNextCharacterID ( uint32  inNextValue = 1)
inlinestatic

Set the next available character ID, can be used after destroying all character to prepare for a second deterministic run.

Member Data Documentation

◆ cInvalidCharacterID

JPH_OVERRIDE_NEW_DELETE constexpr uint32 CharacterID::cInvalidCharacterID = 0xffffffff
staticconstexpr

The value for an invalid character ID.


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