|
JPH_OVERRIDE_NEW_DELETE | PhysicsSystem () |
| Constructor / Destructor.
|
|
| ~PhysicsSystem () |
|
void | Init (uint inMaxBodies, uint inNumBodyMutexes, uint inMaxBodyPairs, uint inMaxContactConstraints, const BroadPhaseLayerInterface &inBroadPhaseLayerInterface, const ObjectVsBroadPhaseLayerFilter &inObjectVsBroadPhaseLayerFilter, const ObjectLayerPairFilter &inObjectLayerPairFilter) |
|
void | SetBodyActivationListener (BodyActivationListener *inListener) |
| Listener that is notified whenever a body is activated/deactivated.
|
|
BodyActivationListener * | GetBodyActivationListener () const |
|
void | SetContactListener (ContactListener *inListener) |
| Listener that is notified whenever a contact point between two bodies is added/updated/removed.
|
|
ContactListener * | GetContactListener () const |
|
void | SetSoftBodyContactListener (SoftBodyContactListener *inListener) |
| Listener that is notified whenever a contact point between a soft body and another body.
|
|
SoftBodyContactListener * | GetSoftBodyContactListener () const |
|
void | SetCombineFriction (ContactConstraintManager::CombineFunction inCombineFriction) |
|
ContactConstraintManager::CombineFunction | GetCombineFriction () const |
|
void | SetCombineRestitution (ContactConstraintManager::CombineFunction inCombineRestition) |
|
ContactConstraintManager::CombineFunction | GetCombineRestitution () const |
|
void | SetPhysicsSettings (const PhysicsSettings &inSettings) |
| Control the main constants of the physics simulation.
|
|
const PhysicsSettings & | GetPhysicsSettings () const |
|
const BodyInterface & | GetBodyInterface () const |
| Access to the body interface. This interface allows to to create / remove bodies and to change their properties.
|
|
BodyInterface & | GetBodyInterface () |
|
const BodyInterface & | GetBodyInterfaceNoLock () const |
| Version that does not lock the bodies, use with great care!
|
|
BodyInterface & | GetBodyInterfaceNoLock () |
| Version that does not lock the bodies, use with great care!
|
|
const BroadPhaseQuery & | GetBroadPhaseQuery () const |
| Access to the broadphase interface that allows coarse collision queries.
|
|
const NarrowPhaseQuery & | GetNarrowPhaseQuery () const |
| Interface that allows fine collision queries against first the broad phase and then the narrow phase.
|
|
const NarrowPhaseQuery & | GetNarrowPhaseQueryNoLock () const |
| Version that does not lock the bodies, use with great care!
|
|
void | AddConstraint (Constraint *inConstraint) |
| Add constraint to the world.
|
|
void | RemoveConstraint (Constraint *inConstraint) |
| Remove constraint from the world.
|
|
void | AddConstraints (Constraint **inConstraints, int inNumber) |
| Batch add constraints. Note that the inConstraints array is allowed to have nullptrs, these will be ignored.
|
|
void | RemoveConstraints (Constraint **inConstraints, int inNumber) |
| Batch remove constraints. Note that the inConstraints array is allowed to have nullptrs, these will be ignored.
|
|
Constraints | GetConstraints () const |
| Get a list of all constraints.
|
|
void | OptimizeBroadPhase () |
| Optimize the broadphase, needed only if you've added many bodies prior to calling Update() for the first time.
|
|
void | AddStepListener (PhysicsStepListener *inListener) |
| Adds a new step listener.
|
|
void | RemoveStepListener (PhysicsStepListener *inListener) |
| Removes a step listener.
|
|
EPhysicsUpdateError | Update (float inDeltaTime, int inCollisionSteps, TempAllocator *inTempAllocator, JobSystem *inJobSystem) |
|
void | SaveState (StateRecorder &inStream, EStateRecorderState inState=EStateRecorderState::All, const StateRecorderFilter *inFilter=nullptr) const |
| Saving state for replay.
|
|
bool | RestoreState (StateRecorder &inStream) |
| Restoring state for replay. Returns false if failed.
|
|
void | SaveBodyState (const Body &inBody, StateRecorder &inStream) const |
| Saving state of a single body.
|
|
void | RestoreBodyState (Body &ioBody, StateRecorder &inStream) |
| Restoring state of a single body.
|
|
void | DrawBodies (const BodyManager::DrawSettings &inSettings, DebugRenderer *inRenderer, const BodyDrawFilter *inBodyFilter=nullptr) |
| Draw the state of the bodies (debugging purposes)
|
|
void | DrawConstraints (DebugRenderer *inRenderer) |
| Draw the constraints only (debugging purposes)
|
|
void | DrawConstraintLimits (DebugRenderer *inRenderer) |
| Draw the constraint limits only (debugging purposes)
|
|
void | DrawConstraintReferenceFrame (DebugRenderer *inRenderer) |
| Draw the constraint reference frames only (debugging purposes)
|
|
void | SetGravity (Vec3Arg inGravity) |
| Set gravity value.
|
|
Vec3 | GetGravity () const |
|
const BodyLockInterfaceNoLock & | GetBodyLockInterfaceNoLock () const |
| Returns a locking interface that won't actually lock the body. Use with great care!
|
|
const BodyLockInterfaceLocking & | GetBodyLockInterface () const |
| Returns a locking interface that locks the body so other threads cannot modify it.
|
|
DefaultBroadPhaseLayerFilter | GetDefaultBroadPhaseLayerFilter (ObjectLayer inLayer) const |
| Get an broadphase layer filter that uses the default pair filter and a specified object layer to determine if broadphase layers collide.
|
|
DefaultObjectLayerFilter | GetDefaultLayerFilter (ObjectLayer inLayer) const |
| Get an object layer filter that uses the default pair filter and a specified layer to determine if layers collide.
|
|
uint | GetNumBodies () const |
| Gets the current amount of bodies that are in the body manager.
|
|
uint32 | GetNumActiveBodies (EBodyType inType) const |
| Gets the current amount of active bodies that are in the body manager.
|
|
uint | GetMaxBodies () const |
| Get the maximum amount of bodies that this physics system supports.
|
|
BodyStats | GetBodyStats () const |
| Get stats about the bodies in the body manager (slow, iterates through all bodies)
|
|
void | GetBodies (BodyIDVector &outBodyIDs) const |
|
void | GetActiveBodies (EBodyType inType, BodyIDVector &outBodyIDs) const |
|
const BodyID * | GetActiveBodiesUnsafe (EBodyType inType) const |
|
bool | WereBodiesInContact (const BodyID &inBody1ID, const BodyID &inBody2ID) const |
|
AABox | GetBounds () const |
| Get the bounding box of all bodies in the physics system.
|
|
| NonCopyable ()=default |
|
| NonCopyable (const NonCopyable &)=delete |
|
void | operator= (const NonCopyable &)=delete |
|
The main class for the physics system. It contains all rigid bodies and simulates them.
The main simulation is performed by the Update() call on multiple threads (if the JobSystem is configured to use them). Please refer to the general architecture overview in the Docs folder for more information.