C# Class ColladaXna.Base.Import.SkeletonImporter

This class imports the joint structure of the model. If no joints are found there will be still one root joint with Identity transformation added to the model's joint collection.
Inheritance: IColladaImporter
Show file Open project: Bunkerbewohner/ColladaXna Class Usage Examples

Public Methods

Method Description
Import ( XmlNode xmlRoot, ColladaModel model ) : void

Imports all joint nodes referenced by <skeleton> nodes and their children. Stores the found joints in the given model's joint collection.

Private Methods

Method Description
CreateNodeTransform ( XmlNode xmlNode ) : Matrix

Looks for transformation elements (matrix, rotate, scale, translate, lookat) within a node and creates a transform matrix from it. If no transformations are found Identity is returned.

skew transformations are not supported right now

FindJointNodes ( XmlNode xmlRoot ) : List

Finds root joint nodes in the document. If there are none an empty list is returned.

GetNodeName ( XmlNode xmlNode ) : string

Returns a name of the given XML node. If the name attribute is defined its value is returned. Otherwise the id attribute is used instead. If no id is defined null is returned.

ReadJoints ( Joint parent, IEnumerable xmlNodes, ColladaModel model ) : void

Reads the given joints and all of their children recursively. Newly created joints are appended to the Children collection of the parent (if not null) and to the Joints collection of the given model.

Method Details

Import() public method

Imports all joint nodes referenced by <skeleton> nodes and their children. Stores the found joints in the given model's joint collection.
public Import ( XmlNode xmlRoot, ColladaModel model ) : void
xmlRoot System.Xml.XmlNode XML root node
model ColladaModel model to store joints in
return void