55#ifdef JPH_DEBUG_RENDERER
83 void CalculateConstraintProperties();
86 Vec3 mLocalSpacePosition1;
87 Vec3 mLocalSpacePosition2;
EConstraintSpace
Certain constraints support setting them up in local or world space. This governs what is used.
Definition Constraint.h:58
@ WorldSpace
All constraint properties are specified in world space.
EConstraintSubType
Enum to identify constraint sub type.
Definition Constraint.h:34
#define JPH_NAMESPACE_END
Definition Core.h:240
#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
Simple triangle renderer for debugging purposes.
Definition DebugRenderer.h:25
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
static JPH_INLINE Mat44 sTranslation(Vec3Arg inV)
Get matrix that translates.
Definition Mat44.inl:144
A point constraint constrains 2 bodies on a single point (removing 3 degrees of freedom)
Definition PointConstraint.h:41
virtual Mat44 GetConstraintToBody2Matrix() const override
Calculates the transform that transforms from constraint space to body 2 space. The first column of t...
Definition PointConstraint.h:76
virtual EConstraintSubType GetSubType() const override
Get the sub type of a constraint.
Definition PointConstraint.h:49
virtual void SetupVelocityConstraint(float inDeltaTime) override
Definition PointConstraint.cpp:95
virtual Mat44 GetConstraintToBody1Matrix() const override
Calculates the transform that transforms from constraint space to body 1 space. The first column of t...
Definition PointConstraint.h:75
void SetPoint2(EConstraintSpace inSpace, RVec3Arg inPoint2)
Update the attachment point for body 2.
Definition PointConstraint.cpp:82
virtual bool SolveVelocityConstraint(float inDeltaTime) override
Definition PointConstraint.cpp:106
Vec3 GetTotalLambdaPosition() const
Definition PointConstraint.h:79
virtual void WarmStartVelocityConstraint(float inWarmStartImpulseRatio) override
Definition PointConstraint.cpp:100
virtual void RestoreState(StateRecorder &inStream) override
Restoring state for replay.
Definition PointConstraint.cpp:135
virtual Ref< ConstraintSettings > GetConstraintSettings() const override
Debug function to convert a constraint to its settings, note that this will not save to which bodies ...
Definition PointConstraint.cpp:142
Vec3 GetLocalSpacePoint1() const
Get the attachment point for body 1 relative to body 1 COM.
Definition PointConstraint.h:69
virtual void NotifyShapeChanged(const BodyID &inBodyID, Vec3Arg inDeltaCOM) override
Definition PointConstraint.cpp:66
virtual void SaveState(StateRecorder &inStream) const override
Saving state for replay.
Definition PointConstraint.cpp:128
void SetPoint1(EConstraintSpace inSpace, RVec3Arg inPoint1)
Update the attachment point for body 1.
Definition PointConstraint.cpp:74
virtual bool SolvePositionConstraint(float inDeltaTime, float inBaumgarte) override
Definition PointConstraint.cpp:111
virtual void DrawConstraint(DebugRenderer *inRenderer) const override
Definition PointConstraint.cpp:120
JPH_OVERRIDE_NEW_DELETE PointConstraint(Body &inBody1, Body &inBody2, const PointConstraintSettings &inSettings)
Construct point constraint.
Definition PointConstraint.cpp:50
Vec3 GetLocalSpacePoint2() const
Get the attachment point for body 2 relative to body 2 COM.
Definition PointConstraint.h:72
Definition PointConstraintPart.h:41
Vec3 GetTotalLambda() const
Return lagrange multiplier.
Definition PointConstraintPart.h:199
Point constraint settings, used to create a point constraint.
Definition PointConstraint.h:14
virtual void RestoreBinaryState(StreamIn &inStream) override
This function should not be called directly, it is used by sRestoreFromBinaryState.
Definition PointConstraint.cpp:36
virtual void SaveBinaryState(StreamOut &inStream) const override
Saves the contents of the constraint settings in binary form to inStream.
Definition PointConstraint.cpp:27
RVec3 mPoint1
Body 1 constraint position (space determined by mSpace).
Definition PointConstraint.h:28
RVec3 mPoint2
Definition PointConstraint.h:32
EConstraintSpace mSpace
This determines in which space the constraint is setup, all properties below should be in the specifi...
Definition PointConstraint.h:25
virtual TwoBodyConstraint * Create(Body &inBody1, Body &inBody2) const override
Create an an instance of this constraint.
Definition PointConstraint.cpp:45
Definition Reference.h:101
Definition StateRecorder.h:15
Simple binary input stream.
Definition StreamIn.h:11
Simple binary output stream.
Definition StreamOut.h:11
Base class for all constraints that involve 2 bodies. Body1 is usually considered the parent,...
Definition TwoBodyConstraint.h:27
Base class for settings for all constraints that involve 2 bodies.
Definition TwoBodyConstraint.h:16
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition Vec3.inl:107