Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
PhysicsStepListener Class Referenceabstract

A listener class that receives a callback before every physics simulation step. More...

#include <PhysicsStepListener.h>

Inheritance diagram for PhysicsStepListener:
VehicleConstraint

Public Member Functions

virtual ~PhysicsStepListener ()=default
 Ensure virtual destructor. More...
 
virtual void OnStep (float inDeltaTime, PhysicsSystem &inPhysicsSystem)=0
 

Detailed Description

A listener class that receives a callback before every physics simulation step.

Constructor & Destructor Documentation

◆ ~PhysicsStepListener()

virtual PhysicsStepListener::~PhysicsStepListener ( )
virtualdefault

Ensure virtual destructor.

Member Function Documentation

◆ OnStep()

virtual void PhysicsStepListener::OnStep ( float  inDeltaTime,
PhysicsSystem inPhysicsSystem 
)
pure virtual

Called before every simulation step (received inCollisionSteps times for every PhysicsSystem::Update(...) call) This is called while all body and constraint mutexes are locked. You can read/write bodies and constraints but not add/remove them. Multiple listeners can be executed in parallel and it is the responsibility of the listener to avoid race conditions. The best way to do this is to have each step listener operate on a subset of the bodies and constraints and making sure that these bodies and constraints are not touched by any other step listener. Note that this function is not called if there aren't any active bodies or when the physics system is updated with 0 delta time.


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