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 Output-States, Slots und Units for an overview of state handling during scene graph traversal.
See Graph::IBone for defining bones to refer to.