Jolt Physics
A multi core friendly Game Physics Engine
|
Information used during the Update call. More...
#include <PhysicsUpdateContext.h>
Classes | |
struct | BodyPairQueue |
struct | Step |
Structure that contains data needed for each collision step. More... | |
Public Types | |
using | JobHandleArray = StaticArray< JobHandle, cMaxConcurrency > |
using | BodyPairQueues = StaticArray< BodyPairQueue, cMaxConcurrency > |
using | JobMask = uint32 |
A mask that has as many bits as we can have concurrent jobs. | |
using | Steps = Array< Step, STLTempAllocator< Step > > |
Public Member Functions | |
PhysicsUpdateContext (TempAllocator &inTempAllocator) | |
Destructor. | |
~PhysicsUpdateContext () | |
int | GetMaxConcurrency () const |
Maximum amount of concurrent jobs on this machine. | |
Public Member Functions inherited from NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
void | operator= (const NonCopyable &)=delete |
Public Attributes | |
PhysicsSystem * | mPhysicsSystem |
The physics system we belong to. | |
TempAllocator * | mTempAllocator |
Temporary allocator used during the update. | |
JobSystem * | mJobSystem |
Job system that processes jobs. | |
JobSystem::Barrier * | mBarrier |
Barrier used to wait for all physics jobs to complete. | |
float | mStepDeltaTime |
Delta time for a simulation step (collision step) | |
float | mWarmStartImpulseRatio |
Ratio of this step delta time vs last step. | |
atomic< uint32 > | mErrors { 0 } |
Errors that occurred during the update, actual type is EPhysicsUpdateError. | |
Constraint ** | mActiveConstraints = nullptr |
Constraints that were active at the start of the physics update step (activating bodies can activate constraints and we need a consistent snapshot). Only these constraints will be resolved. | |
BodyPair * | mBodyPairs = nullptr |
A list of body pairs found by the broadphase. | |
IslandBuilder * | mIslandBuilder |
Keeps track of connected bodies and builds islands for multithreaded velocity/position update. | |
Steps | mSteps |
uint | mNumSoftBodies |
Number of active soft bodies in the simulation. | |
SoftBodyUpdateContext * | mSoftBodyUpdateContexts = nullptr |
Contexts for updating soft bodies. | |
atomic< uint > | mSoftBodyToCollide { 0 } |
Next soft body to take when running SoftBodyCollide jobs. | |
Static Public Attributes | |
static constexpr int | cMaxConcurrency = 32 |
Maximum supported amount of concurrent jobs. | |
Information used during the Update call.
using PhysicsUpdateContext::JobMask = uint32 |
A mask that has as many bits as we can have concurrent jobs.
using PhysicsUpdateContext::Steps = Array<Step, STLTempAllocator<Step> > |
|
explicit |
Destructor.
PhysicsUpdateContext::~PhysicsUpdateContext | ( | ) |
|
inline |
Maximum amount of concurrent jobs on this machine.
Need to put max concurrency in temp var as min requires a reference
|
staticconstexpr |
Maximum supported amount of concurrent jobs.
Constraint** PhysicsUpdateContext::mActiveConstraints = nullptr |
Constraints that were active at the start of the physics update step (activating bodies can activate constraints and we need a consistent snapshot). Only these constraints will be resolved.
JobSystem::Barrier* PhysicsUpdateContext::mBarrier |
Barrier used to wait for all physics jobs to complete.
BodyPair* PhysicsUpdateContext::mBodyPairs = nullptr |
A list of body pairs found by the broadphase.
atomic<uint32> PhysicsUpdateContext::mErrors { 0 } |
Errors that occurred during the update, actual type is EPhysicsUpdateError.
IslandBuilder* PhysicsUpdateContext::mIslandBuilder |
Keeps track of connected bodies and builds islands for multithreaded velocity/position update.
JobSystem* PhysicsUpdateContext::mJobSystem |
Job system that processes jobs.
uint PhysicsUpdateContext::mNumSoftBodies |
Number of active soft bodies in the simulation.
PhysicsSystem* PhysicsUpdateContext::mPhysicsSystem |
The physics system we belong to.
atomic<uint> PhysicsUpdateContext::mSoftBodyToCollide { 0 } |
Next soft body to take when running SoftBodyCollide jobs.
SoftBodyUpdateContext* PhysicsUpdateContext::mSoftBodyUpdateContexts = nullptr |
Contexts for updating soft bodies.
float PhysicsUpdateContext::mStepDeltaTime |
Delta time for a simulation step (collision step)
Steps PhysicsUpdateContext::mSteps |
TempAllocator* PhysicsUpdateContext::mTempAllocator |
Temporary allocator used during the update.
float PhysicsUpdateContext::mWarmStartImpulseRatio |
Ratio of this step delta time vs last step.