Exemple #1
0
 private void PackHelper(float x, float y, float z, float w)
 {
     X = HalfUtils.Pack(x);
     Y = HalfUtils.Pack(y);
     Z = HalfUtils.Pack(z);
     W = HalfUtils.Pack(w);
 }
        /// <summary>
        /// Expands the HalfVector2 to a Vector2.
        /// </summary>
        public Vector2 ToVector2()
        {
            Vector2 vector2;

            vector2.X = HalfUtils.Unpack((ushort)this.packedValue);
            vector2.Y = HalfUtils.Unpack((ushort)(this.packedValue >> 16));
            return(vector2);
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the HalfVector4 class.
 /// </summary>
 /// <param name="x">Initial value for the x component.</param><param name="y">Initial value for the y component.</param><param name="z">Initial value for the z component.</param><param name="w">Initial value for the w component.</param>
 public HalfVector4(float x, float y, float z, float w)
     : this(
         HalfUtils.Pack(x),
         HalfUtils.Pack(y),
         HalfUtils.Pack(z),
         HalfUtils.Pack(w))
 {
 }
        /// <summary>
        /// Expands the packed representation into a Vector4.
        /// </summary>
        public Vector3 ToVector3()
        {
            Vector3 vector3;

            vector3.X = HalfUtils.Unpack(X);
            vector3.Y = HalfUtils.Unpack(Y);
            vector3.Z = HalfUtils.Unpack(Z);
            return(vector3);
        }
Exemple #5
0
        public Vector3 ToVector3()
        {
            Vector3 vector;

            vector.X = HalfUtils.Unpack(this.X);
            vector.Y = HalfUtils.Unpack(this.Y);
            vector.Z = HalfUtils.Unpack(this.Z);
            return(vector);
        }
Exemple #6
0
        /// <summary>
        /// Expands the packed representation into a Vector4.
        /// </summary>
        public Vector4 ToVector4()
        {
            Vector4 vector4;

            vector4.X = HalfUtils.Unpack(X);
            vector4.Y = HalfUtils.Unpack(Y);
            vector4.Z = HalfUtils.Unpack(Z);
            vector4.W = HalfUtils.Unpack(W);
            return(vector4);
        }
        /// <summary>
        /// Expands the packed representation into a Vector4.
        /// </summary>
        public Vector4 ToVector4()
        {
            Vector4 vector4;

            vector4.X = HalfUtils.Unpack((ushort)this.PackedValue);
            vector4.Y = HalfUtils.Unpack((ushort)(this.PackedValue >> 16));
            vector4.Z = HalfUtils.Unpack((ushort)(this.PackedValue >> 32));
            vector4.W = HalfUtils.Unpack((ushort)(this.PackedValue >> 48));
            return(vector4);
        }
 /// <summary>
 /// Initializes a new instance of the HalfVector3 class.
 /// </summary>
 /// <param name="x">Initial value for the x component.</param><param name="y">Initial value for the y component.</param><param name="z">Initial value for the z component.</param><param name="w">Initial value for the w component.</param>
 public HalfVector3(float x, float y, float z)
 {
     X = HalfUtils.Pack(x);
     Y = HalfUtils.Pack(y);
     Z = HalfUtils.Pack(z);
 }
 private static uint PackHelper(float vectorX, float vectorY)
 {
     return((uint)HalfUtils.Pack(vectorX) | (uint)HalfUtils.Pack(vectorY) << 16);
 }
Exemple #10
0
 private static ulong PackHelper(float vectorX, float vectorY, float vectorZ, float vectorW)
 {
     return((ulong)HalfUtils.Pack(vectorX) | (ulong)HalfUtils.Pack(vectorY) << 16 | (ulong)HalfUtils.Pack(vectorZ) << 32 | (ulong)HalfUtils.Pack(vectorW) << 48);
 }
Exemple #11
0
 public HalfVector3(float x, float y, float z)
 {
     this.X = HalfUtils.Pack(x);
     this.Y = HalfUtils.Pack(y);
     this.Z = HalfUtils.Pack(z);
 }