39    JPH_INLINE 
bool             ApplyVelocityStep(
Body &ioBody1, 
Body &ioBody2, 
Vec3Arg inLambda)
 const 
  105        if (inAxisX1 == inAxisX2 && inAxisY1 == inAxisY2)
 
 
  126        if (inAxisX1 == inAxisX2 && inAxisZ1 == inAxisZ2)
 
 
  146        Mat44 inertia_sum = mInvI1 + mInvI2;
 
 
  173        return mEffectiveMass(3, 3) != 0.0f;
 
 
  179        mTotalLambda *= inWarmStartImpulseRatio;
 
  180        ApplyVelocityStep(ioBody1, ioBody2, mTotalLambda);
 
 
  190        mTotalLambda += lambda;
 
  191        return ApplyVelocityStep(ioBody1, ioBody2, lambda);
 
 
  231            Vec3 lambda = -inBaumgarte * mEffectiveMass * error;
 
 
  267        inStream.
Write(mTotalLambda);
 
 
  273        inStream.
Read(mTotalLambda);
 
 
  279    Mat44                       mEffectiveMass;
 
 
#define JPH_NAMESPACE_END
Definition Core.h:419
 
#define JPH_NAMESPACE_BEGIN
Definition Core.h:413
 
const MotionProperties * GetMotionProperties() const
Access to the motion properties.
Definition Body.h:308
 
bool IsDynamic() const
Check if this body is dynamic, which means that it moves and forces can act on it.
Definition Body.h:67
 
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:271
 
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:161
 
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
 
JPH_INLINE Quat GetQuaternion() const
Convert to quaternion.
Definition Mat44.inl:783
 
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 Vec4 GetColumn4(uint inCol) const
Definition Mat44.h:160
 
JPH_INLINE Vec3 Multiply3x3(Vec3Arg inV) const
Multiply vector by only 3x3 part of the matrix.
Definition Mat44.inl:316
 
JPH_INLINE void SetColumn4(uint inCol, Vec4Arg inV)
Definition Mat44.h:161
 
void SubAngularVelocityStep(Vec3Arg inAngularVelocityChange)
Definition MotionProperties.h:220
 
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:219
 
static JPH_INLINE Quat sIdentity()
Definition Quat.h:104
 
JPH_INLINE Quat EnsureWPositive() const
Ensures that the W component is positive by negating the entire quaternion if it is not....
Definition Quat.h:188
 
JPH_INLINE Quat Conjugated() const
The conjugate [w, -x, -y, -z] is the same as the inverse for unit quaternions.
Definition Quat.h:182
 
JPH_INLINE Vec3 GetXYZ() const
Get the imaginary part of the quaternion.
Definition Quat.h:82
 
Definition RotationEulerConstraintPart.h:36
 
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 RotationEulerConstraintPart.h:63
 
void WarmStart(Body &ioBody1, Body &ioBody2, float inWarmStartImpulseRatio)
Must be called from the WarmStartVelocityConstraint call to apply the previous frame's impulses.
Definition RotationEulerConstraintPart.h:177
 
bool IsActive() const
Check if constraint is active.
Definition RotationEulerConstraintPart.h:171
 
static Quat sGetInvInitialOrientationXY(Vec3Arg inAxisX1, Vec3Arg inAxisY1, Vec3Arg inAxisX2, Vec3Arg inAxisY2)
Return inverse of initial rotation from body 1 to body 2 in body 1 space.
Definition RotationEulerConstraintPart.h:82
 
Vec3 GetTotalLambda() const
Return lagrange multiplier.
Definition RotationEulerConstraintPart.h:259
 
bool SolvePositionConstraint(Body &ioBody1, Body &ioBody2, QuatArg inInvInitialOrientation, float inBaumgarte) const
Iteratively update the position constraint. Makes sure C(...) = 0.
Definition RotationEulerConstraintPart.h:195
 
void Deactivate()
Deactivate this constraint.
Definition RotationEulerConstraintPart.h:164
 
void RestoreState(StateRecorder &inStream)
Restore state of this constraint part.
Definition RotationEulerConstraintPart.h:271
 
static Quat sGetInvInitialOrientationXZ(Vec3Arg inAxisX1, Vec3Arg inAxisZ1, Vec3Arg inAxisX2, Vec3Arg inAxisZ2)
Return inverse of initial rotation from body 1 to body 2 in body 1 space.
Definition RotationEulerConstraintPart.h:123
 
void CalculateConstraintProperties(const Body &inBody1, Mat44Arg inRotation1, const Body &inBody2, Mat44Arg inRotation2)
Calculate properties used during the functions below.
Definition RotationEulerConstraintPart.h:139
 
bool SolveVelocityConstraint(Body &ioBody1, Body &ioBody2)
Iteratively update the velocity constraint. Makes sure d/dt C(...) = 0, where C is the constraint equ...
Definition RotationEulerConstraintPart.h:184
 
void SaveState(StateRecorder &inStream) const
Save state of this constraint part.
Definition RotationEulerConstraintPart.h:265
 
Definition StateRecorder.h:110
 
void Read(T &outT)
Read a primitive (e.g. float, int, etc.) from the binary stream.
Definition StreamIn.h:30
 
void Write(const T &inT)
Write a primitive (e.g. float, int, etc.) to the binary stream.
Definition StreamOut.h:26
 
JPH_INLINE Vec3 Cross(Vec3Arg inV2) const
Cross product.
Definition Vec3.inl:595
 
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition Vec3.inl:103
 
static JPH_INLINE Vec4 sZero()
Vector with all zeros.
Definition Vec4.inl:63