21#ifdef JPH_DEBUG_RENDERER
72 virtual
void SaveBinaryState(
StreamOut &inStream) const;
85 int mNumVelocityStepsOverride = 0;
88 int mNumPositionStepsOverride = 0;
91 float mDrawConstraintSize = 1.0f;
98 virtual
void RestoreBinaryState(
StreamIn &inStream);
109#ifdef JPH_DEBUG_RENDERER
110 mDrawConstraintSize(inSettings.mDrawConstraintSize),
112 mConstraintPriority(inSettings.mConstraintPriority),
113 mNumVelocityStepsOverride(inSettings.mNumVelocityStepsOverride),
114 mNumPositionStepsOverride(inSettings.mNumPositionStepsOverride),
115 mEnabled(inSettings.mEnabled),
116 mUserData(inSettings.mUserData)
176#ifdef JPH_DEBUG_RENDERER
200#ifdef JPH_DEBUG_RENDERER
209 static constexpr uint32 cInvalidConstraintIndex = 0xffffffff;
212 uint32 mConstraintIndex = cInvalidConstraintIndex;
215 uint32 mConstraintPriority = 0;
218 int mNumVelocityStepsOverride = 0;
221 int mNumPositionStepsOverride = 0;
224 bool mEnabled =
true;
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.
#define JPH_EXPORT
Definition Core.h:214
std::uint64_t uint64
Definition Core.h:430
unsigned int uint
Definition Core.h:426
#define JPH_NAMESPACE_END
Definition Core.h:354
std::uint32_t uint32
Definition Core.h:429
#define JPH_NAMESPACE_BEGIN
Definition Core.h:348
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:29
#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(linkage, 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:32
Base class for all physics constraints. A constraint removes one or more degrees of freedom for a rig...
Definition Constraint.h:103
virtual ~Constraint()=default
Virtual destructor.
virtual void SetupVelocityConstraint(float inDeltaTime)=0
virtual bool IsActive() const
Definition Constraint.h:163
int GetNumVelocityStepsOverride() const
Definition Constraint.h:136
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:149
void SetUserData(uint64 inUserData)
Definition Constraint.h:153
virtual bool SolveVelocityConstraint(float inDeltaTime)=0
virtual void NotifyShapeChanged(const BodyID &inBodyID, Vec3Arg inDeltaCOM)=0
void SetConstraintPriority(uint32 inPriority)
Definition Constraint.h:132
uint64 GetUserData() const
Access to the user data, can be used for anything by the application.
Definition Constraint.h:152
virtual void DrawConstraintLimits(DebugRenderer *inRenderer) const
Definition Constraint.h:179
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:135
uint32 GetConstraintPriority() const
Definition Constraint.h:131
virtual EConstraintType GetType() const
Get the type of a constraint.
Definition Constraint.h:124
float GetDrawConstraintSize() const
Size of constraint when drawing it through the debug renderer.
Definition Constraint.h:183
void SetNumPositionStepsOverride(int inN)
Override for the number of position velocity iterations to run, the total amount of iterations is the...
Definition Constraint.h:139
int GetNumPositionStepsOverride() const
Definition Constraint.h:140
virtual void DrawConstraintReferenceFrame(DebugRenderer *inRenderer) const
Definition Constraint.h:180
void SetEnabled(bool inEnabled)
Definition Constraint.h:146
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:108
void SetDrawConstraintSize(float inSize)
Definition Constraint.h:184
float mDrawConstraintSize
Size of constraint when drawing it through the debug renderer.
Definition Constraint.h:202
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:25
Class used to store the configuration of a constraint. Allows run-time creation of constraints.
Definition Constraint.h:65
Simple triangle renderer for debugging purposes.
Definition DebugRenderer.h:30
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:48
Simple binary input stream.
Definition StreamIn.h:13
Simple binary output stream.
Definition StreamOut.h:13