15#ifdef JPH_DEBUG_RENDERER
28#ifdef JPH_ENABLE_ASSERTS
77#ifdef JPH_DEBUG_RENDERER
99#ifdef JPH_ENABLE_ASSERTS
100 PhysicsLockContext mLockContext;
103 mutable Mutex mConstraintsMutex;
Array< Ref< Constraint > > Constraints
A list of constraints.
Definition ConstraintManager.h:20
uint32_t uint32
Definition Core.h:312
#define JPH_NAMESPACE_END
Definition Core.h:240
#define JPH_NAMESPACE_BEGIN
Definition Core.h:234
#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:29
std::vector< T, STLAllocator< T > > Array
Definition STLAllocator.h:81
Class that contains all bodies.
Definition BodyManager.h:30
Base class for all physics constraints. A constraint removes one or more degrees of freedom for a rig...
Definition Constraint.h:99
A constraint manager manages all constraints of the same type.
Definition ConstraintManager.h:24
void SaveState(StateRecorder &inStream) const
Save state of constraints.
Definition ConstraintManager.cpp:229
static void sSortConstraints(Constraint **inActiveConstraints, uint32 *inConstraintIdxBegin, uint32 *inConstraintIdxEnd)
In order to have a deterministic simulation, we need to sort the constraints of an island before solv...
Definition ConstraintManager.cpp:102
Constraints GetConstraints() const
Get a list of all constraints.
Definition ConstraintManager.cpp:62
static void sWarmStartVelocityConstraints(Constraint **inActiveConstraints, const uint32 *inConstraintIdxBegin, const uint32 *inConstraintIdxEnd, float inWarmStartImpulseRatio)
Apply last frame's impulses, must be called prior to SolveVelocityConstraints.
Definition ConstraintManager.cpp:128
static bool sSolvePositionConstraints(Constraint **inActiveConstraints, const uint32 *inConstraintIdxBegin, const uint32 *inConstraintIdxEnd, float inDeltaTime, float inBaumgarte)
This function is called multiple times to iteratively come to a solution that meets all position cons...
Definition ConstraintManager.cpp:166
void GetActiveConstraints(uint32 inStartConstraintIdx, uint32 inEndConstraintIdx, Constraint **outActiveConstraints, uint32 &outNumActiveConstraints) const
Determine the active constraints of a subset of the constraints.
Definition ConstraintManager.cpp:70
static void sBuildIslands(Constraint **inActiveConstraints, uint32 inNumActiveConstraints, IslandBuilder &ioBuilder, BodyManager &inBodyManager)
Link bodies to form islands.
Definition ConstraintManager.cpp:91
void DrawConstraintReferenceFrame(DebugRenderer *inRenderer) const
Draw all constraint reference frames.
Definition ConstraintManager.cpp:218
bool RestoreState(StateRecorder &inStream)
Restore the state of constraints. Returns false if failed.
Definition ConstraintManager.cpp:240
static bool sSolveVelocityConstraints(Constraint **inActiveConstraints, const uint32 *inConstraintIdxBegin, const uint32 *inConstraintIdxEnd, float inDeltaTime)
This function is called multiple times to iteratively come to a solution that meets all velocity cons...
Definition ConstraintManager.cpp:151
void Remove(Constraint **inConstraint, int inNumber)
Definition ConstraintManager.cpp:35
void DrawConstraints(DebugRenderer *inRenderer) const
Draw all constraints.
Definition ConstraintManager.cpp:198
uint32 GetNumConstraints() const
Get total number of constraints.
Definition ConstraintManager.h:45
void DrawConstraintLimits(DebugRenderer *inRenderer) const
Draw all constraint limits.
Definition ConstraintManager.cpp:208
JPH_OVERRIDE_NEW_DELETE void Add(Constraint **inConstraints, int inNumber)
Definition ConstraintManager.cpp:16
void LockAllConstraints()
Lock all constraints. This should only be done during PhysicsSystem::Update().
Definition ConstraintManager.h:95
void UnlockAllConstraints()
Definition ConstraintManager.h:96
static void sSetupVelocityConstraints(Constraint **inActiveConstraints, uint32 inNumActiveConstraints, float inDeltaTime)
Prior to solving the velocity constraints, you must call SetupVelocityConstraints once to precalculat...
Definition ConstraintManager.cpp:109
Simple triangle renderer for debugging purposes.
Definition DebugRenderer.h:25
Keeps track of connected bodies and builds islands for multithreaded velocity/position update.
Definition IslandBuilder.h:19
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11
static void sUnlock(LockType &inMutex JPH_IF_ENABLE_ASSERTS(, PhysicsLockContext inContext, EPhysicsLockTypes inType))
Definition PhysicsLock.h:61
static void sLock(LockType &inMutex JPH_IF_ENABLE_ASSERTS(, PhysicsLockContext inContext, EPhysicsLockTypes inType))
Definition PhysicsLock.h:54
Definition StateRecorder.h:15