Exemplo n.º 1
0
        public static CVertexArray Read(DatReader datReader)
        {
            CVertexArray obj = new CVertexArray();

            obj.VertexType = datReader.ReadInt32();

            uint num_vertices = datReader.ReadUInt32();

            if (obj.VertexType == 1)
            {
                for (uint i = 0; i < num_vertices; i++)
                {
                    short vert_id = datReader.ReadInt16();
                    obj.Vertices.Add(vert_id, SWVertex.Read(datReader));
                }
            }

            return(obj);
        }
Exemplo n.º 2
0
        public static SWVertex Read(DatReader datReader)
        {
            SWVertex obj = new SWVertex();

            short num_uvs = datReader.ReadInt16();

            obj.X       = datReader.ReadSingle();
            obj.Y       = datReader.ReadSingle();
            obj.Z       = datReader.ReadSingle();
            obj.NormalX = datReader.ReadSingle();
            obj.NormalY = datReader.ReadSingle();
            obj.NormalZ = datReader.ReadSingle();

            for (short i = 0; i < num_uvs; i++)
            {
                obj.UVs.Add(Vec2Duv.Read(datReader));
            }

            return(obj);
        }