DecompressPosition() public method

Decompresses a position so that its components are in model space.
public DecompressPosition ( Vector4 pos ) : Vector4
pos Vector4 The position to decompress.
return Vector4
Exemplo 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);
     }
 }
Exemplo 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);
     }
 }
Exemplo 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)));
            }
        }