Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Matrix3"/> class using a given matrix.
 /// </summary>
 public Matrix3(Matrix3 m)
 {
     _m11 = m.M11; _m12 = m.M12; _m13 = m.M13;
     _m21 = m.M21; _m22 = m.M22; _m23 = m.M23;
     _m31 = m.M31; _m32 = m.M32; _m33 = m.M33;
 }
Пример #2
0
 /// <summary>
 /// Transforms a given vector by a matrix.
 /// </summary>
 /// <param name="matrix">A <see cref="Matrix3"/> instance.</param>
 /// <param name="vector">A <see cref="Vector3"/> instance.</param>
 /// <returns>A new <see cref="Vector3"/> instance containing the result.</returns>
 public static Vector3 operator *(Matrix3 matrix, Vector3 vector)
 {
     return(Matrix3.Transform(matrix, vector));
 }
Пример #3
0
 public static Vector3 operator *(Vector3 rkPoint, Matrix3 rkMatrix)
 {
     return(Matrix3.Transpose(rkMatrix) * rkPoint);
 }
Пример #4
0
 /// <summary>
 /// Subtracts a scalar from a matrix.
 /// </summary>
 /// <param name="matrix">A <see cref="Matrix3"/> instance.</param>
 /// <param name="scalar">A single-precision floating-point number.</param>
 /// <returns>A new <see cref="Matrix3"/> instance containing the difference.</returns>
 public static Matrix3 operator -(Matrix3 matrix, float scalar)
 {
     return(Matrix3.Subtract(matrix, scalar));
 }
Пример #5
0
 /// <summary>
 /// Multiplies two matrices.
 /// </summary>
 /// <param name="left">A <see cref="Matrix3"/> instance.</param>
 /// <param name="right">A <see cref="Matrix3"/> instance.</param>
 /// <returns>A new <see cref="Matrix3"/> instance containing the result.</returns>
 public static Matrix3 operator *(Matrix3 left, Matrix3 right)
 {
     return(Matrix3.Multiply(left, right));
 }
Пример #6
0
 /// <summary>
 /// Subtracts a matrix from a matrix.
 /// </summary>
 /// <param name="left">A <see cref="Matrix3"/> instance.</param>
 /// <param name="right">A <see cref="Matrix3"/> instance.</param>
 /// <returns>A new <see cref="Matrix3"/> instance containing the difference.</returns>
 public static Matrix3 operator -(Matrix3 left, Matrix3 right)
 {
     return(Matrix3.Subtract(left, right));
 }
Пример #7
0
 /// <summary>
 /// Adds a matrix and a scalar.
 /// </summary>
 /// <param name="matrix">A <see cref="Matrix3"/> instance.</param>
 /// <param name="scalar">A single-precision floating-point number.</param>
 /// <returns>A new <see cref="Matrix3"/> instance containing the sum.</returns>
 public static Matrix3 operator +(float scalar, Matrix3 matrix)
 {
     return(Matrix3.Add(matrix, scalar));
 }
Пример #8
0
 /// <summary>
 /// Adds two matrices.
 /// </summary>
 /// <param name="left">A <see cref="Matrix3"/> instance.</param>
 /// <param name="right">A <see cref="Matrix3"/> instance.</param>
 /// <returns>A new <see cref="Matrix3"/> instance containing the sum.</returns>
 public static Matrix3 operator +(Matrix3 left, Matrix3 right)
 {
     return(Matrix3.Add(left, right));
 }
Пример #9
0
 /// <summary>
 /// Transforms a given vector by a matrix and put the result in a vector.
 /// </summary>
 /// <param name="matrix">A <see cref="Matrix3"/> instance.</param>
 /// <param name="vector">A <see cref="Vector3"/> instance.</param>
 /// <param name="result">A <see cref="Vector3"/> instance to hold the result.</param>
 public static void Transform(Matrix3 matrix, Vector3 vector, ref Vector3 result)
 {
     result.X = (matrix.M11 * vector.X) + (matrix.M12 * vector.Y) + (matrix.M13 * vector.Z);
     result.Y = (matrix.M21 * vector.X) + (matrix.M22 * vector.Y) + (matrix.M23 * vector.Z);
     result.Z = (matrix.M31 * vector.X) + (matrix.M32 * vector.Y) + (matrix.M33 * vector.Z);
 }
Пример #10
0
 public static Quaternion fromEulerAnglesZYX(float z, float y, float x)
 {
     return(new Quaternion(Matrix3.fromEulerAnglesZYX(z, y, x)));
 }