class Joint

Inherits: Component

Base class for all Joint types.

Joints constrain how two rigidbodies move relative to one another (for example a door hinge). One of the bodies in the joint must always be movable (non-kinematic).

Public

Constructors

Joint

Joint(const HSceneObject &parent, JointCreateInformation &createInformation)

Joint

Joint(JointCreateInformation &createInformation)

Methods

SetBody

void SetBody(JointBody body, const HRigidbody &value)

Determines a body managed by the joint.

One of the bodies must be movable (non-kinematic).

GetBody

const HRigidbody &GetBody(JointBody body) const

GetRelativeBodyPosition

const Vector3 &GetRelativeBodyPosition(JointBody body) const

Returns the position at which the body is anchored to the joint, relative to the body.

GetRelativeBodyRotation

const Quaternion &GetRelativeBodyRotation(JointBody body) const

Returns the rotation at which the body is anchored to the joint, relative to the body.

SetRelativeBodyTransform

void SetRelativeBodyTransform(JointBody body, const Vector3 &position, const Quaternion &rotation)

Sets the position and rotation at which the body is anchored to the joint, relative to the body.

SetBreakForce

void SetBreakForce(float force)

Determines the maximum force the joint can apply before breaking.

Broken joints no longer participate in physics simulation.

GetBreakForce

float GetBreakForce() const

SetBreakTorque

void SetBreakTorque(float torque)

Determines the maximum torque the joint can apply before breaking.

Broken joints no longer participate in physics simulation.

GetBreakTorque

float GetBreakTorque() const

SetEnableCollision

void SetEnableCollision(bool value)

Determines whether collision between the two bodies managed by the joint are enabled.

GetEnableCollision

bool GetEnableCollision() const

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const

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

Fields

OnJointBreak

Event<void ()> OnJointBreak

Triggered when the joint's break force or torque is exceeded.

Protected

Methods

OnDestroyed

void OnDestroyed() override

Called once just before the component is destroyed.

Called regardless of the state the component is in.

OnDisabled

void OnDisabled() override

Called every time a component is placed into the Stopped state.

This includes component destruction if component wasn't already in Stopped state during destruction. When called during destruction it is called before OnDestroyed.

OnEnabled

void OnEnabled() override

Called every time a component leaves the Stopped state, if the component is enabled.

This includes component creation if requirements for leaving the Stopped state are met. When called during creation it is called after OnBeginPlay.

OnTransformChanged

void OnTransformChanged(TransformChangedFlags flags) override

Called when the component's parent scene object has changed.

Not called if the component is in Stopped state. Also only called if necessary notify flags are set via SetNotifyFlagsInternal().

CreateImplementation

virtual UPtr<IJointImplementation> CreateImplementation() = 0

Creates the implementation the joint for use by the component.

DestroyImplementation

void DestroyImplementation()

Destroys the current implementation of the joint, if any.

Effectively removing it from the scene.

CalculateLocalBodyTransform

virtual void CalculateLocalBodyTransform(JointBody body, Vector3 &position, Quaternion &rotation)

Calculates the local position/rotation that needs to be applied to the particular joint body.

NotifyRigidbodyMoved

void NotifyRigidbodyMoved(const HRigidbody &body)

Notifies the joint that one of the attached rigidbodies moved and that its transform needs updating.

UpdateRelativeBodyTransforms

void UpdateRelativeBodyTransforms(JointBody body)

Updates the local transform for the specified body attached to the joint.

Fields

mImplementation

UPtr<IJointImplementation> mImplementation

Private

Fields

mInformation

JointCreateInformation & mInformation