21#ifdef JPH_DEBUG_RENDERER
105#ifdef JPH_DEBUG_RENDERER
166#ifdef JPH_DEBUG_RENDERER
190#ifdef JPH_DEBUG_RENDERER
199 static constexpr uint32 cInvalidConstraintIndex = 0xffffffff;
202 uint32 mConstraintIndex = cInvalidConstraintIndex;
EConstraintType
Enum to identify constraint type.
Definition Constraint.h:27
EConstraintSpace
Certain constraints support setting them up in local or world space. This governs what is used.
Definition Constraint.h:58
@ LocalToBodyCOM
All constraint properties are specified in local space to center of mass of the bodies that are being...
@ WorldSpace
All constraint properties are specified in world space.
EConstraintSubType
Enum to identify constraint sub type.
Definition Constraint.h:34
@ User1
User defined constraint types start here.
uint32_t uint32
Definition Core.h:312
unsigned int uint
Definition Core.h:309
#define JPH_NAMESPACE_END
Definition Core.h:240
uint64_t uint64
Definition Core.h:313
#define JPH_NAMESPACE_BEGIN
Definition Core.h:234
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:29
#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(class_name)
Definition SerializableObject.h:100
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition BodyID.h:13
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
virtual ~Constraint()=default
Virtual destructor.
virtual void SetupVelocityConstraint(float inDeltaTime)=0
virtual bool IsActive() const
Definition Constraint.h:153
int GetNumVelocityStepsOverride() const
Definition Constraint.h:126
virtual Ref< ConstraintSettings > GetConstraintSettings() const =0
Debug function to convert a constraint to its settings, note that this will not save to which bodies ...
bool GetEnabled() const
Test if a constraint is enabled.
Definition Constraint.h:139
void SetUserData(uint64 inUserData)
Definition Constraint.h:143
virtual bool SolveVelocityConstraint(float inDeltaTime)=0
virtual void NotifyShapeChanged(const BodyID &inBodyID, Vec3Arg inDeltaCOM)=0
uint64 GetUserData() const
Access to the user data, can be used for anything by the application.
Definition Constraint.h:142
virtual void DrawConstraintLimits(DebugRenderer *inRenderer) const
Definition Constraint.h:169
virtual EConstraintSubType GetSubType() const =0
Get the sub type of a constraint.
virtual uint BuildIslandSplits(LargeIslandSplitter &ioSplitter) const =0
Link bodies that are connected by this constraint in the same split. Returns the split index.
void SetNumVelocityStepsOverride(int inN)
Override for the number of solver velocity iterations to run, the total amount of iterations is the m...
Definition Constraint.h:125
virtual EConstraintType GetType() const
Get the type of a constraint.
Definition Constraint.h:119
float GetDrawConstraintSize() const
Size of constraint when drawing it through the debug renderer.
Definition Constraint.h:173
void SetNumPositionStepsOverride(int inN)
Override for the number of position velocity iterations to run, the total amount of iterations is the...
Definition Constraint.h:129
int GetNumPositionStepsOverride() const
Definition Constraint.h:130
virtual void DrawConstraintReferenceFrame(DebugRenderer *inRenderer) const
Definition Constraint.h:170
void SetEnabled(bool inEnabled)
Definition Constraint.h:136
virtual void WarmStartVelocityConstraint(float inWarmStartImpulseRatio)=0
virtual void DrawConstraint(DebugRenderer *inRenderer) const =0
virtual bool SolvePositionConstraint(float inDeltaTime, float inBaumgarte)=0
JPH_OVERRIDE_NEW_DELETE Constraint(const ConstraintSettings &inSettings)
Constructor.
Definition Constraint.h:104
void SetDrawConstraintSize(float inSize)
Definition Constraint.h:174
float mDrawConstraintSize
Size of constraint when drawing it through the debug renderer.
Definition Constraint.h:192
virtual void BuildIslands(uint32 inConstraintIndex, IslandBuilder &ioBuilder, BodyManager &inBodyManager)=0
Link bodies that are connected by this constraint in the island builder.
A constraint manager manages all constraints of the same type.
Definition ConstraintManager.h:24
Class used to store the configuration of a constraint. Allows run-time creation of constraints.
Definition Constraint.h:65
static ConstraintResult sRestoreFromBinaryState(StreamIn &inStream)
Creates a constraint of the correct type and restores its contents from the binary stream inStream.
Definition Constraint.cpp:45
int mNumPositionStepsOverride
Override for the number of position velocity iterations to run, the total amount of iterations is the...
Definition Constraint.h:84
bool mEnabled
If this constraint is enabled initially. Use Constraint::SetEnabled to toggle after creation.
Definition Constraint.h:78
virtual void SaveBinaryState(StreamOut &inStream) const
Saves the contents of the constraint settings in binary form to inStream.
Definition Constraint.cpp:27
uint64 mUserData
User data value (can be used by application)
Definition Constraint.h:90
int mNumVelocityStepsOverride
Override for the number of solver velocity iterations to run, the total amount of iterations is the m...
Definition Constraint.h:81
virtual void RestoreBinaryState(StreamIn &inStream)
This function should not be called directly, it is used by sRestoreFromBinaryState.
Definition Constraint.cpp:36
float mDrawConstraintSize
Size of constraint when drawing it through the debug renderer.
Definition Constraint.h:87
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
Definition LargeIslandSplitter.h:24
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11
Definition Reference.h:101
Definition Reference.h:35
Helper class that either contains a valid result or an error.
Definition Result.h:15
Definition SerializableObject.h:147
Definition StateRecorder.h:15
Simple binary input stream.
Definition StreamIn.h:11
Simple binary output stream.
Definition StreamOut.h:11