62 uint32 GetLowestBodyIndex(
uint32 inActiveBodyIndex)
const;
64#ifdef JPH_VALIDATE_ISLAND_BUILDER
66 void ValidateIslands(
uint32 inNumActiveBodies)
const;
81 atomic<uint32> mLinkedTo;
86 BodyLink * mBodyLinks =
nullptr;
87 uint32 * mConstraintLinks =
nullptr;
88 uint32 * mContactLinks =
nullptr;
91 BodyID * mBodyIslands =
nullptr;
92 uint32 * mBodyIslandEnds =
nullptr;
94 uint32 * mConstraintIslands =
nullptr;
95 uint32 * mConstraintIslandEnds =
nullptr;
97 uint32 * mContactIslands =
nullptr;
98 uint32 * mContactIslandEnds =
nullptr;
100 uint32 * mIslandsSorted =
nullptr;
102 uint8 * mNumPositionSteps =
nullptr;
106 uint32 mNumActiveBodies = 0;
107 uint32 mNumConstraints = 0;
112#ifdef JPH_VALIDATE_ISLAND_BUILDER
114 struct LinkValidation
120 LinkValidation * mLinkValidation =
nullptr;
121 atomic<uint32> mNumLinkValidation;
std::uint8_t uint8
Definition Core.h:454
unsigned int uint
Definition Core.h:453
#define JPH_NAMESPACE_END
Definition Core.h:379
std::uint32_t uint32
Definition Core.h:456
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:31
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition BodyID.h:13
Keeps track of connected bodies and builds islands for multithreaded velocity/position update.
Definition IslandBuilder.h:19
void Init(uint32 inMaxActiveBodies)
Initialize the island builder with the maximum amount of bodies that could be active.
Definition IslandBuilder.cpp:32
uint GetNumPositionSteps(uint32 inIslandIndex) const
Definition IslandBuilder.h:55
void LinkConstraint(uint32 inConstraintIndex, uint32 inFirst, uint32 inSecond)
Link a constraint to a body by their index in the BodyManager::mActiveBodies.
Definition IslandBuilder.cpp:159
void LinkContact(uint32 inContactIndex, uint32 inFirst, uint32 inSecond)
Link a contact to a body by their index in the BodyManager::mActiveBodies.
Definition IslandBuilder.cpp:169
bool GetContactsInIsland(uint32 inIslandIndex, uint32 *&outContactsBegin, uint32 *&outContactsEnd) const
Definition IslandBuilder.cpp:415
void ResetIslands(TempAllocator *inTempAllocator)
After you're done calling the three functions above, call this function to free associated data.
Definition IslandBuilder.cpp:433
void SetNumPositionSteps(uint32 inIslandIndex, uint inNumPositionSteps)
The number of position iterations for each island.
Definition IslandBuilder.h:54
uint32 GetNumIslands() const
Get the amount of islands formed.
Definition IslandBuilder.h:46
~IslandBuilder()
Destructor.
Definition IslandBuilder.cpp:17
void PrepareContactConstraints(uint32 inMaxContactConstraints, TempAllocator *inTempAllocator)
Prepare for simulation step by allocating space for the contact constraints.
Definition IslandBuilder.cpp:43
bool GetConstraintsInIsland(uint32 inIslandIndex, uint32 *&outConstraintsBegin, uint32 *&outConstraintsEnd) const
Definition IslandBuilder.cpp:397
void PrepareNonContactConstraints(uint32 inNumConstraints, TempAllocator *inTempAllocator)
Prepare for simulation step by allocating space for the non-contact constraints.
Definition IslandBuilder.cpp:67
void GetBodiesInIsland(uint32 inIslandIndex, BodyID *&outBodiesBegin, BodyID *&outBodiesEnd) const
Get iterator for a particular island, return false if there are no constraints.
Definition IslandBuilder.cpp:389
void LinkBodies(uint32 inFirst, uint32 inSecond)
Link two bodies by their index in the BodyManager::mActiveBodies list to form islands.
Definition IslandBuilder.cpp:98
void Finalize(const BodyID *inActiveBodies, uint32 inNumActiveBodies, uint32 inNumContacts, TempAllocator *inTempAllocator)
Finalize the islands after all bodies have been Link()-ed.
Definition IslandBuilder.cpp:375
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11
Definition TempAllocator.h:16