示例#1
0
        public static QuantizedVector4 Quantize(Vector4 vector4, BoundedRange[] boundedRange)
        {
            QuantizedVector4 data = default(QuantizedVector4);

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

            return(data);
        }
示例#2
0
 public static Vector4 Dequantize(QuantizedVector4 data, BoundedRange[] boundedRange)
 {
     return(new Vector4(boundedRange[0].Dequantize(data.x), boundedRange[1].Dequantize(data.y), boundedRange[2].Dequantize(data.z), boundedRange[3].Dequantize(data.w)));
 }