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

Keeps track of connected bodies and builds islands for multithreaded velocity/position update. More...

#include <IslandBuilder.h>

Inheritance diagram for IslandBuilder:
NonCopyable

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
 

Detailed Description

Keeps track of connected bodies and builds islands for multithreaded velocity/position update.

Constructor & Destructor Documentation

◆ ~IslandBuilder()

JPH_NAMESPACE_BEGIN IslandBuilder::~IslandBuilder ( )

Destructor.

Member Function Documentation

◆ Finalize()

void IslandBuilder::Finalize ( const BodyID inActiveBodies,
uint32  inNumActiveBodies,
uint32  inNumContacts,
TempAllocator inTempAllocator 
)

Finalize the islands after all bodies have been Link()-ed.

◆ GetBodiesInIsland()

void IslandBuilder::GetBodiesInIsland ( uint32  inIslandIndex,
BodyID *&  outBodiesBegin,
BodyID *&  outBodiesEnd 
) const

Get iterator for a particular island, return false if there are no constraints.

◆ GetConstraintsInIsland()

bool IslandBuilder::GetConstraintsInIsland ( uint32  inIslandIndex,
uint32 *&  outConstraintsBegin,
uint32 *&  outConstraintsEnd 
) const

◆ GetContactsInIsland()

bool IslandBuilder::GetContactsInIsland ( uint32  inIslandIndex,
uint32 *&  outContactsBegin,
uint32 *&  outContactsEnd 
) const

◆ GetNumIslands()

uint32 IslandBuilder::GetNumIslands ( ) const
inline

Get the amount of islands formed.

◆ GetNumPositionSteps()

uint IslandBuilder::GetNumPositionSteps ( uint32  inIslandIndex) const
inline

◆ Init()

void IslandBuilder::Init ( uint32  inMaxActiveBodies)

Initialize the island builder with the maximum amount of bodies that could be active.

◆ LinkBodies()

void IslandBuilder::LinkBodies ( uint32  inFirst,
uint32  inSecond 
)

Link two bodies by their index in the BodyManager::mActiveBodies list to form islands.

◆ LinkConstraint()

void IslandBuilder::LinkConstraint ( uint32  inConstraintIndex,
uint32  inFirst,
uint32  inSecond 
)

Link a constraint to a body by their index in the BodyManager::mActiveBodies.

◆ LinkContact()

void IslandBuilder::LinkContact ( uint32  inContactIndex,
uint32  inFirst,
uint32  inSecond 
)

Link a contact to a body by their index in the BodyManager::mActiveBodies.

◆ PrepareContactConstraints()

void IslandBuilder::PrepareContactConstraints ( uint32  inMaxContactConstraints,
TempAllocator inTempAllocator 
)

Prepare for simulation step by allocating space for the contact constraints.

◆ PrepareNonContactConstraints()

void IslandBuilder::PrepareNonContactConstraints ( uint32  inNumConstraints,
TempAllocator inTempAllocator 
)

Prepare for simulation step by allocating space for the non-contact constraints.

◆ ResetIslands()

void IslandBuilder::ResetIslands ( TempAllocator inTempAllocator)

After you're done calling the three functions above, call this function to free associated data.

◆ SetNumPositionSteps()

void IslandBuilder::SetNumPositionSteps ( uint32  inIslandIndex,
uint  inNumPositionSteps 
)
inline

The number of position iterations for each island.


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