Jolt Physics
A multi core friendly Game Physics Engine
|
Keeps track of connected bodies and builds islands for multithreaded velocity/position update. More...
#include <IslandBuilder.h>
Public Member Functions | |
~IslandBuilder () | |
Destructor. | |
void | Init (uint32 inMaxActiveBodies) |
Initialize the island builder with the maximum amount of bodies that could be active. | |
void | PrepareContactConstraints (uint32 inMaxContactConstraints, TempAllocator *inTempAllocator) |
Prepare for simulation step by allocating space for the contact constraints. | |
void | PrepareNonContactConstraints (uint32 inNumConstraints, TempAllocator *inTempAllocator) |
Prepare for simulation step by allocating space for the non-contact constraints. | |
void | LinkBodies (uint32 inFirst, uint32 inSecond) |
Link two bodies by their index in the BodyManager::mActiveBodies list to form islands. | |
void | LinkConstraint (uint32 inConstraintIndex, uint32 inFirst, uint32 inSecond) |
Link a constraint to a body by their index in the BodyManager::mActiveBodies. | |
void | LinkContact (uint32 inContactIndex, uint32 inFirst, uint32 inSecond) |
Link a contact to a body by their index in the BodyManager::mActiveBodies. | |
void | Finalize (const BodyID *inActiveBodies, uint32 inNumActiveBodies, uint32 inNumContacts, TempAllocator *inTempAllocator) |
Finalize the islands after all bodies have been Link()-ed. | |
uint32 | GetNumIslands () const |
Get the amount of islands formed. | |
void | GetBodiesInIsland (uint32 inIslandIndex, BodyID *&outBodiesBegin, BodyID *&outBodiesEnd) const |
Get iterator for a particular island, return false if there are no constraints. | |
bool | GetConstraintsInIsland (uint32 inIslandIndex, uint32 *&outConstraintsBegin, uint32 *&outConstraintsEnd) const |
bool | GetContactsInIsland (uint32 inIslandIndex, uint32 *&outContactsBegin, uint32 *&outContactsEnd) const |
void | SetNumPositionSteps (uint32 inIslandIndex, uint inNumPositionSteps) |
The number of position iterations for each island. | |
uint | GetNumPositionSteps (uint32 inIslandIndex) const |
void | ResetIslands (TempAllocator *inTempAllocator) |
After you're done calling the three functions above, call this function to free associated data. | |
Public Member Functions inherited from NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
void | operator= (const NonCopyable &)=delete |
Keeps track of connected bodies and builds islands for multithreaded velocity/position update.
JPH_NAMESPACE_BEGIN IslandBuilder::~IslandBuilder | ( | ) |
Destructor.
void IslandBuilder::Finalize | ( | const BodyID * | inActiveBodies, |
uint32 | inNumActiveBodies, | ||
uint32 | inNumContacts, | ||
TempAllocator * | inTempAllocator | ||
) |
Finalize the islands after all bodies have been Link()-ed.
void IslandBuilder::GetBodiesInIsland | ( | uint32 | inIslandIndex, |
BodyID *& | outBodiesBegin, | ||
BodyID *& | outBodiesEnd | ||
) | const |
Get iterator for a particular island, return false if there are no constraints.
bool IslandBuilder::GetConstraintsInIsland | ( | uint32 | inIslandIndex, |
uint32 *& | outConstraintsBegin, | ||
uint32 *& | outConstraintsEnd | ||
) | const |
bool IslandBuilder::GetContactsInIsland | ( | uint32 | inIslandIndex, |
uint32 *& | outContactsBegin, | ||
uint32 *& | outContactsEnd | ||
) | const |
|
inline |
Get the amount of islands formed.
void IslandBuilder::Init | ( | uint32 | inMaxActiveBodies | ) |
Initialize the island builder with the maximum amount of bodies that could be active.
Link two bodies by their index in the BodyManager::mActiveBodies list to form islands.
Link a constraint to a body by their index in the BodyManager::mActiveBodies.
Link a contact to a body by their index in the BodyManager::mActiveBodies.
void IslandBuilder::PrepareContactConstraints | ( | uint32 | inMaxContactConstraints, |
TempAllocator * | inTempAllocator | ||
) |
Prepare for simulation step by allocating space for the contact constraints.
void IslandBuilder::PrepareNonContactConstraints | ( | uint32 | inNumConstraints, |
TempAllocator * | inTempAllocator | ||
) |
Prepare for simulation step by allocating space for the non-contact constraints.
void IslandBuilder::ResetIslands | ( | TempAllocator * | inTempAllocator | ) |
After you're done calling the three functions above, call this function to free associated data.
The number of position iterations for each island.