private static uint Pack(float x, float y) { uint packX = HalfUtils.ConvertFloatToHalf(x); uint packY = (uint)(HalfUtils.ConvertFloatToHalf(y) << 16); return(packX | packY); }
/// <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); }
void IPackedVector.PackFromVector4(Vector4 vector) { PackedValue = HalfUtils.ConvertFloatToHalf(vector.X); }
/// <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); }