示例#1
0
        private void ReadVertexes()
        {
            // Calc how many verts there are, them rip them into the vertexLump
            BSP.BaseStream.Seek(header.Directory [10].Offset, SeekOrigin.Begin);
            // A vertex is 44 bytes, so use that to calc how many there are using the lump length from the header
            int vertCount = header.Directory [10].Length / 44;

            vertexLump = new VertexLump(vertCount);
            for (int i = 0; i < vertCount; i++)
            {
                vertexLump.Verts [i] = new Vertex(new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle()), BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle(), new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle()), BSP.ReadBytes(4));
            }
        }
示例#2
0
        private void ReadVertexes()
        {
            // Calc how many verts there are, them rip them into the vertexLump
            BSP.BaseStream.Seek(header.Directory [10].Offset, SeekOrigin.Begin);
            // A vertex is 44 bytes, so use that to calc how many there are using the lump length from the header
            int vertCount = header.Directory [10].Length / 44;
            vertexLump = new VertexLump(vertCount);
            for (int i = 0; i < vertCount; i++)
            {
                vertexLump.Verts [i] = new Vertex(new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle()), BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle(), new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle()), BSP.ReadBytes(4));
            }

        }