A hinge constraint constrains 2 bodies on a single point and allows only a single axis of rotation.
More...
|
JPH_OVERRIDE_NEW_DELETE | HingeConstraint (Body &inBody1, Body &inBody2, const HingeConstraintSettings &inSettings) |
| Construct hinge constraint.
|
|
virtual EConstraintSubType | GetSubType () const override |
| Get the sub type of a constraint.
|
|
virtual void | NotifyShapeChanged (const BodyID &inBodyID, Vec3Arg inDeltaCOM) override |
|
virtual void | SetupVelocityConstraint (float inDeltaTime) override |
|
virtual void | ResetWarmStart () override |
|
virtual void | WarmStartVelocityConstraint (float inWarmStartImpulseRatio) override |
|
virtual bool | SolveVelocityConstraint (float inDeltaTime) override |
|
virtual bool | SolvePositionConstraint (float inDeltaTime, float inBaumgarte) override |
|
virtual void | DrawConstraint (DebugRenderer *inRenderer) const override |
|
virtual void | DrawConstraintLimits (DebugRenderer *inRenderer) const override |
|
virtual void | SaveState (StateRecorder &inStream) const override |
| Saving state for replay.
|
|
virtual void | RestoreState (StateRecorder &inStream) override |
| Restoring state for replay.
|
|
virtual Ref< ConstraintSettings > | GetConstraintSettings () const override |
| Debug function to convert a constraint to its settings, note that this will not save to which bodies the constraint is connected to.
|
|
virtual Mat44 | GetConstraintToBody1Matrix () const override |
| Calculates the transform that transforms from constraint space to body 1 space. The first column of the matrix is the primary constraint axis (e.g. the hinge axis / slider direction), second column the secondary etc.
|
|
virtual Mat44 | GetConstraintToBody2Matrix () const override |
| Calculates the transform that transforms from constraint space to body 2 space. The first column of the matrix is the primary constraint axis (e.g. the hinge axis / slider direction), second column the secondary etc.
|
|
Vec3 | GetLocalSpacePoint1 () const |
| Get the attachment point for body 1 relative to body 1 COM (transform by Body::GetCenterOfMassTransform to take to world space)
|
|
Vec3 | GetLocalSpacePoint2 () const |
| Get the attachment point for body 2 relative to body 2 COM (transform by Body::GetCenterOfMassTransform to take to world space)
|
|
Vec3 | GetLocalSpaceHingeAxis1 () const |
|
Vec3 | GetLocalSpaceHingeAxis2 () const |
|
Vec3 | GetLocalSpaceNormalAxis1 () const |
|
Vec3 | GetLocalSpaceNormalAxis2 () const |
|
float | GetCurrentAngle () const |
| Get the current rotation angle from the rest position.
|
|
void | SetMaxFrictionTorque (float inFrictionTorque) |
|
float | GetMaxFrictionTorque () const |
|
MotorSettings & | GetMotorSettings () |
|
const MotorSettings & | GetMotorSettings () const |
|
void | SetMotorState (EMotorState inState) |
|
EMotorState | GetMotorState () const |
|
void | SetTargetAngularVelocity (float inAngularVelocity) |
| rad/s
|
|
float | GetTargetAngularVelocity () const |
|
void | SetTargetAngle (float inAngle) |
| rad
|
|
float | GetTargetAngle () const |
|
void | SetLimits (float inLimitsMin, float inLimitsMax) |
| Update the rotation limits of the hinge, value in radians (see HingeConstraintSettings)
|
|
float | GetLimitsMin () const |
|
float | GetLimitsMax () const |
|
bool | HasLimits () const |
|
const SpringSettings & | GetLimitsSpringSettings () const |
| Update the limits spring settings.
|
|
SpringSettings & | GetLimitsSpringSettings () |
|
void | SetLimitsSpringSettings (const SpringSettings &inLimitsSpringSettings) |
|
Public Member Functions inherited from TwoBodyConstraint |
JPH_OVERRIDE_NEW_DELETE | TwoBodyConstraint (Body &inBody1, Body &inBody2, const TwoBodyConstraintSettings &inSettings) |
| Constructor.
|
|
virtual EConstraintType | GetType () const override |
| Get the type of a constraint.
|
|
virtual bool | IsActive () const override |
| Solver interface.
|
|
virtual void | DrawConstraintReferenceFrame (DebugRenderer *inRenderer) const override |
|
Body * | GetBody1 () const |
| Access to the connected bodies.
|
|
Body * | GetBody2 () const |
|
virtual void | BuildIslands (uint32 inConstraintIndex, IslandBuilder &ioBuilder, BodyManager &inBodyManager) override |
| Link bodies that are connected by this constraint in the island builder.
|
|
virtual uint | BuildIslandSplits (LargeIslandSplitter &ioSplitter) const override |
| Link bodies that are connected by this constraint in the same split. Returns the split index.
|
|
JPH_OVERRIDE_NEW_DELETE | Constraint (const ConstraintSettings &inSettings) |
| Constructor.
|
|
virtual | ~Constraint ()=default |
| Virtual destructor.
|
|
uint32 | GetConstraintPriority () const |
|
void | SetConstraintPriority (uint32 inPriority) |
|
void | SetNumVelocityStepsOverride (uint inN) |
| Used only when the constraint is active. Override for the number of solver velocity iterations to run, 0 means use the default in PhysicsSettings::mNumVelocitySteps. The number of iterations to use is the max of all contacts and constraints in the island.
|
|
uint | GetNumVelocityStepsOverride () const |
|
void | SetNumPositionStepsOverride (uint inN) |
| Used only when the constraint is active. Override for the number of solver position iterations to run, 0 means use the default in PhysicsSettings::mNumPositionSteps. The number of iterations to use is the max of all contacts and constraints in the island.
|
|
uint | GetNumPositionStepsOverride () const |
|
void | SetEnabled (bool inEnabled) |
|
bool | GetEnabled () const |
| Test if a constraint is enabled.
|
|
uint64 | GetUserData () const |
| Access to the user data, can be used for anything by the application.
|
|
void | SetUserData (uint64 inUserData) |
|
float | GetDrawConstraintSize () const |
| Size of constraint when drawing it through the debug renderer.
|
|
void | SetDrawConstraintSize (float inSize) |
|
| RefTarget ()=default |
| Constructor.
|
|
| RefTarget (const RefTarget &) |
|
| ~RefTarget () |
| assert no one is referencing us
|
|
void | SetEmbedded () const |
|
RefTarget & | operator= (const RefTarget &) |
| Assignment operator.
|
|
uint32 | GetRefCount () const |
| Get current refcount of this object.
|
|
void | AddRef () const |
| Add or release a reference to this object.
|
|
void | Release () const |
|
| NonCopyable ()=default |
|
| NonCopyable (const NonCopyable &)=delete |
|
void | operator= (const NonCopyable &)=delete |
|
A hinge constraint constrains 2 bodies on a single point and allows only a single axis of rotation.