![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
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.
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()
Set the bone length.
Boolean SetLength(Number length)
length | The length to set. |
Get the bone length.
Number GetLength()
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)
offsetTransform | The offset transform to set. |
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()
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)
userTransform | The user transform to set. |
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()
Set the world transform.
Boolean SetWorldTransform(Murl.Math.Matrix worldTransform)
worldTransform | The world transform to set. |
Get the mutable world transform.
Murl.Math.Matrix GetWorldTransform()
Get the constant skeleton transform.
Murl.Math.Matrix GetSkeletonTransform()
Get the constant overall bone transform.
Murl.Math.Matrix GetBoneTransform()
Get the bone's number of stages.
Integer GetNumberOfStages()