Exemplo n.º 1
0
 public void Read(GrnBoneNode boneNode)
 {
     this.ParentIndex = boneNode.ParentIndex;
     this.Position = boneNode.Position;
     this.Rotation = boneNode.Rotation;
     this.Scale = boneNode.Scale;
 }
Exemplo n.º 2
0
        public static GrnNode ReadByNodeType(GrnBinaryReader reader, GrnNode parentNode, GrnNodeType nodeType)
        {
            GrnNode node;

            if (nodeType == GrnNodeType.FileDirectory)
            {
                node = new GrnMainNode();
            }
            else if (nodeType == GrnNodeType.VersionFrameDirectory ||
                     nodeType == GrnNodeType.StandardFrameDirectory ||
                     nodeType == GrnNodeType.NullFrameDirectory)
            {
                node = new GrnSectionNode(parentNode, nodeType);
            }
            else if (nodeType == GrnNodeType.StringTable)
            {
                node = new GrnStringTableNode(parentNode);
            }
            else if (parentNode.NodeType == GrnNodeType.MeshVertexSet)
            {
                if (nodeType == GrnNodeType.MeshVertices)
                {
                    node = new GrnMeshVerticesNode(parentNode);
                }
                else if (nodeType == GrnNodeType.MeshNormals)
                {
                    node = new GrnMeshNormalsNode(parentNode);
                }
                else
                {
                    node = new GrnNode(parentNode, nodeType);
                }
            }
            else if (nodeType == GrnNodeType.MeshField)
            {
                node = new GrnMeshFieldNode(parentNode);
            }
            else if (nodeType == GrnNodeType.MeshWeights)
            {
                node = new GrnMeshWeightsNode(parentNode);
            }
            else if (nodeType == GrnNodeType.MeshTriangles)
            {
                node = new GrnMeshTrianglesNode(parentNode);
            }
            else if (nodeType == GrnNodeType.DataExtensionProperty)
            {
                node = new GrnDataExtensionPropertyNode(parentNode);
            }
            else if (nodeType == GrnNodeType.DataExtensionPropertyValue)
            {
                node = new GrnDataExtensionPropertyValueNode(parentNode);
            }
            else if (nodeType == GrnNodeType.DataExtensionReference)
            {
                node = new GrnDataExtensionReferenceNode(parentNode);
            }
            else if (nodeType == GrnNodeType.Bone)
            {
                node = new GrnBoneNode(parentNode);
            }
            else if (nodeType == GrnNodeType.MaterialSimpleDiffuseTexture)
            {
                node = new GrnMaterialSimpleDiffuseTextureNode(parentNode);
            }
            else if (nodeType == GrnNodeType.FormBoneChannels)
            {
                node = new GrnFormBoneChannelsNode(parentNode);
            }
            else if (nodeType == GrnNodeType.FormMesh)
            {
                node = new GrnFormMeshNode(parentNode);
            }
            else if (nodeType == GrnNodeType.FormMeshBone)
            {
                node = new GrnFormMeshBoneNode(parentNode);
            }
            else if (nodeType == GrnNodeType.RenderPass)
            {
                node = new GrnRenderPassNode(parentNode);
            }
            else if (nodeType == GrnNodeType.RenderPassTriangles)
            {
                node = new GrnRenderPassTrianglesNode(parentNode);
            }
            else if (nodeType == GrnNodeType.AnimationTransformTrackKeys)
            {
                node = new GrnAnimationTransformTrackKeysNode(parentNode);
            }
            else if (nodeType == GrnNodeType.TextureMapImage)
            {
                node = new GrnTextureMapImageNode(parentNode);
            }
            else
            {
                node = new GrnNode(parentNode, nodeType);
            }

            node.Read(reader);
            return(node);
        }
Exemplo n.º 3
0
 public void Write(GrnNode boneSecNode)
 {
     GrnBoneNode boneNode = new GrnBoneNode(boneSecNode);
     boneNode.ParentIndex = this.ParentIndex;
     boneNode.Position = this.Position;
     boneNode.Rotation = this.Rotation;
     boneNode.Scale = this.Scale;
     boneSecNode.AppendChild(boneNode);
 }