DecompressUv() public method

Decompresses texture coordinates.
public DecompressUv ( Vector2 uv ) : Vector2
uv Vector2 The texture coordinates to decompress.
return Vector2
Esempio n. 1
0
 /// <summary>
 /// Decompresses vertex data in-place.
 /// </summary>
 /// <param name="vertices">The vertices to decompress in-place.</param>
 /// <param name="compressor">The compressor to use.</param>
 private static void DecompressVertices(IEnumerable<ObjVertex> vertices, VertexCompressor compressor)
 {
     foreach (var vertex in vertices)
     {
         vertex.Position = compressor.DecompressPosition(vertex.Position);
         vertex.TexCoords = compressor.DecompressUv(vertex.TexCoords);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Decompresses vertex data in-place.
 /// </summary>
 /// <param name="vertices">The vertices to decompress in-place.</param>
 /// <param name="compressor">The compressor to use.</param>
 private static void DecompressVertices(IEnumerable <ObjVertex> vertices, VertexCompressor compressor)
 {
     foreach (var vertex in vertices)
     {
         vertex.Position  = compressor.DecompressPosition(vertex.Position);
         vertex.TexCoords = compressor.DecompressUv(vertex.TexCoords);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Decompresses vertex data in-place.
        /// </summary>
        /// <param name="vertices">The vertices to decompress in-place.</param>
        /// <param name="compressor">The compressor to use.</param>
        private static void DecompressVertices(IEnumerable <GenericVertex> vertices, VertexCompressor compressor)
        {
            if (compressor == null)
            {
                return;
            }

            foreach (var vertex in vertices)
            {
                vertex.Position  = ToVector3D(compressor.DecompressPosition(new RealQuaternion(vertex.Position.X, vertex.Position.Y, vertex.Position.Z, 1)));
                vertex.TexCoords = ToVector3D(compressor.DecompressUv(new RealVector2d(vertex.TexCoords.X, vertex.TexCoords.Y)));
            }
        }