82#ifdef JPH_DEBUG_RENDERER
128 void CalculateConstraintProperties(
float inDeltaTime);
138 float mMaxFrictionForce;
143 float mTargetVelocity = 0.0f;
144 float mTargetPathFraction = 0.0f;
163 Quat mInvInitialOrientation;
166 float mPathFraction = 0.0f;
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_ASSERT(...)
Definition IssueReporting.h:33
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:29
EMotorState
Definition MotorSettings.h:16
EPathRotationConstraintType
How to constrain the rotation of the body to a PathConstraint.
Definition PathConstraint.h:19
@ FullyConstrained
Fully constrain the rotation of the body 2 to the rotation of body 1.
@ ConstaintToPath
Fully constrain the rotation of body 2 to the path (follwing the tangent and normal of the path)
@ Free
Do not constrain the rotation of the body at all.
@ ConstrainAroundNormal
Only allow rotation around the normal vector (perpendicular to the path)
@ ConstrainAroundBinormal
Only allow rotation around the binormal vector (perpendicular to the path)
@ ConstrainAroundTangent
Only allow rotation around the tangent vector (following the path)
#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(class_name)
Definition SerializableObject.h:100
Definition AxisConstraintPart.h:42
float GetTotalLambda() const
Return lagrange multiplier.
Definition AxisConstraintPart.h:378
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
Definition DualAxisConstraintPart.h:46
const Vec2 & GetTotalLambda() const
Return lagrange multiplier.
Definition DualAxisConstraintPart.h:247
Definition HingeRotationConstraintPart.h:42
const Vec2 & GetTotalLambda() const
Return lagrange multiplier.
Definition HingeRotationConstraintPart.h:194
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
Definition MotorSettings.h:25
bool IsValid() const
Check if settings are valid.
Definition MotorSettings.h:48
Path constraint, used to constrain the degrees of freedom between two bodies to a path.
Definition PathConstraint.h:68
float GetMaxFrictionForce() const
Definition PathConstraint.h:105
void SetTargetVelocity(float inVelocity)
Definition PathConstraint.h:114
void SetTargetPathFraction(float inFraction)
Definition PathConstraint.h:116
EMotorState GetPositionMotorState() const
Definition PathConstraint.h:113
virtual void SetupVelocityConstraint(float inDeltaTime) override
Definition PathConstraint.cpp:220
virtual void SaveState(StateRecorder &inStream) const override
Saving state for replay.
Definition PathConstraint.cpp:404
float GetTargetPathFraction() const
Definition PathConstraint.h:117
virtual bool SolveVelocityConstraint(float inDeltaTime) override
Definition PathConstraint.cpp:251
virtual void DrawConstraint(DebugRenderer *inRenderer) const override
Definition PathConstraint.cpp:360
virtual bool IsActive() const override
Solver interface.
Definition PathConstraint.h:87
void SetPositionMotorState(EMotorState inState)
Definition PathConstraint.h:112
JPH_OVERRIDE_NEW_DELETE PathConstraint(Body &inBody1, Body &inBody2, const PathConstraintSettings &inSettings)
Construct point constraint.
Definition PathConstraint.cpp:65
virtual EConstraintSubType GetSubType() const override
Get the sub type of a constraint.
Definition PathConstraint.h:76
Vec3 GetTotalLambdaRotation() const
Definition PathConstraint.h:124
virtual Mat44 GetConstraintToBody1Matrix() const override
Calculates the transform that transforms from constraint space to body 1 space. The first column of t...
Definition PathConstraint.h:91
virtual void WarmStartVelocityConstraint(float inWarmStartImpulseRatio) override
Definition PathConstraint.cpp:225
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 PathConstraint.cpp:440
virtual bool SolvePositionConstraint(float inDeltaTime, float inBaumgarte) override
Definition PathConstraint.cpp:315
float GetTargetVelocity() const
Definition PathConstraint.h:115
Vector< 2 > GetTotalLambdaPosition() const
Definition PathConstraint.h:120
MotorSettings & GetPositionMotorSettings()
Position motor settings.
Definition PathConstraint.h:108
const PathConstraintPath * GetPath() const
Access to the current path.
Definition PathConstraint.h:98
Vector< 2 > GetTotalLambdaRotationHinge() const
Definition PathConstraint.h:123
void SetPath(const PathConstraintPath *inPath, float inPathFraction)
Update the path for this constraint.
Definition PathConstraint.cpp:85
void SetMaxFrictionForce(float inFrictionForce)
Friction control.
Definition PathConstraint.h:104
float GetTotalLambdaMotor() const
Definition PathConstraint.h:122
virtual void NotifyShapeChanged(const BodyID &inBodyID, Vec3Arg inDeltaCOM) override
Definition PathConstraint.cpp:77
virtual void RestoreState(StateRecorder &inStream) override
Restoring state for replay.
Definition PathConstraint.cpp:422
virtual Mat44 GetConstraintToBody2Matrix() const override
Calculates the transform that transforms from constraint space to body 2 space. The first column of t...
Definition PathConstraint.h:92
float GetPathFraction() const
Access to the current fraction along the path e [0, GetPath()->GetMaxPathFraction()].
Definition PathConstraint.h:101
const MotorSettings & GetPositionMotorSettings() const
Definition PathConstraint.h:109
float GetTotalLambdaPositionLimits() const
Definition PathConstraint.h:121
The path for a path constraint. It allows attaching two bodies to each other while giving the second ...
Definition PathConstraintPath.h:21
bool IsLooping() const
Definition PathConstraintPath.h:48
Path constraint settings, used to constrain the degrees of freedom between two bodies to a path.
Definition PathConstraint.h:30
virtual void RestoreBinaryState(StreamIn &inStream) override
This function should not be called directly, it is used by sRestoreFromBinaryState.
Definition PathConstraint.cpp:45
RefConst< PathConstraintPath > mPath
The path that constrains the two bodies.
Definition PathConstraint.h:41
MotorSettings mPositionMotorSettings
In case the constraint is powered, this determines the motor settings along the path.
Definition PathConstraint.h:56
Quat mPathRotation
The rotation of the path start relative to world transform of body 1.
Definition PathConstraint.h:47
virtual void SaveBinaryState(StreamOut &inStream) const override
Saves the contents of the constraint settings in binary form to inStream.
Definition PathConstraint.cpp:32
virtual TwoBodyConstraint * Create(Body &inBody1, Body &inBody2) const override
Create an an instance of this constraint.
Definition PathConstraint.cpp:60
Vec3 mPathPosition
The position of the path start relative to world transform of body 1.
Definition PathConstraint.h:44
float mMaxFrictionForce
Maximum amount of friction force to apply (N) when not driven by a motor.
Definition PathConstraint.h:53
float mPathFraction
The fraction along the path that corresponds to the initial position of body 2. Usually this is 0,...
Definition PathConstraint.h:50
EPathRotationConstraintType mRotationConstraintType
How to constrain the rotation of the body to the path.
Definition PathConstraint.h:59
static JPH_INLINE Quat sIdentity()
Definition Quat.h:93
Definition Reference.h:154
Definition Reference.h:101
Definition RotationEulerConstraintPart.h:36
Vec3 GetTotalLambda() const
Return lagrange multiplier.
Definition RotationEulerConstraintPart.h:245
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
virtual bool IsActive() const override
Solver interface.
Definition TwoBodyConstraint.h:38
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
Templatized vector class.
Definition Vector.h:12