///<summary>
        /// Reads and returns a Vector3FloatStruct from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="IOException"> if an error occurs</exception>
        public static Vector3FloatStruct Deserialize(HlaEncodingReader reader)
        {
            Vector3FloatStruct decodedValue = new Vector3FloatStruct();

            decodedValue.XComponent = reader.ReadHLAfloat32BE();
            decodedValue.YComponent = reader.ReadHLAfloat32BE();
            decodedValue.ZComponent = reader.ReadHLAfloat32BE();
            return(decodedValue);
        }
Exemple #2
0
        /// <summary>
        /// Used to divide a vector by a scalar value.
        /// </summary>
        /// <param name="left"></param>
        /// <param name="scalar"></param>
        /// <returns></returns>
        public static Vector3FloatStruct operator /(Vector3FloatStruct left, float scalar)
        {
            Vector3FloatStruct vector = new Vector3FloatStruct();

            // get the inverse of the scalar up front to avoid doing multiple divides later
            float inverse = 1.0f / scalar;

            vector.XComponent = left.XComponent * inverse;
            vector.YComponent = left.YComponent * inverse;
            vector.ZComponent = left.ZComponent * inverse;

            return(vector);
        }
 ///<summary>
 /// Writes this Vector3FloatStruct to the specified stream.
 ///</summary>
 ///<param name="writer"> the output stream to write to</param>
 ///<param name="obj"> the object to serialize</param>
 ///<exception cref="IOException"> if an error occurs</exception>
 public static void Serialize(HlaEncodingWriter writer, Vector3FloatStruct obj)
 {
     writer.WriteHLAfloat32BE(obj.XComponent);
     writer.WriteHLAfloat32BE(obj.YComponent);
     writer.WriteHLAfloat32BE(obj.ZComponent);
 }
Exemple #4
0
 /// <summary>
 ///		Used to negate the elements of a vector.
 /// </summary>
 /// <param name="left"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Negate(Vector3FloatStruct left)
 {
     return(-left);
 }
        ///<summary>
        /// Reads and returns a Vector3FloatStruct from the specified stream.
        ///</summary>
        ///<param name="reader"> the input stream to read from</param>
        ///<returns> the decoded value</returns>
        ///<exception cref="IOException"> if an error occurs</exception>
        public static Vector3FloatStruct Deserialize(HlaEncodingReader reader)
        {
            Vector3FloatStruct decodedValue = new Vector3FloatStruct();

            decodedValue.XComponent = reader.ReadHLAfloat32BE();
            decodedValue.YComponent = reader.ReadHLAfloat32BE();
            decodedValue.ZComponent = reader.ReadHLAfloat32BE();
            return decodedValue;
        }
Exemple #6
0
 /// <summary>
 ///		Used when a scalar value is multiplied by a Vector3.
 /// </summary>
 /// <param name="scalar"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Multiply(float scalar, Vector3FloatStruct right)
 {
     return(scalar * right);
 }
Exemple #7
0
 /// <summary>
 ///		Used to subtract a Vector3FloatStruct from another Vector3.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Subtract(Vector3FloatStruct left, Vector3FloatStruct right)
 {
     return(left - right);
 }
Exemple #8
0
 /// <summary>
 ///		Used when a Vector3FloatStruct is multiplied by another vector.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Multiply(Vector3FloatStruct left, Vector3FloatStruct right)
 {
     return left * right;
 }
Exemple #9
0
 /// <summary>
 ///		Used when a Vector3FloatStruct is multiplied by a scalar value.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="scalar"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Multiply(Vector3FloatStruct left, float scalar)
 {
     return(left * scalar);
 }
Exemple #10
0
 /// <summary>
 /// Used to divide a vector by a scalar value.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="scalar"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Divide(Vector3FloatStruct left, float scalar)
 {
     return(left / scalar);
 }
Exemple #11
0
 /// <summary>
 ///		Used when a Vector3FloatStruct is added to another Vector3.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Add(Vector3FloatStruct left, Vector3FloatStruct right)
 {
     return left + right;
 }
Exemple #12
0
 /// <summary>
 ///		Used to subtract a Vector3FloatStruct from another Vector3.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Subtract(Vector3FloatStruct left, Vector3FloatStruct right)
 {
     return left - right;
 }
Exemple #13
0
 /// <summary>
 ///		Used when a Vector3FloatStruct is multiplied by another vector.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Multiply(Vector3FloatStruct left, Vector3FloatStruct right)
 {
     return(left * right);
 }
Exemple #14
0
 /// <summary>
 ///		Used to negate the elements of a vector.
 /// </summary>
 /// <param name="left"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Negate(Vector3FloatStruct left)
 {
     return -left;
 }
Exemple #15
0
 /// <summary>
 ///		Used when a scalar value is multiplied by a Vector3.
 /// </summary>
 /// <param name="scalar"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Multiply(float scalar, Vector3FloatStruct right)
 {
     return scalar * right;
 }
Exemple #16
0
 /// <summary>
 ///		Used when a Vector3FloatStruct is multiplied by a scalar value.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="scalar"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Multiply(Vector3FloatStruct left, float scalar)
 {
     return left * scalar;
 }
 ///<summary>
 /// Writes this Vector3FloatStruct to the specified stream.
 ///</summary>
 ///<param name="writer"> the output stream to write to</param>
 ///<param name="obj"> the object to serialize</param>
 ///<exception cref="IOException"> if an error occurs</exception>
 public static void Serialize(HlaEncodingWriter writer, Vector3FloatStruct obj)
 {
     writer.WriteHLAfloat32BE(obj.XComponent);
     writer.WriteHLAfloat32BE(obj.YComponent);
     writer.WriteHLAfloat32BE(obj.ZComponent);
 }
Exemple #18
0
 /// <summary>
 ///		Used when a Vector3FloatStruct is added to another Vector3.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Add(Vector3FloatStruct left, Vector3FloatStruct right)
 {
     return(left + right);
 }
Exemple #19
0
        /// <summary>
        /// Used to divide a vector by a scalar value.
        /// </summary>
        /// <param name="left"></param>
        /// <param name="scalar"></param>
        /// <returns></returns>
        public static Vector3FloatStruct operator /(Vector3FloatStruct left, float scalar)
        {
            Vector3FloatStruct vector = new Vector3FloatStruct();

            // get the inverse of the scalar up front to avoid doing multiple divides later
            float inverse = 1.0f / scalar;

            vector.XComponent = left.XComponent * inverse;
            vector.YComponent = left.YComponent * inverse;
            vector.ZComponent = left.ZComponent * inverse;

            return vector;
        }
Exemple #20
0
 /// <summary>
 /// Used to divide a vector by a scalar value.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="scalar"></param>
 /// <returns></returns>
 public static Vector3FloatStruct Divide(Vector3FloatStruct left, float scalar)
 {
     return left / scalar;
 }