48 float mMinLength = 0.0f;
51 float mMaxLength = -1.0f;
69 virtual void NotifyShapeChanged(
const BodyID &inBodyID,
Vec3Arg inDeltaCOM)
override;
70 virtual void SetupVelocityConstraint(
float inDeltaTime)
override;
71 virtual void ResetWarmStart()
override;
72 virtual void WarmStartVelocityConstraint(
float inWarmStartImpulseRatio)
override;
73 virtual bool SolveVelocityConstraint(
float inDeltaTime)
override;
74 virtual bool SolvePositionConstraint(
float inDeltaTime,
float inBaumgarte)
override;
75#ifdef JPH_DEBUG_RENDERER
76 virtual void DrawConstraint(
DebugRenderer *inRenderer)
const override;
78 virtual void SaveState(
StateRecorder &inStream)
const override;
87 void SetLength(
float inMinLength,
float inMaxLength) {
JPH_ASSERT(inMinLength >= 0.0f && inMinLength <= inMaxLength); mMinLength = inMinLength; mMaxLength = inMaxLength; }
99 float CalculatePositionsNormalsAndLength();
102 void CalculateConstraintProperties();
107 Vec3 mLocalSpacePosition1;
108 Vec3 mLocalSpacePosition2;
111 RVec3 mFixedPosition1;
112 RVec3 mFixedPosition2;
124 RVec3 mWorldSpacePosition1;
125 RVec3 mWorldSpacePosition2;
126 Vec3 mWorldSpaceNormal1;
127 Vec3 mWorldSpaceNormal2;
EConstraintSpace
Certain constraints support setting them up in local or world space. This governs what is used.
Definition: Constraint.h:58
EConstraintSubType
Enum to identify constraint sub type.
Definition: Constraint.h:34
#define JPH_EXPORT
Definition: Core.h:236
#define JPH_NAMESPACE_END
Definition: Core.h:378
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:372
#define JPH_ASSERT(...)
Definition: IssueReporting.h:33
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition: Memory.h:31
#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(linkage, class_name)
Definition: SerializableObject.h:109
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition: BodyID.h:13
virtual void SaveBinaryState(StreamOut &inStream) const
Saves the contents of the constraint settings in binary form to inStream.
Definition: Constraint.cpp:26
virtual void RestoreBinaryState(StreamIn &inStream)
This function should not be called directly, it is used by sRestoreFromBinaryState.
Definition: Constraint.cpp:36
Definition: DebugRenderer.h:47
Definition: IndependentAxisConstraintPart.h:48
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 pulley constraint.
Definition: PulleyConstraint.h:60
virtual EConstraintSubType GetSubType() const override
Get the sub type of a constraint.
Definition: PulleyConstraint.h:68
float GetCurrentLength() const
Get the current length of both segments (multiplied by the ratio for segment 2)
Definition: PulleyConstraint.h:92
void SetLength(float inMinLength, float inMaxLength)
Update the minimum and maximum length for the constraint.
Definition: PulleyConstraint.h:87
float GetMinLength() const
Definition: PulleyConstraint.h:88
virtual Mat44 GetConstraintToBody1Matrix() const override
Calculates the transform that transforms from constraint space to body 1 space. The first column of t...
Definition: PulleyConstraint.h:83
virtual Mat44 GetConstraintToBody2Matrix() const override
Calculates the transform that transforms from constraint space to body 2 space. The first column of t...
Definition: PulleyConstraint.h:84
float GetMaxLength() const
Definition: PulleyConstraint.h:89
float GetTotalLambdaPosition() const
Definition: PulleyConstraint.h:95
Definition: PulleyConstraint.h:19
Definition: Reference.h:101
Definition: StateRecorder.h:48
Simple binary input stream.
Definition: StreamIn.h:13
Simple binary output stream.
Definition: StreamOut.h:13
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
virtual TwoBodyConstraint * Create(Body &inBody1, Body &inBody2) const =0
JPH_INLINE float Length() const
Length of vector.
Definition: Vec3.inl:677
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition: Vec3.inl:107