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...
 

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

PhysicsSystemmPhysicsSystem
 The physics system we belong to.
 
TempAllocatormTempAllocator
 Temporary allocator used during the update.
 
JobSystemmJobSystem
 Job system that processes jobs.
 
JobSystem::BarriermBarrier
 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< uint32mErrors { 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.
 
BodyPairmBodyPairs = nullptr
 A list of body pairs found by the broadphase.
 
IslandBuildermIslandBuilder
 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.
 
SoftBodyUpdateContextmSoftBodyUpdateContexts = nullptr
 Contexts for updating soft bodies.
 
atomic< uintmSoftBodyToCollide { 0 }
 Next soft body to take when running SoftBodyCollide jobs.
 

Static Public Attributes

static constexpr int cMaxConcurrency = 32
 Maximum supported amount of concurrent jobs.
 

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

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.

◆ 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.

◆ mNumSoftBodies

uint PhysicsUpdateContext::mNumSoftBodies

Number of active soft bodies in the simulation.

◆ mPhysicsSystem

PhysicsSystem* PhysicsUpdateContext::mPhysicsSystem

The physics system we belong to.

◆ mSoftBodyToCollide

atomic<uint> PhysicsUpdateContext::mSoftBodyToCollide { 0 }

Next soft body to take when running SoftBodyCollide jobs.

◆ mSoftBodyUpdateContexts

SoftBodyUpdateContext* PhysicsUpdateContext::mSoftBodyUpdateContexts = nullptr

Contexts for updating soft bodies.

◆ mStepDeltaTime

float PhysicsUpdateContext::mStepDeltaTime

Delta time for a simulation step (collision step)

◆ mSteps

Steps PhysicsUpdateContext::mSteps

◆ mTempAllocator

TempAllocator* PhysicsUpdateContext::mTempAllocator

Temporary allocator used during the update.

◆ mWarmStartImpulseRatio

float PhysicsUpdateContext::mWarmStartImpulseRatio

Ratio of this step delta time vs last step.


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