예제 #1
0
        public static CompressedVector4 Compress(Vector4 vector4, BoundedRange[] boundedRange)
        {
            CompressedVector4 data = default(CompressedVector4);

                        #if UNITY
            data.x = boundedRange[0].Compress(vector4.x);
            data.y = boundedRange[1].Compress(vector4.y);
            data.z = boundedRange[2].Compress(vector4.z);
            data.w = boundedRange[3].Compress(vector4.w);
                        #else
            data.x = boundedRange[0].Compress(vector4.X);
            data.y = boundedRange[1].Compress(vector4.Y);
            data.z = boundedRange[2].Compress(vector4.Z);
            data.w = boundedRange[3].Compress(vector4.W);
                        #endif

            return(data);
        }
예제 #2
0
 public static Vector4 Decompress(CompressedVector4 data, BoundedRange[] boundedRange)
 {
     return(new Vector4(boundedRange[0].Decompress(data.x), boundedRange[1].Decompress(data.y), boundedRange[2].Decompress(data.z), boundedRange[3].Decompress(data.w)));
 }