Jolt Physics
A multi core friendly Game Physics Engine
|
Structure that contains data needed for each collision step. More...
#include <PhysicsUpdateContext.h>
Classes | |
struct | CCDBody |
Contains the information needed to cast a body through the scene to do continuous collision detection. More... | |
Public Member Functions | |
Step ()=default | |
Step (const Step &) | |
Public Attributes | |
PhysicsUpdateContext * | mContext |
The physics update context. | |
bool | mIsFirst |
If this is the first step. | |
bool | mIsLast |
If this is the last step. | |
BroadPhase::UpdateState | mBroadPhaseUpdateState |
Handle returned by Broadphase::UpdatePrepare. | |
uint32 | mNumActiveBodiesAtStepStart |
Number of bodies that were active at the start of the physics update step. Only these bodies will receive gravity (they are the first N in the active body list). | |
atomic< uint32 > | mDetermineActiveConstraintReadIdx { 0 } |
Next constraint for determine active constraints. | |
uint8 | mPadding1 [JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic. | |
atomic< uint32 > | mNumActiveConstraints { 0 } |
Number of constraints in the mActiveConstraints array. | |
uint8 | mPadding2 [JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic. | |
atomic< uint32 > | mSetupVelocityConstraintsReadIdx { 0 } |
Next constraint for setting up velocity constraints. | |
uint8 | mPadding3 [JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic. | |
atomic< uint32 > | mStepListenerReadIdx { 0 } |
Next step listener to call. | |
uint8 | mPadding4 [JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic. | |
atomic< uint32 > | mApplyGravityReadIdx { 0 } |
Next body to apply gravity to. | |
uint8 | mPadding5 [JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic. | |
atomic< uint32 > | mActiveBodyReadIdx { 0 } |
Index of fist active body that has not yet been processed by the broadphase. | |
uint8 | mPadding6 [JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic. | |
BodyPairQueues | mBodyPairQueues |
Queues in which to put body pairs that need to be tested by the narrowphase. | |
uint32 | mMaxBodyPairsPerQueue |
Amount of body pairs that we can queue per queue. | |
atomic< JobMask > | mActiveFindCollisionJobs |
A bitmask that indicates which jobs are still active. | |
atomic< uint > | mNumBodyPairs { 0 } |
The number of body pairs found in this step (used to size the contact cache in the next step) | |
atomic< uint > | mNumManifolds { 0 } |
The number of manifolds found in this step (used to size the contact cache in the next step) | |
atomic< uint32 > | mSolveVelocityConstraintsNextIsland { 0 } |
Next island that needs to be processed for the solve velocity constraints step (doesn't need own cache line since position jobs don't run at same time) | |
atomic< uint32 > | mSolvePositionConstraintsNextIsland { 0 } |
Next island that needs to be processed for the solve position constraints step (doesn't need own cache line since velocity jobs don't run at same time) | |
atomic< uint32 > | mIntegrateVelocityReadIdx { 0 } |
Next active body index to take when integrating velocities. | |
CCDBody * | mCCDBodies = nullptr |
List of bodies that need to do continuous collision detection. | |
uint32 | mCCDBodiesCapacity = 0 |
Capacity of the mCCDBodies list. | |
atomic< uint32 > | mNumCCDBodies = 0 |
Number of CCD bodies in mCCDBodies. | |
atomic< uint32 > | mNextCCDBody { 0 } |
Next unprocessed body index in mCCDBodies. | |
int * | mActiveBodyToCCDBody = nullptr |
A mapping between an index in BodyManager::mActiveBodies and the index in mCCDBodies. | |
uint32 | mNumActiveBodyToCCDBody = 0 |
Number of indices in mActiveBodyToCCDBody. | |
JobHandle | mBroadPhasePrepare |
Prepares the new tree in the background. | |
JobHandleArray | mStepListeners |
Listeners to notify of the beginning of a physics step. | |
JobHandleArray | mDetermineActiveConstraints |
Determine which constraints will be active during this step. | |
JobHandleArray | mApplyGravity |
Update velocities of bodies with gravity. | |
JobHandleArray | mFindCollisions |
Find all collisions between active bodies an the world. | |
JobHandle | mUpdateBroadphaseFinalize |
Swap the newly built tree with the current tree. | |
JobHandleArray | mSetupVelocityConstraints |
Calculate properties for all constraints in the constraint manager. | |
JobHandle | mBuildIslandsFromConstraints |
Go over all constraints and assign the bodies they're attached to to an island. | |
JobHandle | mFinalizeIslands |
Finalize calculation simulation islands. | |
JobHandle | mBodySetIslandIndex |
Set the current island index on each body (not used by the simulation, only for drawing purposes) | |
JobHandleArray | mSolveVelocityConstraints |
Solve the constraints in the velocity domain. | |
JobHandle | mPreIntegrateVelocity |
Setup integration of all body positions. | |
JobHandleArray | mIntegrateVelocity |
Integrate all body positions. | |
JobHandle | mPostIntegrateVelocity |
Finalize integration of all body positions. | |
JobHandle | mResolveCCDContacts |
Updates the positions and velocities for all bodies that need continuous collision detection. | |
JobHandleArray | mSolvePositionConstraints |
Solve all constraints in the position domain. | |
JobHandle | mContactRemovedCallbacks |
Calls the contact removed callbacks. | |
JobHandle | mSoftBodyPrepare |
Prepares updating the soft bodies. | |
JobHandleArray | mSoftBodyCollide |
Finds all colliding shapes for soft bodies. | |
JobHandleArray | mSoftBodySimulate |
Simulates all particles. | |
JobHandle | mSoftBodyFinalize |
Finalizes the soft body update. | |
JobHandle | mStartNextStep |
Job that kicks the next step (empty for the last step) | |
Structure that contains data needed for each collision step.
|
default |
|
inline |
atomic<uint32> PhysicsUpdateContext::Step::mActiveBodyReadIdx { 0 } |
Index of fist active body that has not yet been processed by the broadphase.
int* PhysicsUpdateContext::Step::mActiveBodyToCCDBody = nullptr |
A mapping between an index in BodyManager::mActiveBodies and the index in mCCDBodies.
atomic<JobMask> PhysicsUpdateContext::Step::mActiveFindCollisionJobs |
A bitmask that indicates which jobs are still active.
JobHandleArray PhysicsUpdateContext::Step::mApplyGravity |
Update velocities of bodies with gravity.
atomic<uint32> PhysicsUpdateContext::Step::mApplyGravityReadIdx { 0 } |
Next body to apply gravity to.
BodyPairQueues PhysicsUpdateContext::Step::mBodyPairQueues |
Queues in which to put body pairs that need to be tested by the narrowphase.
JobHandle PhysicsUpdateContext::Step::mBodySetIslandIndex |
Set the current island index on each body (not used by the simulation, only for drawing purposes)
JobHandle PhysicsUpdateContext::Step::mBroadPhasePrepare |
Prepares the new tree in the background.
BroadPhase::UpdateState PhysicsUpdateContext::Step::mBroadPhaseUpdateState |
Handle returned by Broadphase::UpdatePrepare.
JobHandle PhysicsUpdateContext::Step::mBuildIslandsFromConstraints |
Go over all constraints and assign the bodies they're attached to to an island.
CCDBody* PhysicsUpdateContext::Step::mCCDBodies = nullptr |
List of bodies that need to do continuous collision detection.
uint32 PhysicsUpdateContext::Step::mCCDBodiesCapacity = 0 |
Capacity of the mCCDBodies list.
JobHandle PhysicsUpdateContext::Step::mContactRemovedCallbacks |
Calls the contact removed callbacks.
PhysicsUpdateContext* PhysicsUpdateContext::Step::mContext |
The physics update context.
atomic<uint32> PhysicsUpdateContext::Step::mDetermineActiveConstraintReadIdx { 0 } |
Next constraint for determine active constraints.
JobHandleArray PhysicsUpdateContext::Step::mDetermineActiveConstraints |
Determine which constraints will be active during this step.
JobHandle PhysicsUpdateContext::Step::mFinalizeIslands |
Finalize calculation simulation islands.
JobHandleArray PhysicsUpdateContext::Step::mFindCollisions |
Find all collisions between active bodies an the world.
JobHandleArray PhysicsUpdateContext::Step::mIntegrateVelocity |
Integrate all body positions.
atomic<uint32> PhysicsUpdateContext::Step::mIntegrateVelocityReadIdx { 0 } |
Next active body index to take when integrating velocities.
bool PhysicsUpdateContext::Step::mIsFirst |
If this is the first step.
bool PhysicsUpdateContext::Step::mIsLast |
If this is the last step.
uint32 PhysicsUpdateContext::Step::mMaxBodyPairsPerQueue |
Amount of body pairs that we can queue per queue.
atomic<uint32> PhysicsUpdateContext::Step::mNextCCDBody { 0 } |
Next unprocessed body index in mCCDBodies.
uint32 PhysicsUpdateContext::Step::mNumActiveBodiesAtStepStart |
Number of bodies that were active at the start of the physics update step. Only these bodies will receive gravity (they are the first N in the active body list).
uint32 PhysicsUpdateContext::Step::mNumActiveBodyToCCDBody = 0 |
Number of indices in mActiveBodyToCCDBody.
atomic<uint32> PhysicsUpdateContext::Step::mNumActiveConstraints { 0 } |
Number of constraints in the mActiveConstraints array.
atomic<uint> PhysicsUpdateContext::Step::mNumBodyPairs { 0 } |
The number of body pairs found in this step (used to size the contact cache in the next step)
atomic<uint32> PhysicsUpdateContext::Step::mNumCCDBodies = 0 |
Number of CCD bodies in mCCDBodies.
atomic<uint> PhysicsUpdateContext::Step::mNumManifolds { 0 } |
The number of manifolds found in this step (used to size the contact cache in the next step)
uint8 PhysicsUpdateContext::Step::mPadding1[JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic.
uint8 PhysicsUpdateContext::Step::mPadding2[JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic.
uint8 PhysicsUpdateContext::Step::mPadding3[JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic.
uint8 PhysicsUpdateContext::Step::mPadding4[JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic.
uint8 PhysicsUpdateContext::Step::mPadding5[JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic.
uint8 PhysicsUpdateContext::Step::mPadding6[JPH_CACHE_LINE_SIZE - sizeof(atomic< uint32 >)] |
Padding to avoid sharing cache line with the next atomic.
JobHandle PhysicsUpdateContext::Step::mPostIntegrateVelocity |
Finalize integration of all body positions.
JobHandle PhysicsUpdateContext::Step::mPreIntegrateVelocity |
Setup integration of all body positions.
JobHandle PhysicsUpdateContext::Step::mResolveCCDContacts |
Updates the positions and velocities for all bodies that need continuous collision detection.
JobHandleArray PhysicsUpdateContext::Step::mSetupVelocityConstraints |
Calculate properties for all constraints in the constraint manager.
atomic<uint32> PhysicsUpdateContext::Step::mSetupVelocityConstraintsReadIdx { 0 } |
Next constraint for setting up velocity constraints.
JobHandleArray PhysicsUpdateContext::Step::mSoftBodyCollide |
Finds all colliding shapes for soft bodies.
JobHandle PhysicsUpdateContext::Step::mSoftBodyFinalize |
Finalizes the soft body update.
JobHandle PhysicsUpdateContext::Step::mSoftBodyPrepare |
Prepares updating the soft bodies.
JobHandleArray PhysicsUpdateContext::Step::mSoftBodySimulate |
Simulates all particles.
JobHandleArray PhysicsUpdateContext::Step::mSolvePositionConstraints |
Solve all constraints in the position domain.
atomic<uint32> PhysicsUpdateContext::Step::mSolvePositionConstraintsNextIsland { 0 } |
Next island that needs to be processed for the solve position constraints step (doesn't need own cache line since velocity jobs don't run at same time)
JobHandleArray PhysicsUpdateContext::Step::mSolveVelocityConstraints |
Solve the constraints in the velocity domain.
atomic<uint32> PhysicsUpdateContext::Step::mSolveVelocityConstraintsNextIsland { 0 } |
Next island that needs to be processed for the solve velocity constraints step (doesn't need own cache line since position jobs don't run at same time)
JobHandle PhysicsUpdateContext::Step::mStartNextStep |
Job that kicks the next step (empty for the last step)
atomic<uint32> PhysicsUpdateContext::Step::mStepListenerReadIdx { 0 } |
Next step listener to call.
JobHandleArray PhysicsUpdateContext::Step::mStepListeners |
Listeners to notify of the beginning of a physics step.
JobHandle PhysicsUpdateContext::Step::mUpdateBroadphaseFinalize |
Swap the newly built tree with the current tree.