Example #1
0
        protected void QuakeVertexToBspVertex(InternalBspVertex src, out BspVertex dest, out TextureLightMap texLightMap)
        {
            dest = new BspVertex();

            dest.position  = new Vector3(src.point[0], src.point[1], src.point[2]);
            dest.normal    = new Vector3(src.normal[0], src.normal[1], src.normal[2]);
            dest.texCoords = new Vector2(src.texture[0], src.texture[1]);
            dest.lightMap  = new Vector2(src.lightMap[0], src.lightMap[1]);

            texLightMap       = new TextureLightMap();
            texLightMap.color = src.color;
        }
Example #2
0
        private void ReadVertices(InternalBspLump lump, BinaryReader reader)
        {
            reader.BaseStream.Seek(lump.offset, SeekOrigin.Begin);
            vertices = new InternalBspVertex[lump.size / Marshal.SizeOf(typeof(InternalBspVertex))];

            for (int i = 0; i < vertices.Length; i++)
            {
                vertices[i]          = new InternalBspVertex();
                vertices[i].point    = new float[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
                vertices[i].texture  = new float[] { reader.ReadSingle(), reader.ReadSingle() };
                vertices[i].lightMap = new float[] { reader.ReadSingle(), reader.ReadSingle() };
                vertices[i].normal   = new float[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
                vertices[i].color    = reader.ReadInt32();

                TransformVector(vertices[i].point);
                TransformVector(vertices[i].normal, true);
            }
        }
        protected void QuakeVertexToBspVertex(InternalBspVertex src, out BspVertex dest, out TextureLightMap texLightMap)
        {
            dest = new BspVertex();

            dest.position = new Vector3(src.point[0], src.point[1], src.point[2]);
            dest.normal = new Vector3(src.normal[0], src.normal[1], src.normal[2]);
            dest.texCoords = new Vector2(src.texture[0], src.texture[1]);
            dest.lightMap = new Vector2(src.lightMap[0], src.lightMap[1]);

            texLightMap = new TextureLightMap();
            texLightMap.color = src.color;
        }
Example #4
0
		private void ReadVertices( InternalBspLump lump, BinaryReader reader )
		{
			reader.BaseStream.Seek( lump.offset, SeekOrigin.Begin );

			for ( int i = 0; i < vertices.Length; i++ )
			{
				vertices[ i ] = new InternalBspVertex();
				vertices[ i ].point = new float[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
				vertices[ i ].texture = new float[] { reader.ReadSingle(), reader.ReadSingle() };
				vertices[ i ].lightMap = new float[] { reader.ReadSingle(), reader.ReadSingle() };
				vertices[ i ].normal = new float[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
				vertices[ i ].color = reader.ReadInt32();

				TransformVector( vertices[ i ].point );
				TransformVector( vertices[ i ].normal, true );
			}
		}