![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
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.
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()
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()
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()
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)
index | The anchor index, either 0 or 1. |
position | The anchor position. |
Get the anchor position at a given index. See SetBodyPosition().
Murl.Math.Vector GetBodyPosition(Integer index)
index | The anchor index, either 0 or 1. |
Enable/disable the joint's influence on an attached body.
Boolean SetBodyInfluence(Integer index, Boolean enabled)
index | The body index, either 0 or 1. |
enabled | If true, the attached body gets influenced by the joint. |
Check if the joint is influencing an attached body.
Boolean GetBodyInfluence(Integer index)
index | The body index, either 0 or 1. |
Set the joint's spring constant.
Boolean SetSpringConstant(Number springConstant)
springConstant | The spring constant. |
Get the joint's spring constant.
Number GetSpringConstant()
Set the joint's damping constant.
Boolean SetDampingConstant(Number dampingConstant)
dampingConstant | The damping constant. |
Get the joint's damping constant.
Number GetDampingConstant()