Exemple #1
0
 /// <summary>
 /// Transforms a 3-D vector normal by the given matrix.
 /// </summary>
 /// <param name="source">Source TGCVector3.</param>
 /// <param name="sourceMatrix">Source TGCMatrix.</param>
 /// <returns>A Vector3 structure that contains the results of this method.</returns>
 public static TGCVector3 TransformNormal(TGCVector3 source, TGCMatrix sourceMatrix)
 {
     return(new TGCVector3(Vector3.TransformNormal(source.ToVector3(), sourceMatrix.ToMatrix())));
 }
Exemple #2
0
 /// <summary>
 /// Transforms a 3-D vector or an array of 3-D vectors by a given matrix, projecting the result back into w = 1.
 /// </summary>
 /// <param name="sourceMatrix">Source TGCMatrix.</param>
 public void TransformCoordinate(TGCMatrix sourceMatrix)
 {
     this.dxVector3.TransformCoordinate(sourceMatrix.ToMatrix());
 }
Exemple #3
0
 /// <summary>
 /// Transforms a 3-D vector normal by the given matrix.
 /// </summary>
 /// <param name="sourceMatrix">Source TGCMatrix.</param>
 public void TransformNormal(TGCMatrix sourceMatrix)
 {
     this.dxVector3.TransformNormal(sourceMatrix.ToMatrix());
 }
Exemple #4
0
 /// <summary>
 /// Calculates the inverse of a matrix.
 /// </summary>
 /// <param name="source">Source TGCMatrix.</param>
 /// <returns>A TGCMatrix that is the result of the operation.</returns>
 public static TGCMatrix Invert(TGCMatrix source)
 {
     return(new TGCMatrix(Matrix.Invert(source.ToMatrix())));
 }
Exemple #5
0
 /// <summary>
 /// Transforms a 4-D vector or an array of 4-D vectors by a given matrix.
 /// </summary>
 /// <param name="vector">Array of source TGCVector4 structures.</param>
 /// <param name="sourceMatrix">Source TGCMatrix structure.</param>
 /// <returns></returns>
 public static TGCVector4[] Transform(TGCVector4[] vector, TGCMatrix sourceMatrix)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Builds a quaternion from a rotation matrix.
 /// </summary>
 /// <param name="m">Source Matrix that defines the rotation.</param>
 public void RotateMatrix(TGCMatrix m)
 {
     this.dxQuaternion.RotateMatrix(m);
 }
Exemple #7
0
 /// <summary>
 /// Transforms a plane by a matrix.
 /// </summary>
 /// <param name="m">Source TGCMatrix, which contains the transformation values. This matrix must contain the inverse transpose of the transformation values.</param>
 public void Transform(TGCMatrix m)
 {
     this.dxPlane.Transform(m.ToMatrix());
 }
Exemple #8
0
 /// <summary>
 /// Transposes the matrix using a source matrix.
 /// </summary>
 /// <param name="source">Source TGCMatrix.</param>
 public void Transpose(TGCMatrix source)
 {
     this.dxMatrix.Transpose(source.ToMatrix());
 }
Exemple #9
0
 /// <summary>
 /// Returns the matrix transpose of a given matrix.
 /// </summary>
 /// <param name="source">Source Matrix.</param>
 /// <returns>A TGCMatrix object that is the matrix transpose of the matrix.</returns>
 public static TGCMatrix TransposeMatrix(TGCMatrix source)
 {
     return(new TGCMatrix(Matrix.TransposeMatrix(source.ToMatrix())));
 }
Exemple #10
0
 /// <summary>
 /// Calculates the transposed product of two matrices.
 /// </summary>
 /// <param name="left">Source TGCMatrix.</param>
 /// <param name="right">Source TGCMatrix.</param>
 /// <returns>A TGCMatrix that is the product and transposition of two matrices.</returns>
 public static TGCMatrix MultiplyTranspose(TGCMatrix left, TGCMatrix right)
 {
     return(new TGCMatrix(Matrix.MultiplyTranspose(left.ToMatrix(), right.ToMatrix())));
 }
Exemple #11
0
 /// <summary>
 /// Subtracts one matrix from another.
 /// </summary>
 /// <param name="left">A TGCMatrix instance on the left side of the subtraction operation.</param>
 /// <param name="right">A TGCMatrix instance on the right side of the subtraction operation.</param>
 /// <returns>A TGCMatrix instance that represents the result of the subtraction.</returns>
 public static TGCMatrix Subtract(TGCMatrix left, TGCMatrix right)
 {
     return(new TGCMatrix(Matrix.Subtract(left.ToMatrix(), right.ToMatrix())));
 }
Exemple #12
0
 /// <summary>
 /// Calculates the transposed product of two matrices.
 /// </summary>
 /// <param name="source">Source TGCMatrix to multiply and transpose with the current instance.</param>
 public void MultiplyTranspose(TGCMatrix source)
 {
     this.dxMatrix.MultiplyTranspose(source.ToMatrix());
 }
Exemple #13
0
 /// <summary>
 /// Determines the product of two matrices.
 /// </summary>
 /// <param name="source">Source TGCMatrix to multiply by the current instance.</param>
 public void Multiply(TGCMatrix source)
 {
     this.dxMatrix.Multiply(source.ToMatrix());
 }
Exemple #14
0
 /// <summary>
 /// Calculates the inverse of a matrix.
 /// </summary>
 /// <param name="determinant">A Single value that contains the determinant of the matrix. If the determinant is not needed, the parameter is omitted.</param>
 /// <param name="source">Source TGCMatrix.</param>
 /// <returns>A TGCMatrix that is the result of the operation.</returns>
 public static TGCMatrix Invert(ref float determinant, TGCMatrix source)
 {
     return(new TGCMatrix(Matrix.Invert(ref determinant, source.ToMatrix())));
 }
Exemple #15
0
 /// <summary>
 /// Projects a vector from screen space into object space.
 /// </summary>
 /// <param name="viewport">An Object structure that represents the viewport. Only Viewport structures are valid for this parameter.</param>
 /// <param name="projection">A TGCMatrix structure that represents the projection matrix.</param>
 /// <param name="view">A TGCMatrix structure that represents the view matrix.</param>
 /// <param name="world">A TGCMatrix structure that represents the world matrix.</param>
 public void Unproject(object viewport, TGCMatrix projection, TGCMatrix view, TGCMatrix world)
 {
     this.dxVector3.Unproject(viewport, projection.ToMatrix(), view.ToMatrix(), world.ToMatrix());
 }
 /// <summary>
 /// Transforms a 2-D vector or an array of 2-D vectors by a given matrix.
 /// </summary>
 /// <param name="source">Source TGCVector2.</param>
 /// <param name="sourceMatrix">Source TGCMatrix.</param>
 /// <returns>A TGCVector4 structure that is the result of the method.</returns>
 public static TGCVector4 Transform(TGCVector2 source, TGCMatrix sourceMatrix)
 {
     return(new TGCVector4(Vector2.Transform(source.ToVector2(), sourceMatrix.ToMatrix())));
 }
Exemple #17
0
 /// <summary>
 /// Projects a vector from screen space into object space.
 /// </summary>
 /// <param name="v">Source TGCVector3.</param>
 /// <param name="viewport">An Object structure that represents the viewport. Only Viewport structures are valid for this parameter.</param>
 /// <param name="projection">A TGCMatrix structure that represents the projection matrix.</param>
 /// <param name="view">A TGCMatrix structure that represents the view matrix.</param>
 /// <param name="world">A TGCMatrix structure that represents the world matrix.</param>
 /// <returns>A TGCVector3 structure that is the vector projected from screen space into object space.</returns>
 public static TGCVector3 Unproject(TGCVector3 v, object viewport, TGCMatrix projection, TGCMatrix view, TGCMatrix world)
 {
     return(new TGCVector3(Vector3.Unproject(v.ToVector3(), viewport, projection.ToMatrix(), view.ToMatrix(), world.ToMatrix())));
 }
 /// <summary>
 /// Transforms a 2-D vector or an array of 2-D vectors by a given matrix, projecting the result back into w = 1.
 /// </summary>
 /// <param name="source">Source TGCVector2.</param>
 /// <param name="sourceMatrix">Source TGCMatrix.</param>
 /// <returns>A TGCVector2 that represents the results of the method.</returns>
 public static TGCVector2 TransformCoordinate(TGCVector2 source, TGCMatrix sourceMatrix)
 {
     return(new TGCVector2(Vector2.TransformCoordinate(source.ToVector2(), sourceMatrix.ToMatrix())));
 }
 /// <summary>
 /// Builds a quaternion from a rotation matrix.
 /// </summary>
 /// <param name="m">Source Matrix structure that defines the rotation.</param>
 /// <returns>A Quaternion structure built from a rotation matrix.</returns>
 public static TGCQuaternion RotationMatrix(TGCMatrix m)
 {
     return(new TGCQuaternion(Quaternion.RotationMatrix(m)));
 }
Exemple #20
0
 /// <summary>
 /// Transforms a 4-D vector or an array of 4-D vectors by a given matrix.
 /// </summary>
 /// <param name="sourceMatrix">Source TGCMatrix structure.</param>
 public void Transform(TGCMatrix sourceMatrix)
 {
     throw new NotImplementedException();
 }
Exemple #21
0
 /// <summary>
 /// Transforms a plane by a matrix.
 /// </summary>
 /// <param name="p">Input TGCPlane, which contains the plane to be transformed. The vector (a,b,c) that describes the plane must be normalized before this method is called.</param>
 /// <param name="m">Source TGCMatrix, which contains the transformation values. This matrix must contain the inverse transpose of the transformation values.</param>
 /// <returns>A TGCPlane that represents the transformed plane.</returns>
 public static TGCPlane Transform(TGCPlane p, TGCMatrix m)
 {
     return(new TGCPlane(Plane.Transform(p.ToPlane(), m.ToMatrix())));
 }
Exemple #22
0
 /// <summary>
 /// Adds two matrices.
 /// </summary>
 /// <param name="left">A TGCMatrix instance on the left side of the addition operator.</param>
 /// <param name="right">A TGCMatrix instance on the right side of the addition operator.</param>
 /// <returns>A TGCMatrix instance that represents the result of the addition.</returns>
 public static TGCMatrix Add(TGCMatrix left, TGCMatrix right)
 {
     return(new TGCMatrix(Matrix.Add(left.ToMatrix(), right.ToMatrix())));
 }