예제 #1
0
        // read from binary reader
        internal RWSceneNode(BinaryReader reader, List<RWSceneNode> frameList)
        {
            _transform = reader.ReadMatrix4x3();
            int parentIndex = reader.ReadInt32();
            _userFlags = reader.ReadInt32();

            _children = new List<RWSceneNode>();

            if (parentIndex != -1)
                _parent = frameList[parentIndex];
            else
                _parent = null;
        }
예제 #2
0
 // Private methods
 private static void DepthFirstTraversal(RWSceneNode frame, ref List<RWSceneNode> list, ref int nIndex)
 {
     list.Add(frame);
     nIndex++;
     if (frame.Children == null)
         return;
     for (int i = 0; i < frame.Children.Count; i++)
     {
         DepthFirstTraversal(frame.Children[i], ref list, ref nIndex);
     }
 }
예제 #3
0
 /// <summary>
 /// Construct a new scene node with a given local transform, node parent and user flag.
 /// </summary>
 /// <param name="transform">The local transformation matrix of the node.</param>
 /// <param name="parent">The parent node of the scene node.</param>
 /// <param name="userFlag">The user flag to set.</param>
 public RWSceneNode(Matrix4x4 transform, RWSceneNode parent, int userFlag)
 {
     _transform = transform;
     _userFlags = userFlag;
     Parent = parent;
 }
예제 #4
0
 private static void WalkChildren(RWSceneNode rwNode, Assimp.Node parent)
 {
     foreach (RWSceneNode child in rwNode.Children)
     {
         string name = child.BoneMetadata.BoneNameID.ToString();
         Assimp.Node aiNode = new Assimp.Node(name, parent);
     }
 }