90 JPH_INLINE
bool ApplyVelocityStep(
Body &ioBody1,
Body &ioBody2,
Vec3Arg inLambda)
const
146 mEffectiveMass_JP = mEffectiveMass.
Multiply3x3(jp);
160 return mEffectiveMass(3, 3) != 0.0f;
166 mTotalLambda *= inWarmStartImpulseRatio;
167 ApplyVelocityStep(ioBody1, ioBody2, mTotalLambda);
177 mTotalLambda += lambda;
178 return ApplyVelocityStep(ioBody1, ioBody2, lambda);
193 Vec3 lambda = -inBaumgarte * mEffectiveMass * c;
229 inStream.
Write(mTotalLambda);
235 inStream.
Read(mTotalLambda);
241 Mat44 mEffectiveMass;
242 Mat44 mEffectiveMass_JP;
#define JPH_NAMESPACE_END
Definition Core.h:379
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
const MotionProperties * GetMotionProperties() const
Access to the motion properties.
Definition Body.h:285
bool IsDynamic() const
Check if this body is dynamic, which means that it moves and forces can act on it.
Definition Body.h:63
void AddRotationStep(Vec3Arg inAngularVelocityTimesDeltaTime)
Update rotation using an Euler step (used during position integrate & constraint solving)
Definition Body.inl:81
Quat GetRotation() const
World space rotation of the body.
Definition Body.h:267
void SubRotationStep(Vec3Arg inAngularVelocityTimesDeltaTime)
Definition Body.inl:100
Vec3 GetAngularVelocity() const
Get world space angular velocity of the center of mass (unit: rad/s)
Definition Body.h:157
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 sZero()
Zero matrix.
Definition Mat44.inl:30
static JPH_INLINE Mat44 sQuatRightMultiply(QuatArg inQ)
Returns matrix MR so that (where p and q are quaternions)
Definition Mat44.inl:847
JPH_INLINE Mat44 Multiply3x3RightTransposed(Mat44Arg inM) const
Multiply 3x3 matrix by the transpose of a 3x3 matrix ( )
Definition Mat44.inl:397
JPH_INLINE bool SetInversed3x3(Mat44Arg inM)
*this = inM.Inversed3x3(), returns false if the matrix is singular in which case *this is unchanged
Definition Mat44.inl:767
JPH_INLINE Vec3 Multiply3x3(Vec3Arg inV) const
Multiply vector by only 3x3 part of the matrix.
Definition Mat44.inl:316
static JPH_INLINE Mat44 sQuatLeftMultiply(QuatArg inQ)
Returns matrix ML so that (where p and q are quaternions)
Definition Mat44.inl:838
void SubAngularVelocityStep(Vec3Arg inAngularVelocityChange)
Definition MotionProperties.h:198
Mat44 GetInverseInertiaForRotation(Mat44Arg inRotation) const
Get inverse inertia matrix ( ) for a given object rotation (translation will be ignored)....
Definition MotionProperties.inl:69
void AddAngularVelocityStep(Vec3Arg inAngularVelocityChange)
Definition MotionProperties.h:197
JPH_INLINE Quat Conjugated() const
The conjugate [w, -x, -y, -z] is the same as the inverse for unit quaternions.
Definition Quat.h:178
Definition RotationQuatConstraintPart.h:87
void WarmStart(Body &ioBody1, Body &ioBody2, float inWarmStartImpulseRatio)
Must be called from the WarmStartVelocityConstraint call to apply the previous frame's impulses.
Definition RotationQuatConstraintPart.h:164
void CalculateConstraintProperties(const Body &inBody1, Mat44Arg inRotation1, const Body &inBody2, Mat44Arg inRotation2, QuatArg inInvInitialOrientation)
Calculate properties used during the functions below.
Definition RotationQuatConstraintPart.h:129
Vec3 GetTotalLambda() const
Return lagrange multiplier.
Definition RotationQuatConstraintPart.h:221
bool SolvePositionConstraint(Body &ioBody1, Body &ioBody2, QuatArg inInvInitialOrientation, float inBaumgarte) const
Iteratively update the position constraint. Makes sure C(...) = 0.
Definition RotationQuatConstraintPart.h:182
void Deactivate()
Deactivate this constraint.
Definition RotationQuatConstraintPart.h:150
static Quat sGetInvInitialOrientation(const Body &inBody1, const Body &inBody2)
Return inverse of initial rotation from body 1 to body 2 in body 1 space.
Definition RotationQuatConstraintPart.h:114
void RestoreState(StateRecorder &inStream)
Restore state of this constraint part.
Definition RotationQuatConstraintPart.h:233
void SaveState(StateRecorder &inStream) const
Save state of this constraint part.
Definition RotationQuatConstraintPart.h:227
bool IsActive() const
Check if constraint is active.
Definition RotationQuatConstraintPart.h:158
bool SolveVelocityConstraint(Body &ioBody1, Body &ioBody2)
Iteratively update the velocity constraint. Makes sure d/dt C(...) = 0, where C is the constraint equ...
Definition RotationQuatConstraintPart.h:171
Definition StateRecorder.h:105
void Read(T &outT)
Read a primitive (e.g. float, int, etc.) from the binary stream.
Definition StreamIn.h:29
void Write(const T &inT)
Write a primitive (e.g. float, int, etc.) to the binary stream.
Definition StreamOut.h:26
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition Vec3.inl:107