예제 #1
0
 public void Read(List<int> transformChannels, GrnAnimationTransformTrackKeysNode animTransTrackKeys)
 {
     this.DataExtensionIndex = transformChannels[animTransTrackKeys.TransformChannelIndex - 1];
     this.PositionKeys = animTransTrackKeys.PositionKeys;
     this.RotationKeys = animTransTrackKeys.RotationKeys;
     this.ScaleKeys = animTransTrackKeys.ScaleKeys;
     this.Positions = animTransTrackKeys.Positions;
     this.Rotations = animTransTrackKeys.Rotations;
     this.Scales = animTransTrackKeys.Scales;
 }
예제 #2
0
 public void Write(GrnNode animTraTraSecNode, int boneTrackIndex)
 {
     GrnAnimationTransformTrackKeysNode attKeysNode =
         new GrnAnimationTransformTrackKeysNode(animTraTraSecNode);
     attKeysNode.TransformChannelIndex = boneTrackIndex + 1;
     attKeysNode.PositionKeys = this.PositionKeys;
     attKeysNode.RotationKeys = this.RotationKeys;
     attKeysNode.ScaleKeys = this.ScaleKeys;
     attKeysNode.Positions = this.Positions;
     attKeysNode.Rotations = this.Rotations;
     attKeysNode.Scales = this.Scales;
     animTraTraSecNode.AppendChild(attKeysNode);
 }
예제 #3
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);
        }