Ejemplo n.º 1
0
        public Model3DNode ReadSingleNode(Model3DNode root, DataReader dr)
        {
            Model3DNode n = new Model3DNode();

            n.Parent  = root;
            n.Name    = dr.ReadFullString();
            n.MatrixA = ReadMat(dr);
            int cCount = dr.ReadInt();

            n.Children = new List <Model3DNode>(cCount);
            for (int i = 0; i < cCount; i++)
            {
                n.Children.Add(ReadSingleNode(n, dr));
            }
            return(n);
        }
Ejemplo n.º 2
0
 void PopulateChildren(ModelNode node, Model3DNode orin, Model model, AnimationEngine engine, List<ModelNode> allNodes)
 {
     allNodes.Add(node);
     if (engine.HeadBones.Contains(node.Name))
     {
         node.Mode = 0;
     }
     else if (engine.LegBones.Contains(node.Name))
     {
         node.Mode = 2;
     }
     else
     {
         node.Mode = 1;
     }
     for (int i = 0; i < orin.Children.Count; i++)
     {
         ModelNode child = new ModelNode() { Parent = node, Name = orin.Children[i].Name.ToLowerFast() };
         PopulateChildren(child, orin.Children[i], model, engine, allNodes);
         node.Children.Add(child);
     }
 }
Ejemplo n.º 3
0
 public Model3DNode ReadSingleNode(Model3DNode root, DataReader dr)
 {
     Model3DNode n = new Model3DNode();
     n.Parent = root;
     n.Name = dr.ReadFullString();
     n.MatrixA = ReadMat(dr);
     int cCount = dr.ReadInt();
     n.Children = new List<Model3DNode>(cCount);
     for (int i = 0; i < cCount; i++)
     {
         n.Children.Add(ReadSingleNode(n, dr));
     }
     return n;
 }
Ejemplo n.º 4
0
 List<Model3DNode> GetNodes(Model3DNode node)
 {
     List<Model3DNode> nodes = new List<Model3DNode>();
     nodes.Add(node);
     if (node.Children.Count > 0)
     {
         for (int i = 0; i < node.Children.Count; i++)
         {
             nodes.AddRange(GetNodes(node.Children[i]));
         }
     }
     return nodes;
 }