예제 #1
0
        private static uint Pack(float x, float y)
        {
            uint packX = HalfUtils.ConvertFloatToHalf(x);
            uint packY = (uint)(HalfUtils.ConvertFloatToHalf(y) << 16);

            return(packX | packY);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Half"/> structure.
 /// </summary>
 /// <param name="value">The floating point value that should be stored in 16 bit format.</param>
 public Half(float value)
 {
     PackedValue = HalfUtils.ConvertFloatToHalf(value);
 }
예제 #3
0
 void IPackedVector.PackFromVector4(Vector4 vector)
 {
     PackedValue = HalfUtils.ConvertFloatToHalf(vector.X);
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Half"/> structure.
 /// </summary>
 /// <param name="vector">The <see cref="Vector4"/> to pack from.</param>
 public Half(Vector4 vector)
 {
     PackedValue = HalfUtils.ConvertFloatToHalf(vector.X);
 }