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

The IBoneState graph node interface.

A bone state node is used to assign a given Graph::IBone to a given unit during scene graph traversal. For the purpose of vertex skinning, a renderable geometry such as a Graph::IResourceMeshGeometry node can link to one or more bones by specifying the appropriate number of bone unit indices; during scene graph traversal, the currently active bones at the selected units will be taken to actually deform the geometry.

The correct sequence of creating and using a skeleton for performing vertex skinning is as follows:

  • Create a hierarchical skeleton made up from individual transform and bone nodes, with unique IDs assigned to each bone
  • Activate all bones needed for a specific mesh in the correct bone units, by means of individual IBoneState nodes
  • Render the geometry through e.g. a Graph::IResourceMeshGeometry node (not forgetting to also set needed material/texture states etc.)

Use the interface's GetBoneNodeTarget() method to programmatically set the bone node this state object is supposed to refer to.
Use the base interface's IStateUnit::SetUnit() method to set the actual unit index the referenced bone should be attached to.

See sceneGraphStatesSlotsUnits for an overview of state handling during scene graph traversal.
See Graph::IBone for defining bones to refer to.


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

GetBoneNodeTarget()

Get the constant Graph::IBoneNodeTarget container. This method returns a mutable pointer to the node's Graph::IBoneNodeTarget container, which allows to query the bone state node's referenced bone node.

Murl.Graph.IGenericNodeTarget.GraphIBone GetBoneNodeTarget()

Returns
Murl.Graph.IGenericNodeTarget.GraphIBone The constant Graph::IBoneNodeTarget container, or null if not available