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

The IBone graph node interface.

Bones can be used to build an (animated) skeleton structure, to later apply vertex skinning to a mesh, in other words deform the model of e.g. a human body according to the movements of the skeleton.

The first of two ways to use a bone is to activate it through a Graph::IBoneState node later in the scene graph, which assigns the bone to a given unit. Subsequent rendering geometry can refer to this bone through the assigned unit; there is a maximum of 24 distinct units that can be used in parallel (geometry that is using more than 24 bones by design must be split into multiple separate geometries through the scene converter tool. See IEnums::BoneUnit).

Use the Graph::IStateUnit base interface to set or get the bone unit index this bone is temporarily attached to if any children are present.

See sceneGraphStatesSlotsUnits for an overview of state handling during scene graph traversal.
See Graph::IBoneState for assigning bones.


Table members

Inherited


Murl.Graph.IStateUnit

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

SetLength(length)

Set the bone length.

Boolean SetLength(Number length)

Parameters
lengthThe length to set.
Returns
Boolean true if successful.

GetLength()

Get the bone length.

Number GetLength()

Returns
Number The length

SetOffsetTransform(offsetTransform)

Set the offset transform. An animated skeleton can simply be built and visualized in a hierarchical way, using relative transforms (and attached animations) for each individual bone with regard to its parent structure. To connect the skeleton to a given renderable mesh at run-time, which is usually modeled in some form of "bind pose", an additional transform for each bone is needed. This "offset transform" is static for a single mesh-skeleton relation.

Boolean SetOffsetTransform(Murl.Math.Matrix offsetTransform)

Parameters
offsetTransformThe offset transform to set.
Returns
Boolean true if successful.

GetOffsetTransform()

Get the mutable offset transform. This method can be called to get access to the internal offset transform for direct manipulation. Internally, the bone's state will be set to "modified" as soon as this method is called.

Murl.Math.Matrix GetOffsetTransform()

Returns
Murl.Math.Matrix A mutable reference to the internal offset transform.

SetUserTransform(userTransform)

Set the user transform. By default, the user transform equals the identity matrix. Individual bones of a skeleton may be easily controlled by a Logic::IProcessor by simply manipulating their user transform, i.e. by calling this function. For example, in an animated human body model one could simply pick the skeleton's "spine" bone and replace its user matrix with a matrix containing a rotation around e.g. the Y axis (depending how the model was designed) to make the figure's head turn.

Boolean SetUserTransform(Murl.Math.Matrix userTransform)

Parameters
userTransformThe user transform to set.
Returns
Boolean true if successful.

GetUserTransform()

Get the mutable user transform. This method can be called to get access to the internal user transform for direct manipulation. Internally, the bone's state will be set to "modified" as soon as this method is called.

Murl.Math.Matrix GetUserTransform()

Returns
Murl.Math.Matrix A mutable reference to the internal user transform.

SetWorldTransform(worldTransform)

Set the world transform.

Boolean SetWorldTransform(Murl.Math.Matrix worldTransform)

Parameters
worldTransformThe world transform to set.
Returns
Boolean true if successful.

GetWorldTransform()

Get the mutable world transform.

Murl.Math.Matrix GetWorldTransform()

Returns
Murl.Math.Matrix A mutable reference to the internal world transform.

GetSkeletonTransform()

Get the constant skeleton transform.

Murl.Math.Matrix GetSkeletonTransform()

Returns
Murl.Math.Matrix A constant reference to the internal skeleton transform.

GetBoneTransform()

Get the constant overall bone transform.

Murl.Math.Matrix GetBoneTransform()

Returns
Murl.Math.Matrix A constant reference to the overall bone transform.

GetNumberOfStages()

Get the bone's number of stages.

Integer GetNumberOfStages()

Returns
Integer The number of stages.