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. More...
 
void Init (uint32 inMaxActiveBodies)
 Initialize the island builder with the maximum amount of bodies that could be active. More...
 
void PrepareContactConstraints (uint32 inMaxContactConstraints, TempAllocator *inTempAllocator)
 Prepare for simulation step by allocating space for the contact constraints. More...
 
void PrepareNonContactConstraints (uint32 inNumConstraints, TempAllocator *inTempAllocator)
 Prepare for simulation step by allocating space for the non-contact constraints. More...
 
void LinkBodies (uint32 inFirst, uint32 inSecond)
 Link two bodies by their index in the BodyManager::mActiveBodies list to form islands. More...
 
void LinkConstraint (uint32 inConstraintIndex, uint32 inFirst, uint32 inSecond)
 Link a constraint to a body by their index in the BodyManager::mActiveBodies. More...
 
void LinkContact (uint32 inContactIndex, uint32 inFirst, uint32 inSecond)
 Link a contact to a body by their index in the BodyManager::mActiveBodies. More...
 
void Finalize (const BodyID *inActiveBodies, uint32 inNumActiveBodies, uint32 inNumContacts, TempAllocator *inTempAllocator)
 Finalize the islands after all bodies have been Link()-ed. More...
 
uint32 GetNumIslands () const
 Get the amount of islands formed. More...
 
void GetBodiesInIsland (uint32 inIslandIndex, BodyID *&outBodiesBegin, BodyID *&outBodiesEnd) const
 Get iterator for a particular island, return false if there are no constraints. More...
 
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. More...
 
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. More...
 
- 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: