Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
PhysicsUpdateContext Class Reference

Information used during the Update call. More...

#include <PhysicsUpdateContext.h>

Inheritance diagram for PhysicsUpdateContext:
NonCopyable

Classes

struct  BodyPairQueue
 
struct  Step
 Structure that contains data needed for each collision step. More...
 
struct  SubStep
 Structure that contains job handles for each integration sub step. More...
 

Public Types

using JobHandleArray = StaticArray< JobHandle, cMaxConcurrency >
 
using SubSteps = StaticArray< SubStep, cMaxSubSteps >
 
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

PhysicsSystemmPhysicsSystem
 The physics system we belong to. More...
 
TempAllocatormTempAllocator
 Temporary allocator used during the update. More...
 
JobSystemmJobSystem
 Job system that processes jobs. More...
 
JobSystem::BarriermBarrier
 Barrier used to wait for all physics jobs to complete. More...
 
float mStepDeltaTime
 Delta time for a simulation step (collision step) More...
 
float mSubStepDeltaTime
 Delta time for a simulation sub step (integration step) More...
 
float mWarmStartImpulseRatio
 Ratio of this step delta time vs last step. More...
 
bool mUseLargeIslandSplitter
 If true, use large island splitting. More...
 
atomic< uint32mErrors { 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...
 
BodyPairmBodyPairs = nullptr
 A list of body pairs found by the broadphase. More...
 
IslandBuildermIslandBuilder
 Keeps track of connected bodies and builds islands for multithreaded velocity/position update. More...
 
Steps mSteps
 

Static Public Attributes

static constexpr int cMaxConcurrency = 32
 Maximum supported amount of concurrent jobs. More...
 
static constexpr int cMaxSubSteps = 4
 Maximum supported amount of integration sub steps. More...
 

Detailed Description

Information used during the Update call.

Member Typedef Documentation

◆ BodyPairQueues

◆ JobHandleArray

◆ JobMask

A mask that has as many bits as we can have concurrent jobs.

◆ Steps

◆ SubSteps

Constructor & Destructor Documentation

◆ PhysicsUpdateContext()

JPH_NAMESPACE_BEGIN PhysicsUpdateContext::PhysicsUpdateContext ( TempAllocator inTempAllocator)
explicit

Destructor.

◆ ~PhysicsUpdateContext()

PhysicsUpdateContext::~PhysicsUpdateContext ( )

Member Function Documentation

◆ GetMaxConcurrency()

int PhysicsUpdateContext::GetMaxConcurrency ( ) const
inline

Maximum amount of concurrent jobs on this machine.

Need to put max concurrency in temp var as min requires a reference

Member Data Documentation

◆ cMaxConcurrency

constexpr int PhysicsUpdateContext::cMaxConcurrency = 32
staticconstexpr

Maximum supported amount of concurrent jobs.

◆ cMaxSubSteps

constexpr int PhysicsUpdateContext::cMaxSubSteps = 4
staticconstexpr

Maximum supported amount of integration sub steps.

◆ mActiveConstraints

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.

◆ mBarrier

JobSystem::Barrier* PhysicsUpdateContext::mBarrier

Barrier used to wait for all physics jobs to complete.

◆ mBodyPairs

BodyPair* PhysicsUpdateContext::mBodyPairs = nullptr

A list of body pairs found by the broadphase.

◆ mErrors

atomic<uint32> PhysicsUpdateContext::mErrors { 0 }

Errors that occurred during the update, actual type is EPhysicsUpdateError.

◆ mIslandBuilder

IslandBuilder* PhysicsUpdateContext::mIslandBuilder

Keeps track of connected bodies and builds islands for multithreaded velocity/position update.

◆ mJobSystem

JobSystem* PhysicsUpdateContext::mJobSystem

Job system that processes jobs.

◆ mPhysicsSystem

PhysicsSystem* PhysicsUpdateContext::mPhysicsSystem

The physics system we belong to.

◆ mStepDeltaTime

float PhysicsUpdateContext::mStepDeltaTime

Delta time for a simulation step (collision step)

◆ mSteps

Steps PhysicsUpdateContext::mSteps

◆ mSubStepDeltaTime

float PhysicsUpdateContext::mSubStepDeltaTime

Delta time for a simulation sub step (integration step)

◆ mTempAllocator

TempAllocator* PhysicsUpdateContext::mTempAllocator

Temporary allocator used during the update.

◆ mUseLargeIslandSplitter

bool PhysicsUpdateContext::mUseLargeIslandSplitter

If true, use large island splitting.

◆ mWarmStartImpulseRatio

float PhysicsUpdateContext::mWarmStartImpulseRatio

Ratio of this step delta time vs last step.


The documentation for this class was generated from the following files: