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. More... | |
using | Steps = std::vector< Step, STLTempAllocator< Step > > |
Public Member Functions | |
PhysicsUpdateContext (TempAllocator &inTempAllocator) | |
Destructor. More... | |
~PhysicsUpdateContext () | |
int | GetMaxConcurrency () const |
Maximum amount of concurrent jobs on this machine. More... | |
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. More... | |
TempAllocator * | mTempAllocator |
Temporary allocator used during the update. More... | |
JobSystem * | mJobSystem |
Job system that processes jobs. More... | |
JobSystem::Barrier * | mBarrier |
Barrier used to wait for all physics jobs to complete. More... | |
float | mStepDeltaTime |
Delta time for a simulation step (collision step) More... | |
float | mWarmStartImpulseRatio |
Ratio of this step delta time vs last step. More... | |
atomic< uint32 > | mErrors { 0 } |
Errors that occurred during the update, actual type is EPhysicsUpdateError. More... | |
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. More... | |
BodyPair * | mBodyPairs = nullptr |
A list of body pairs found by the broadphase. More... | |
IslandBuilder * | mIslandBuilder |
Keeps track of connected bodies and builds islands for multithreaded velocity/position update. More... | |
Steps | mSteps |
uint | mNumSoftBodies |
Number of active soft bodies in the simulation. More... | |
SoftBodyUpdateContext * | mSoftBodyUpdateContexts = nullptr |
Contexts for updating soft bodies. More... | |
atomic< uint > | mSoftBodyToCollide { 0 } |
Next soft body to take when running SoftBodyCollide jobs. More... | |
Static Public Attributes | |
static constexpr int | cMaxConcurrency = 32 |
Maximum supported amount of concurrent jobs. More... | |
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 = std::vector<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.