class ID6JointImplementation

Low-level interface for a joint used by the D6Joint component.

Should be implemented by the physics plugin to provide joint functionality.

Public

Methods

SetMotion

virtual void SetMotion(D6JointAxis axis, D6JointMotion motion) = 0

Allows you to constrain motion of the specified axis.

Be aware that when setting drives for a specific axis you must also take care not to constrain its motion in a conflicting way (for example you cannot add a drive that moves the joint on X axis, and then lock the X axis).

Unlocking translations degrees of freedom allows the bodies to move along the subset of the unlocked axes. (for example unlocking just one translational axis is the equivalent of a slider joint.)

Angular degrees of freedom are partitioned as twist (around X axis) and swing (around Y and Z axes). Different effects can be achieves by unlocking their various combinations:

  • If a single degree of angular freedom is unlocked it should be the twist degree as it has extra options for that case (for example for a hinge joint).
  • If both swing degrees are unlocked but twist is locked the result is a zero-twist joint.
  • If one swing and one twist degree of freedom are unlocked the result is a zero-swing joint (for example an arm attached at the elbow)
  • If all angular degrees of freedom are unlocked the result is the same as the spherical joint.

GetMotion

virtual D6JointMotion GetMotion(D6JointAxis axis) const = 0

Returns motion constraint for the specified axis.

GetTwist

virtual Radian GetTwist() const = 0

Returns the current rotation of the joint around the X axis.

GetSwingY

virtual Radian GetSwingY() const = 0

Returns the current rotation of the joint around the Y axis.

GetSwingZ

virtual Radian GetSwingZ() const = 0

Returns the current rotation of the joint around the Z axis.

SetLimitLinear

virtual void SetLimitLinear(const LimitLinear &limit) = 0

Determines the linear limit used for constraining translation degrees of freedom.

GetLimitLinear

virtual LimitLinear GetLimitLinear() const = 0

SetLimitTwist

virtual void SetLimitTwist(const LimitAngularRange &limit) = 0

Determines the angular limit used for constraining the twist (rotation around X) degree of freedom.

GetLimitTwist

virtual LimitAngularRange GetLimitTwist() const = 0

GetLimitSwing

virtual LimitConeRange GetLimitSwing() const = 0

SetLimitSwing

virtual void SetLimitSwing(const LimitConeRange &limit) = 0

Determines the cone limit used for constraining the swing (rotation around Y and Z) degree of freedom.

GetDrive

virtual D6JointDrive GetDrive(D6JointDriveType type) const = 0

SetDrive

virtual void SetDrive(D6JointDriveType type, const D6JointDrive &drive) = 0

Determines a drive that will attempt to move the specified degree(s) of freedom to the wanted position and velocity.

GetDrivePosition

virtual Vector3 GetDrivePosition() const = 0

Returns the drive's target position relative to the joint's first body.

GetDriveRotation

virtual Quaternion GetDriveRotation() const = 0

Returns the drive's target rotation relative to the joint's first body.

SetDriveTransform

virtual void SetDriveTransform(const Vector3 &position, const Quaternion &rotation) = 0

Sets the drive's target position and rotation relative to the joint's first body.

GetDriveLinearVelocity

virtual Vector3 GetDriveLinearVelocity() const = 0

Returns the drive's target linear velocity.

GetDriveAngularVelocity

virtual Vector3 GetDriveAngularVelocity() const = 0

Returns the drive's target angular velocity.

SetDriveVelocity

virtual void SetDriveVelocity(const Vector3 &linear, const Vector3 &angular) = 0

Sets the drive's target linear and angular velocities.