class D6Joint

Inherits: Joint

Represents the most customizable type of joint.

This joint type can be used to create all other built-in joint types, and to design your own custom ones, but is less intuitive to use. Allows a specification of a linear constraint (for example for slider), twist constraint (rotating around X) and swing constraint (rotating around Y and Z). It also allows you to constrain limits to only specific axes or completely lock specific axes.

Public

Constructors

D6Joint

D6Joint(const HSceneObject &parent)

Methods

SetMotion

void SetMotion(D6JointAxis axis, D6JointMotion motion)

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

D6JointMotion GetMotion(D6JointAxis axis) const

Returns motion constraint for the specified axis.

GetTwist

Radian GetTwist() const

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

GetSwingY

Radian GetSwingY() const

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

GetSwingZ

Radian GetSwingZ() const

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

SetLimitLinear

void SetLimitLinear(const LimitLinear &limit)

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

GetLimitLinear

LimitLinear GetLimitLinear() const

SetLimitTwist

void SetLimitTwist(const LimitAngularRange &limit)

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

GetLimitTwist

LimitAngularRange GetLimitTwist() const

SetLimitSwing

void SetLimitSwing(const LimitConeRange &limit)

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

GetLimitSwing

LimitConeRange GetLimitSwing() const

SetDrive

void SetDrive(D6JointDriveType type, const D6JointDrive &drive)

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

GetDrive

D6JointDrive GetDrive(D6JointDriveType type) const

GetDrivePosition

Vector3 GetDrivePosition() const

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

GetDriveRotation

Quaternion GetDriveRotation() const

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

SetDriveTransform

void SetDriveTransform(const Vector3 &position, const Quaternion &rotation)

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

GetDriveLinearVelocity

Vector3 GetDriveLinearVelocity() const

Returns the drive's target linear velocity.

GetDriveAngularVelocity

Vector3 GetDriveAngularVelocity() const

Returns the drive's target angular velocity.

SetDriveVelocity

void SetDriveVelocity(const Vector3 &linear, const Vector3 &angular)

Sets the drive's target linear and angular velocities.

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const

Returns an interface you can use to access class' Run Time Type Information.

Internal

Methods

GetImplementation

ID6JointImplementation &GetImplementation() const

Returns the low level joint implementation.

Protected

Constructors

D6Joint

D6Joint()

Methods

CreateImplementation

UPtr<IJointImplementation> CreateImplementation() override

Creates the implementation the joint for use by the component.

Fields

mInformation