コード例 #1
0
        protected override void ProcessInnerNode(AseReader reader, AseNode parentNode)
        {
            AseMesh mesh = parentNode as AseMesh;

            if (reader.NodeName == "MESH_FACENORMAL")
            {
                AseStringTokenizer tokens = new AseStringTokenizer(reader.NodeData);
                int     index             = int.Parse(tokens.GetNext());
                AseFace face = mesh.FaceList[index];
                face.NormalFace = new AseVertex(
                    float.Parse(tokens.GetNext()),
                    float.Parse(tokens.GetNext()),
                    float.Parse(tokens.GetNext()));
                for (int i = 0; i < 3; i++)
                {
                    reader.ReadNextLine();
                    tokens = new AseStringTokenizer(reader.NodeData);
                    if (reader.NodeName == "MESH_VERTEXNORMAL")
                    {
                        int vIndex = int.Parse(tokens.GetNext());
                        if (vIndex == mesh.FaceList[index].A)
                        {
                            face.NormalA = new AseVertex(
                                float.Parse(tokens.GetNext()),
                                float.Parse(tokens.GetNext()),
                                float.Parse(tokens.GetNext()));
                        }
                        else if (vIndex == mesh.FaceList[index].B)
                        {
                            face.NormalB = new AseVertex(
                                float.Parse(tokens.GetNext()),
                                float.Parse(tokens.GetNext()),
                                float.Parse(tokens.GetNext()));
                        }
                        else if (vIndex == mesh.FaceList[index].C)
                        {
                            face.NormalC = new AseVertex(
                                float.Parse(tokens.GetNext()),
                                float.Parse(tokens.GetNext()),
                                float.Parse(tokens.GetNext()));
                        }
                    }
                    else
                    {
                        // we must have atleast 3 MESH_VERTEXNORMAL nodes
                        i--;
                    }
                }
                mesh.FaceList[index] = face;
            }
        }
コード例 #2
0
        protected override void ProcessInnerNode(AseReader reader, AseNode parentNode)
        {
            AseMesh mesh = parentNode as AseMesh;

            if (reader.NodeName == "MESH_TFACE")
            {
                AseStringTokenizer tokens = new AseStringTokenizer(reader.NodeData);
                int     index             = int.Parse(tokens.GetNext());
                AseFace face = mesh.FaceList[index];
                face.TextureA        = int.Parse(tokens.GetNext());
                face.TextureB        = int.Parse(tokens.GetNext());
                face.TextureC        = int.Parse(tokens.GetNext());
                mesh.FaceList[index] = face;
            }
        }
コード例 #3
0
 public AseGeometryObject() : base()
 {
     AddNodeParser("NODE_TM", _transform = new AseTransform());
     AddNodeParser("MESH", _mesh         = new AseMesh());
 }