Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IJoint

The IJoint graph node interface.

Joint nodes are used in the framework's physics simulator to connect two Graph::IBody nodes, or to connect a single Graph::IBody node to a specific point in world space. There exist different joint types (e.g. Graph::IBallJoint or Graph::IHingeJoint), each of which enforces different constraints on the connection.


Table members

Methods


GetNodeInterface()

Get the constant Graph::INode interface. This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.

Murl.Graph.INode GetNodeInterface()

Returns
Murl.Graph.INode The constant Graph::INode interface, or null if not available

GetTransformInterface()

Get the constant Graph::ITransform interface. This method returns a constant pointer to the node's Graph::ITransform interface, to be able to query the node's transformation matrix and depth order.

Murl.Graph.ITransform GetTransformInterface()

Returns
Murl.Graph.ITransform The constant Graph::ITransform interface, or null if not available

GetBodyNodeTarget()

Get the constant Graph::IBodyNodeTarget container. This method returns a constant pointer to the node's Graph::IBodyNodeTarget container, which allows to query the connected bodies.

Murl.Graph.IGenericNodeTarget.GraphIBody GetBodyNodeTarget()

Returns
Murl.Graph.IGenericNodeTarget.GraphIBody The constant Graph::IBodyNodeTarget container.

SetBodyPosition(index, position)

Set the anchor position at a given index. If a body is present at the given index (in the range from 0 to 1), the given position represents the anchor position relative to that body's local coordinate system. If no body is present, the position is interpreted relative to the joint itself, which can be set using the joint's ITransformable interface obtained from GetTransformInterface().

Boolean SetBodyPosition(Integer index, Murl.Math.Vector position)

Parameters
indexThe anchor index, either 0 or 1.
positionThe anchor position.
Returns
Boolean true if successful.

GetBodyPosition(index)

Get the anchor position at a given index. See SetBodyPosition().

Murl.Math.Vector GetBodyPosition(Integer index)

Parameters
indexThe anchor index, either 0 or 1.
Returns
Murl.Math.Vector The anchor position.

SetBodyInfluence(index, enabled)

Enable/disable the joint's influence on an attached body.

Boolean SetBodyInfluence(Integer index, Boolean enabled)

Parameters
indexThe body index, either 0 or 1.
enabledIf true, the attached body gets influenced by the joint.
Returns
Boolean true if successful.

GetBodyInfluence(index)

Check if the joint is influencing an attached body.

Boolean GetBodyInfluence(Integer index)

Parameters
indexThe body index, either 0 or 1.
Returns
Boolean true if influence is enabled.

SetSpringConstant(springConstant)

Set the joint's spring constant.

Boolean SetSpringConstant(Number springConstant)

Parameters
springConstantThe spring constant.
Returns
Boolean true if successful.

GetSpringConstant()

Get the joint's spring constant.

Number GetSpringConstant()

Returns
Number The spring constant.

SetDampingConstant(dampingConstant)

Set the joint's damping constant.

Boolean SetDampingConstant(Number dampingConstant)

Parameters
dampingConstantThe damping constant.
Returns
Boolean true if successful.

GetDampingConstant()

Get the joint's damping constant.

Number GetDampingConstant()

Returns
Number The damping constant.