Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
PhysicsSystem.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
16
18
19class JobSystem;
20class StateRecorder;
21class TempAllocator;
24class SimShapeFilter;
25
30{
31public:
33
35 PhysicsSystem() : mContactManager(mPhysicsSettings) JPH_IF_ENABLE_ASSERTS(, mConstraintManager(&mBodyManager)) { }
37
39 static constexpr uint cMaxBodiesLimit = BodyID::cMaxBodyIndex + 1;
40
44 static constexpr uint cMaxBodyPairsLimit = ContactConstraintManager::cMaxBodyPairsLimit;
45
49 static constexpr uint cMaxContactConstraintsLimit = ContactConstraintManager::cMaxContactConstraintsLimit;
50
59 void Init(uint inMaxBodies, uint inNumBodyMutexes, uint inMaxBodyPairs, uint inMaxContactConstraints, const BroadPhaseLayerInterface &inBroadPhaseLayerInterface, const ObjectVsBroadPhaseLayerFilter &inObjectVsBroadPhaseLayerFilter, const ObjectLayerPairFilter &inObjectLayerPairFilter);
60
62 void SetBodyActivationListener(BodyActivationListener *inListener) { mBodyManager.SetBodyActivationListener(inListener); }
63 BodyActivationListener * GetBodyActivationListener() const { return mBodyManager.GetBodyActivationListener(); }
64
67 void SetContactListener(ContactListener *inListener) { mContactManager.SetContactListener(inListener); }
68 ContactListener * GetContactListener() const { return mContactManager.GetContactListener(); }
69
71 void SetSoftBodyContactListener(SoftBodyContactListener *inListener) { mSoftBodyContactListener = inListener; }
72 SoftBodyContactListener * GetSoftBodyContactListener() const { return mSoftBodyContactListener; }
73
76 void SetCombineFriction(ContactConstraintManager::CombineFunction inCombineFriction) { mContactManager.SetCombineFriction(inCombineFriction); }
77 ContactConstraintManager::CombineFunction GetCombineFriction() const { return mContactManager.GetCombineFriction(); }
78
81 void SetCombineRestitution(ContactConstraintManager::CombineFunction inCombineRestitution) { mContactManager.SetCombineRestitution(inCombineRestitution); }
82 ContactConstraintManager::CombineFunction GetCombineRestitution() const { return mContactManager.GetCombineRestitution(); }
83
89 void SetSimShapeFilter(const SimShapeFilter *inShapeFilter) { mSimShapeFilter = inShapeFilter; }
90 const SimShapeFilter * GetSimShapeFilter() const { return mSimShapeFilter; }
91
100 using SimCollideBodyVsBody = std::function<void(const Body &inBody1, const Body &inBody2, Mat44Arg inCenterOfMassTransform1, Mat44Arg inCenterOfMassTransform2, CollideShapeSettings &ioCollideShapeSettings, CollideShapeCollector &ioCollector, const ShapeFilter &inShapeFilter)>;
101
104 void SetSimCollideBodyVsBody(const SimCollideBodyVsBody &inBodyVsBody) { mSimCollideBodyVsBody = inBodyVsBody; }
105 const SimCollideBodyVsBody &GetSimCollideBodyVsBody() const { return mSimCollideBodyVsBody; }
106
108 static void sDefaultSimCollideBodyVsBody(const Body &inBody1, const Body &inBody2, Mat44Arg inCenterOfMassTransform1, Mat44Arg inCenterOfMassTransform2, CollideShapeSettings &ioCollideShapeSettings, CollideShapeCollector &ioCollector, const ShapeFilter &inShapeFilter);
109
111 void SetPhysicsSettings(const PhysicsSettings &inSettings) { mPhysicsSettings = inSettings; }
112 const PhysicsSettings & GetPhysicsSettings() const { return mPhysicsSettings; }
113
115 const BodyInterface & GetBodyInterface() const { return mBodyInterfaceLocking; }
116 BodyInterface & GetBodyInterface() { return mBodyInterfaceLocking; }
117 const BodyInterface & GetBodyInterfaceNoLock() const { return mBodyInterfaceNoLock; }
118 BodyInterface & GetBodyInterfaceNoLock() { return mBodyInterfaceNoLock; }
119
121 const BroadPhaseQuery & GetBroadPhaseQuery() const { return *mBroadPhase; }
122
124 const NarrowPhaseQuery & GetNarrowPhaseQuery() const { return mNarrowPhaseQueryLocking; }
125 const NarrowPhaseQuery & GetNarrowPhaseQueryNoLock() const { return mNarrowPhaseQueryNoLock; }
126
128 void AddConstraint(Constraint *inConstraint) { mConstraintManager.Add(&inConstraint, 1); }
129
131 void RemoveConstraint(Constraint *inConstraint) { mConstraintManager.Remove(&inConstraint, 1); }
132
134 void AddConstraints(Constraint **inConstraints, int inNumber) { mConstraintManager.Add(inConstraints, inNumber); }
135
137 void RemoveConstraints(Constraint **inConstraints, int inNumber) { mConstraintManager.Remove(inConstraints, inNumber); }
138
140 Constraints GetConstraints() const { return mConstraintManager.GetConstraints(); }
141
148 void OptimizeBroadPhase();
149
151 void AddStepListener(PhysicsStepListener *inListener);
152
154 void RemoveStepListener(PhysicsStepListener *inListener);
155
162 EPhysicsUpdateError Update(float inDeltaTime, int inCollisionSteps, TempAllocator *inTempAllocator, JobSystem *inJobSystem);
163
165 void SaveState(StateRecorder &inStream, EStateRecorderState inState = EStateRecorderState::All, const StateRecorderFilter *inFilter = nullptr) const;
166
168 bool RestoreState(StateRecorder &inStream, const StateRecorderFilter *inFilter = nullptr);
169
171 void SaveBodyState(const Body &inBody, StateRecorder &inStream) const;
172
174 void RestoreBodyState(Body &ioBody, StateRecorder &inStream);
175
176#ifdef JPH_DEBUG_RENDERER
177 // Drawing properties
179
181 void DrawBodies(const BodyManager::DrawSettings &inSettings, DebugRenderer *inRenderer, const BodyDrawFilter *inBodyFilter = nullptr) { mBodyManager.Draw(inSettings, mPhysicsSettings, inRenderer, inBodyFilter); }
182
184 void DrawConstraints(DebugRenderer *inRenderer) { mConstraintManager.DrawConstraints(inRenderer); }
185
187 void DrawConstraintLimits(DebugRenderer *inRenderer) { mConstraintManager.DrawConstraintLimits(inRenderer); }
188
190 void DrawConstraintReferenceFrame(DebugRenderer *inRenderer) { mConstraintManager.DrawConstraintReferenceFrame(inRenderer); }
191#endif // JPH_DEBUG_RENDERER
192
194 void SetGravity(Vec3Arg inGravity) { mGravity = inGravity; }
195 Vec3 GetGravity() const { return mGravity; }
196
198 inline const BodyLockInterfaceNoLock & GetBodyLockInterfaceNoLock() const { return mBodyLockInterfaceNoLock; }
199
201 inline const BodyLockInterfaceLocking & GetBodyLockInterface() const { return mBodyLockInterfaceLocking; }
202
204 const ObjectVsBroadPhaseLayerFilter &GetObjectVsBroadPhaseLayerFilter() const { return *mObjectVsBroadPhaseLayerFilter; }
205
207 const ObjectLayerPairFilter &GetObjectLayerPairFilter() const { return *mObjectLayerPairFilter; }
208
210 DefaultBroadPhaseLayerFilter GetDefaultBroadPhaseLayerFilter(ObjectLayer inLayer) const { return DefaultBroadPhaseLayerFilter(*mObjectVsBroadPhaseLayerFilter, inLayer); }
211
213 DefaultObjectLayerFilter GetDefaultLayerFilter(ObjectLayer inLayer) const { return DefaultObjectLayerFilter(*mObjectLayerPairFilter, inLayer); }
214
216 uint GetNumBodies() const { return mBodyManager.GetNumBodies(); }
217
219 uint32 GetNumActiveBodies(EBodyType inType) const { return mBodyManager.GetNumActiveBodies(inType); }
220
222 uint GetMaxBodies() const { return mBodyManager.GetMaxBodies(); }
223
226
228 BodyStats GetBodyStats() const { return mBodyManager.GetBodyStats(); }
229
232 void GetBodies(BodyIDVector &outBodyIDs) const { return mBodyManager.GetBodyIDs(outBodyIDs); }
233
237 void GetActiveBodies(EBodyType inType, BodyIDVector &outBodyIDs) const { return mBodyManager.GetActiveBodies(inType, outBodyIDs); }
238
241 const BodyID * GetActiveBodiesUnsafe(EBodyType inType) const { return mBodyManager.GetActiveBodiesUnsafe(inType); }
242
248 bool WereBodiesInContact(const BodyID &inBody1ID, const BodyID &inBody2ID) const { return mContactManager.WereBodiesInContact(inBody1ID, inBody2ID); }
249
251 AABox GetBounds() const { return mBroadPhase->GetBounds(); }
252
253#ifdef JPH_TRACK_BROADPHASE_STATS
255 void ReportBroadphaseStats() { mBroadPhase->ReportStats(); }
256#endif // JPH_TRACK_BROADPHASE_STATS
257
258#if defined(JPH_TRACK_SIMULATION_STATS) && defined(JPH_PROFILE_ENABLED)
260 void ReportSimulationStats() { mBodyManager.ReportSimulationStats(); }
261#endif
262
263private:
264 using CCDBody = PhysicsUpdateContext::Step::CCDBody;
265
266 // Various job entry points
267 void JobStepListeners(PhysicsUpdateContext::Step *ioStep);
268 void JobDetermineActiveConstraints(PhysicsUpdateContext::Step *ioStep) const;
269 void JobApplyGravity(const PhysicsUpdateContext *ioContext, PhysicsUpdateContext::Step *ioStep);
270 void JobSetupVelocityConstraints(float inDeltaTime, PhysicsUpdateContext::Step *ioStep) const;
271 void JobBuildIslandsFromConstraints(PhysicsUpdateContext *ioContext, PhysicsUpdateContext::Step *ioStep);
272 void JobFindCollisions(PhysicsUpdateContext::Step *ioStep, int inJobIndex);
273 void JobFinalizeIslands(PhysicsUpdateContext *ioContext);
274 void JobBodySetIslandIndex();
275 void JobSolveVelocityConstraints(PhysicsUpdateContext *ioContext, PhysicsUpdateContext::Step *ioStep);
276 void JobPreIntegrateVelocity(PhysicsUpdateContext *ioContext, PhysicsUpdateContext::Step *ioStep);
277 void JobIntegrateVelocity(const PhysicsUpdateContext *ioContext, PhysicsUpdateContext::Step *ioStep);
278 void JobPostIntegrateVelocity(PhysicsUpdateContext *ioContext, PhysicsUpdateContext::Step *ioStep) const;
279 void JobFindCCDContacts(const PhysicsUpdateContext *ioContext, PhysicsUpdateContext::Step *ioStep);
280 void JobResolveCCDContacts(PhysicsUpdateContext *ioContext, PhysicsUpdateContext::Step *ioStep);
281 void JobContactRemovedCallbacks(const PhysicsUpdateContext::Step *ioStep);
282 void JobSolvePositionConstraints(PhysicsUpdateContext *ioContext, PhysicsUpdateContext::Step *ioStep);
283 void JobSoftBodyPrepare(PhysicsUpdateContext *ioContext, PhysicsUpdateContext::Step *ioStep);
284 void JobSoftBodyCollide(PhysicsUpdateContext *ioContext) const;
285 void JobSoftBodySimulate(PhysicsUpdateContext *ioContext, uint inThreadIndex) const;
286 void JobSoftBodyFinalize(PhysicsUpdateContext *ioContext);
287
289 void TrySpawnJobFindCollisions(PhysicsUpdateContext::Step *ioStep) const;
290
291#ifdef JPH_TRACK_SIMULATION_STATS
293 void GatherIslandStats();
294#endif
295
296 using ContactAllocator = ContactConstraintManager::ContactAllocator;
297
299 void ProcessBodyPair(ContactAllocator &ioContactAllocator, const BodyPair &inBodyPair);
300
302 class BodiesToSleep;
303
305 void CheckSleepAndUpdateBounds(uint32 inIslandIndex, const PhysicsUpdateContext *ioContext, const PhysicsUpdateContext::Step *ioStep, BodiesToSleep &ioBodiesToSleep);
306
308 static constexpr int cDetermineActiveConstraintsBatchSize = 64;
309
311 static constexpr int cSetupVelocityConstraintsBatchSize = 256;
312
314 static constexpr int cApplyGravityBatchSize = 64;
315
317 static constexpr int cActiveBodiesBatchSize = 16;
318
320 static constexpr int cIntegrateVelocityBatchSize = 64;
321
323 static constexpr int cNarrowPhaseBatchSize = 16;
324
326 static constexpr int cNumCCDBodiesPerJob = 4;
327
329 const ObjectVsBroadPhaseLayerFilter *mObjectVsBroadPhaseLayerFilter = nullptr;
330
332 const ObjectLayerPairFilter *mObjectLayerPairFilter = nullptr;
333
335 BodyManager mBodyManager;
336
338 BodyLockInterfaceNoLock mBodyLockInterfaceNoLock { mBodyManager };
339 BodyLockInterfaceLocking mBodyLockInterfaceLocking { mBodyManager };
340
342 BodyInterface mBodyInterfaceNoLock;
343 BodyInterface mBodyInterfaceLocking;
344
346 NarrowPhaseQuery mNarrowPhaseQueryNoLock;
347 NarrowPhaseQuery mNarrowPhaseQueryLocking;
348
350 BroadPhase * mBroadPhase = nullptr;
351
353 SoftBodyContactListener * mSoftBodyContactListener = nullptr;
354
356 const SimShapeFilter * mSimShapeFilter = nullptr;
357
359 SimCollideBodyVsBody mSimCollideBodyVsBody = &sDefaultSimCollideBodyVsBody;
360
362 PhysicsSettings mPhysicsSettings;
363
365 ContactConstraintManager mContactManager;
366
368 ConstraintManager mConstraintManager;
369
371 IslandBuilder mIslandBuilder;
372
374 LargeIslandSplitter mLargeIslandSplitter;
375
377 Mutex mStepListenersMutex;
378
380 using StepListeners = Array<PhysicsStepListener *>;
381 StepListeners mStepListeners;
382
384 Vec3 mGravity = Vec3(0, -9.81f, 0);
385
387 float mPreviousStepDeltaTime = 0.0f;
388};
389
EBodyType
Type of body.
Definition BodyType.h:11
#define JPH_EXPORT
Definition Core.h:275
unsigned int uint
Definition Core.h:493
#define JPH_NAMESPACE_END
Definition Core.h:419
std::uint32_t uint32
Definition Core.h:496
#define JPH_NAMESPACE_BEGIN
Definition Core.h:413
EPhysicsUpdateError
Enum used by PhysicsSystem to report error conditions during the PhysicsSystem::Update call....
Definition EPhysicsUpdateError.h:11
#define JPH_IF_ENABLE_ASSERTS(...)
Definition IssueReporting.h:35
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:43
uint16 ObjectLayer
Definition ObjectLayer.h:16
EStateRecorderState
A bit field that determines which aspects of the simulation to save.
Definition StateRecorder.h:21
@ All
Save all state.
Axis aligned box.
Definition AABox.h:16
Definition BodyActivationListener.h:14
Class function to filter out bodies for debug rendering, returns true if body should be rendered.
Definition BodyFilter.h:117
Definition Body.h:39
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition BodyID.h:13
static constexpr uint32 cMaxBodyIndex
Maximum value for body index (also the maximum amount of bodies supported - 1)
Definition BodyID.h:19
Definition BodyInterface.h:36
Implementation that uses the body manager to lock the correct mutex for a body.
Definition BodyLockInterface.h:78
Implementation that performs no locking (assumes the lock has already been taken)
Definition BodyLockInterface.h:58
Definition BodyManager.h:47
Used to do coarse collision detection operations to quickly prune out bodies that will not collide.
Definition BroadPhase.h:26
Interface that the application should implement to allow mapping object layers to broadphase layers.
Definition BroadPhaseLayer.h:61
Definition BroadPhaseQuery.h:29
Settings to be passed with a collision query.
Definition CollideShape.h:94
Virtual interface that allows collecting multiple collision results.
Definition CollisionCollector.h:45
Base class for all physics constraints. A constraint removes one or more degrees of freedom for a rig...
Definition Constraint.h:108
Definition ConstraintManager.h:28
Contacts are allocated in a lock free hash map.
Definition ContactConstraintManager.h:83
Definition ContactConstraintManager.h:31
static constexpr uint cMaxContactConstraintsLimit
The maximum value that can be passed to Init for inMaxContactConstraints. Note you should really use ...
Definition ContactConstraintManager.h:480
float(*)(const Body &inBody1, const SubShapeID &inSubShapeID1, const Body &inBody2, const SubShapeID &inSubShapeID2) CombineFunction
Definition ContactConstraintManager.h:51
static constexpr uint cMaxBodyPairsLimit
The maximum value that can be passed to Init for inMaxBodyPairs. Note you should really use a lower v...
Definition ContactConstraintManager.h:483
Definition ContactListener.h:79
Definition DebugRenderer.h:47
Default filter class that uses the pair filter in combination with a specified layer to filter layers...
Definition BroadPhaseLayer.h:108
Default filter class that uses the pair filter in combination with a specified layer to filter layers...
Definition ObjectLayer.h:64
Keeps track of connected bodies and builds islands for multithreaded velocity/position update.
Definition IslandBuilder.h:19
Definition JobSystem.h:70
Definition LargeIslandSplitter.h:27
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
Definition Mutex.h:122
Definition NarrowPhaseQuery.h:23
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11
Filter class to test if two objects can collide based on their object layer. Used while finding colli...
Definition ObjectLayer.h:50
Class to test if an object can collide with a broadphase layer. Used while finding collision pairs.
Definition BroadPhaseLayer.h:80
A listener class that receives a callback before every physics simulation step.
Definition PhysicsStepListener.h:23
Definition PhysicsSystem.h:30
void GetBodies(BodyIDVector &outBodyIDs) const
Definition PhysicsSystem.h:232
void DrawConstraintReferenceFrame(DebugRenderer *inRenderer)
Draw the constraint reference frames only (debugging purposes)
Definition PhysicsSystem.h:190
const SimShapeFilter * GetSimShapeFilter() const
Definition PhysicsSystem.h:90
void SetCombineRestitution(ContactConstraintManager::CombineFunction inCombineRestitution)
Definition PhysicsSystem.h:81
const ObjectVsBroadPhaseLayerFilter & GetObjectVsBroadPhaseLayerFilter() const
Broadphase layer filter that decides if two objects can collide, this was passed to the Init function...
Definition PhysicsSystem.h:204
const NarrowPhaseQuery & GetNarrowPhaseQuery() const
Interface that allows fine collision queries against first the broad phase and then the narrow phase.
Definition PhysicsSystem.h:124
void RemoveConstraints(Constraint **inConstraints, int inNumber)
Batch remove constraints.
Definition PhysicsSystem.h:137
const ObjectLayerPairFilter & GetObjectLayerPairFilter() const
Object layer filter that decides if two objects can collide, this was passed to the Init function.
Definition PhysicsSystem.h:207
uint GetNumBodies() const
Gets the current amount of bodies that are in the body manager.
Definition PhysicsSystem.h:216
uint32 GetNumActiveBodies(EBodyType inType) const
Gets the current amount of active bodies that are in the body manager.
Definition PhysicsSystem.h:219
void SetPhysicsSettings(const PhysicsSettings &inSettings)
Control the main constants of the physics simulation.
Definition PhysicsSystem.h:111
void SetSoftBodyContactListener(SoftBodyContactListener *inListener)
Listener that is notified whenever a contact point between a soft body and another body.
Definition PhysicsSystem.h:71
const BodyInterface & GetBodyInterface() const
Access to the body interface. This interface allows to to create / remove bodies and to change their ...
Definition PhysicsSystem.h:115
const BroadPhaseQuery & GetBroadPhaseQuery() const
Access to the broadphase interface that allows coarse collision queries.
Definition PhysicsSystem.h:121
const BodyLockInterfaceLocking & GetBodyLockInterface() const
Returns a locking interface that locks the body so other threads cannot modify it.
Definition PhysicsSystem.h:201
const NarrowPhaseQuery & GetNarrowPhaseQueryNoLock() const
Version that does not lock the bodies, use with great care!
Definition PhysicsSystem.h:125
void DrawConstraints(DebugRenderer *inRenderer)
Draw the constraints only (debugging purposes)
Definition PhysicsSystem.h:184
const PhysicsSettings & GetPhysicsSettings() const
Definition PhysicsSystem.h:112
const BodyInterface & GetBodyInterfaceNoLock() const
Version that does not lock the bodies, use with great care!
Definition PhysicsSystem.h:117
BodyInterface & GetBodyInterface()
Definition PhysicsSystem.h:116
void DrawConstraintLimits(DebugRenderer *inRenderer)
Draw the constraint limits only (debugging purposes)
Definition PhysicsSystem.h:187
Constraints GetConstraints() const
Get a list of all constraints.
Definition PhysicsSystem.h:140
void AddConstraint(Constraint *inConstraint)
Add constraint to the world.
Definition PhysicsSystem.h:128
std::function< void(const Body &inBody1, const Body &inBody2, Mat44Arg inCenterOfMassTransform1, Mat44Arg inCenterOfMassTransform2, CollideShapeSettings &ioCollideShapeSettings, CollideShapeCollector &ioCollector, const ShapeFilter &inShapeFilter)> SimCollideBodyVsBody
Definition PhysicsSystem.h:100
Vec3 GetGravity() const
Definition PhysicsSystem.h:195
uint GetMaxBodies() const
Get the maximum amount of bodies that this physics system supports.
Definition PhysicsSystem.h:222
void RemoveConstraint(Constraint *inConstraint)
Remove constraint from the world.
Definition PhysicsSystem.h:131
AABox GetBounds() const
Get the bounding box of all bodies in the physics system.
Definition PhysicsSystem.h:251
void DrawBodies(const BodyManager::DrawSettings &inSettings, DebugRenderer *inRenderer, const BodyDrawFilter *inBodyFilter=nullptr)
Draw the state of the bodies (debugging purposes)
Definition PhysicsSystem.h:181
BodyActivationListener * GetBodyActivationListener() const
Definition PhysicsSystem.h:63
DefaultBroadPhaseLayerFilter GetDefaultBroadPhaseLayerFilter(ObjectLayer inLayer) const
Get an broadphase layer filter that uses the default pair filter and a specified object layer to dete...
Definition PhysicsSystem.h:210
BodyInterface & GetBodyInterfaceNoLock()
Version that does not lock the bodies, use with great care!
Definition PhysicsSystem.h:118
void SetSimCollideBodyVsBody(const SimCollideBodyVsBody &inBodyVsBody)
Definition PhysicsSystem.h:104
void SetSimShapeFilter(const SimShapeFilter *inShapeFilter)
Definition PhysicsSystem.h:89
void GetActiveBodies(EBodyType inType, BodyIDVector &outBodyIDs) const
Definition PhysicsSystem.h:237
ContactConstraintManager::CombineFunction GetCombineRestitution() const
Definition PhysicsSystem.h:82
JPH_OVERRIDE_NEW_DELETE PhysicsSystem()
Constructor / Destructor.
Definition PhysicsSystem.h:35
static bool sDrawMotionQualityLinearCast
Draw debug info for objects that perform continuous collision detection through the linear cast motio...
Definition PhysicsSystem.h:178
void SetGravity(Vec3Arg inGravity)
Set gravity value.
Definition PhysicsSystem.h:194
const BodyLockInterfaceNoLock & GetBodyLockInterfaceNoLock() const
Returns a locking interface that won't actually lock the body. Use with great care!
Definition PhysicsSystem.h:198
BodyStats GetBodyStats() const
Get stats about the bodies in the body manager (slow, iterates through all bodies)
Definition PhysicsSystem.h:228
void AddConstraints(Constraint **inConstraints, int inNumber)
Batch add constraints.
Definition PhysicsSystem.h:134
bool WereBodiesInContact(const BodyID &inBody1ID, const BodyID &inBody2ID) const
Definition PhysicsSystem.h:248
DefaultObjectLayerFilter GetDefaultLayerFilter(ObjectLayer inLayer) const
Get an object layer filter that uses the default pair filter and a specified layer to determine if la...
Definition PhysicsSystem.h:213
void SetContactListener(ContactListener *inListener)
Definition PhysicsSystem.h:67
SoftBodyContactListener * GetSoftBodyContactListener() const
Definition PhysicsSystem.h:72
ContactConstraintManager::CombineFunction GetCombineFriction() const
Definition PhysicsSystem.h:77
void SetCombineFriction(ContactConstraintManager::CombineFunction inCombineFriction)
Definition PhysicsSystem.h:76
const BodyID * GetActiveBodiesUnsafe(EBodyType inType) const
Definition PhysicsSystem.h:241
void SetBodyActivationListener(BodyActivationListener *inListener)
Listener that is notified whenever a body is activated/deactivated.
Definition PhysicsSystem.h:62
ContactListener * GetContactListener() const
Definition PhysicsSystem.h:68
const SimCollideBodyVsBody & GetSimCollideBodyVsBody() const
Definition PhysicsSystem.h:105
Filter class.
Definition ShapeFilter.h:17
Filter class used during the simulation (PhysicsSystem::Update) to filter out collisions at shape lev...
Definition SimShapeFilter.h:17
Definition SoftBodyContactListener.h:33
User callbacks that allow determining which parts of the simulation should be saved by a StateRecorde...
Definition StateRecorder.h:79
Definition StateRecorder.h:110
Definition TempAllocator.h:16
Definition Vec3.h:17
Helper struct that counts the number of bodies of each type.
Definition BodyManager.h:65
Draw settings.
Definition BodyManager.h:234
Structure that holds a body pair.
Definition BodyPair.h:14
Definition PhysicsSettings.h:28