C# Class BEPUutilities.Matrix3x3

3 row, 3 column matrix.
Exibir arquivo Open project: Indiefreaks/igf Class Usage Examples

Public Properties

Property Type Description
M11 float
M12 float
M13 float
M21 float
M22 float
M23 float
M31 float
M32 float
M33 float

Public Methods

Method Description
AdaptiveInvert ( Matrix3x3 &matrix, Matrix3x3 &result ) : void

Inverts the largest nonsingular submatrix in the matrix, excluding 2x2's that involve M13 or M31, and excluding 1x1's that include nondiagonal elements.

Add ( Matrix &a, Matrix &b, Matrix3x3 &result ) : void

Adds the two matrices together on a per-element basis.

Add ( Matrix &a, Matrix3x3 &b, Matrix3x3 &result ) : void

Adds the two matrices together on a per-element basis.

Add ( Matrix3x3 &a, Matrix &b, Matrix3x3 &result ) : void

Adds the two matrices together on a per-element basis.

Add ( Matrix3x3 &a, Matrix3x3 &b, Matrix3x3 &result ) : void

Adds the two matrices together on a per-element basis.

CreateCrossProduct ( System.Vector3 &v, Matrix3x3 &result ) : void

Creates a skew symmetric matrix M from vector A such that M * B for some other vector B is equivalent to the cross product of A and B.

CreateFromAxisAngle ( System.Vector3 axis, float angle ) : Matrix3x3

Creates a matrix representing a rotation of a given angle around a given axis.

CreateFromAxisAngle ( System.Vector3 &axis, float angle, Matrix3x3 &result ) : void

Creates a matrix representing a rotation of a given angle around a given axis.

CreateFromMatrix ( Matrix matrix4X4 ) : Matrix3x3

Creates a 3x3 matrix from an XNA 4x4 matrix.

CreateFromMatrix ( Matrix &matrix4X4, Matrix3x3 &matrix3X3 ) : void

Creates a 3x3 matrix from an XNA 4x4 matrix.

CreateFromQuaternion ( Quaternion quaternion ) : Matrix3x3

Creates a 3x3 matrix representing the orientation stored in the quaternion.

CreateFromQuaternion ( Quaternion &quaternion, Matrix3x3 &result ) : void

Creates a 3x3 matrix representing the orientation stored in the quaternion.

CreateOuterProduct ( System.Vector3 &a, System.Vector3 &b, Matrix3x3 &result ) : void

Computes the outer product of the given vectors.

CreateQuaternion ( Matrix3x3 r ) : Quaternion

Constructs a quaternion from a 3x3 rotation matrix.

CreateQuaternion ( Matrix3x3 &r, Quaternion &q ) : void

Constructs a quaternion from a 3x3 rotation matrix.

CreateScale ( System.Vector3 &scale ) : Matrix3x3

Constructs a non-uniform scaling matrix.

CreateScale ( float scale ) : Matrix3x3

Constructs a uniform scaling matrix.

CreateScale ( float x, float y, float z ) : Matrix3x3

Constructs a non-uniform scaling matrix.

CreateScale ( System.Vector3 &scale, Matrix3x3 &matrix ) : void

Constructs a non-uniform scaling matrix.

CreateScale ( float scale, Matrix3x3 &matrix ) : void

Constructs a uniform scaling matrix.

CreateScale ( float x, float y, float z, Matrix3x3 &matrix ) : void

Constructs a non-uniform scaling matrix.

Determinant ( ) : float

Calculates the determinant of the matrix.

Invert ( Matrix3x3 &matrix, Matrix3x3 &result ) : void

Inverts the given matix.

Matrix3x3 ( float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33 ) : System

Constructs a new 3 row, 3 column matrix.

Multiply ( Matrix &a, Matrix3x3 &b, Matrix3x3 &result ) : void

Multiplies the two matrices.

Multiply ( Matrix3x3 &a, Matrix &b, Matrix3x3 &result ) : void

Multiplies the two matrices.

Multiply ( Matrix3x3 &a, Matrix3x3 &b, Matrix3x3 &result ) : void

Multiplies the two matrices.

Multiply ( Matrix3x3 &matrix, float scale, Matrix3x3 &result ) : void

Scales all components of the matrix.

MultiplyByTransposed ( Matrix3x3 &matrix, Matrix3x3 &transpose, Matrix3x3 &result ) : void

Multiplies a matrix with a transposed matrix.

MultiplyTransposed ( Matrix3x3 &transpose, Matrix3x3 &matrix, Matrix3x3 &result ) : void

Multiplies a transposed matrix with another matrix.

Negate ( Matrix3x3 &matrix, Matrix3x3 &result ) : void

Negates every element in the matrix.

Subtract ( Matrix3x3 &a, Matrix3x3 &b, Matrix3x3 &result ) : void

Subtracts the two matrices from each other on a per-element basis.

ToMatrix4X4 ( Matrix3x3 a ) : Matrix

Creates a 4x4 matrix from a 3x3 matrix.

ToMatrix4X4 ( Matrix3x3 &a, Matrix &b ) : void

Creates a 4x4 matrix from a 3x3 matrix.

ToString ( ) : string

Creates a string representation of the matrix.

Transform ( System.Vector3 v, Matrix3x3 matrix ) : System.Vector3

Transforms the vector by the matrix.

Transform ( System.Vector3 &v, Matrix &matrix, System.Vector3 &result ) : void

Transforms the vector by the matrix.

Transform ( System.Vector3 &v, Matrix3x3 &matrix, System.Vector3 &result ) : void

Transforms the vector by the matrix.

TransformTranspose ( System.Vector3 v, Matrix3x3 matrix ) : System.Vector3

Transforms the vector by the matrix's transpose.

TransformTranspose ( System.Vector3 &v, Matrix &matrix, System.Vector3 &result ) : void

Transforms the vector by the matrix's transpose.

TransformTranspose ( System.Vector3 &v, Matrix3x3 &matrix, System.Vector3 &result ) : void

Transforms the vector by the matrix's transpose.

Transpose ( Matrix &matrix, Matrix3x3 &result ) : void

Computes the transposed matrix of a matrix.

Transpose ( Matrix3x3 &matrix, Matrix3x3 &result ) : void

Computes the transposed matrix of a matrix.

operator ( ) : Matrix3x3

Multiplies the two matrices.

Private Methods

Method Description
AdaptiveDeterminant ( int &subMatrixCode ) : float

Calculates the determinant of largest nonsingular submatrix, excluding 2x2's that involve M13 or M31, and excluding all 1x1's that involve nondiagonal elements.

Method Details

AdaptiveInvert() public static method

Inverts the largest nonsingular submatrix in the matrix, excluding 2x2's that involve M13 or M31, and excluding 1x1's that include nondiagonal elements.
public static AdaptiveInvert ( Matrix3x3 &matrix, Matrix3x3 &result ) : void
matrix Matrix3x3 Matrix to be inverted.
result Matrix3x3 Inverted matrix.
return void

Add() public static method

Adds the two matrices together on a per-element basis.
public static Add ( Matrix &a, Matrix &b, Matrix3x3 &result ) : void
a Matrix First matrix to add.
b Matrix Second matrix to add.
result Matrix3x3 Sum of the two matrices.
return void

Add() public static method

Adds the two matrices together on a per-element basis.
public static Add ( Matrix &a, Matrix3x3 &b, Matrix3x3 &result ) : void
a Matrix First matrix to add.
b Matrix3x3 Second matrix to add.
result Matrix3x3 Sum of the two matrices.
return void

Add() public static method

Adds the two matrices together on a per-element basis.
public static Add ( Matrix3x3 &a, Matrix &b, Matrix3x3 &result ) : void
a Matrix3x3 First matrix to add.
b Matrix Second matrix to add.
result Matrix3x3 Sum of the two matrices.
return void

Add() public static method

Adds the two matrices together on a per-element basis.
public static Add ( Matrix3x3 &a, Matrix3x3 &b, Matrix3x3 &result ) : void
a Matrix3x3 First matrix to add.
b Matrix3x3 Second matrix to add.
result Matrix3x3 Sum of the two matrices.
return void

CreateCrossProduct() public static method

Creates a skew symmetric matrix M from vector A such that M * B for some other vector B is equivalent to the cross product of A and B.
public static CreateCrossProduct ( System.Vector3 &v, Matrix3x3 &result ) : void
v System.Vector3 Vector to base the matrix on.
result Matrix3x3 Skew-symmetric matrix result.
return void

CreateFromAxisAngle() public static method

Creates a matrix representing a rotation of a given angle around a given axis.
public static CreateFromAxisAngle ( System.Vector3 axis, float angle ) : Matrix3x3
axis System.Vector3 Axis around which to rotate.
angle float Amount to rotate.
return Matrix3x3

CreateFromAxisAngle() public static method

Creates a matrix representing a rotation of a given angle around a given axis.
public static CreateFromAxisAngle ( System.Vector3 &axis, float angle, Matrix3x3 &result ) : void
axis System.Vector3 Axis around which to rotate.
angle float Amount to rotate.
result Matrix3x3 Matrix representing the rotation.
return void

CreateFromMatrix() public static method

Creates a 3x3 matrix from an XNA 4x4 matrix.
public static CreateFromMatrix ( Matrix matrix4X4 ) : Matrix3x3
matrix4X4 Matrix Matrix to extract a 3x3 matrix from.
return Matrix3x3

CreateFromMatrix() public static method

Creates a 3x3 matrix from an XNA 4x4 matrix.
public static CreateFromMatrix ( Matrix &matrix4X4, Matrix3x3 &matrix3X3 ) : void
matrix4X4 Matrix Matrix to extract a 3x3 matrix from.
matrix3X3 Matrix3x3 Upper 3x3 matrix extracted from the XNA matrix.
return void

CreateFromQuaternion() public static method

Creates a 3x3 matrix representing the orientation stored in the quaternion.
public static CreateFromQuaternion ( Quaternion quaternion ) : Matrix3x3
quaternion Quaternion Quaternion to use to create a matrix.
return Matrix3x3

CreateFromQuaternion() public static method

Creates a 3x3 matrix representing the orientation stored in the quaternion.
public static CreateFromQuaternion ( Quaternion &quaternion, Matrix3x3 &result ) : void
quaternion Quaternion Quaternion to use to create a matrix.
result Matrix3x3 Matrix representing the quaternion's orientation.
return void

CreateOuterProduct() public static method

Computes the outer product of the given vectors.
public static CreateOuterProduct ( System.Vector3 &a, System.Vector3 &b, Matrix3x3 &result ) : void
a System.Vector3 First vector.
b System.Vector3 Second vector.
result Matrix3x3 Outer product result.
return void

CreateQuaternion() public static method

Constructs a quaternion from a 3x3 rotation matrix.
public static CreateQuaternion ( Matrix3x3 r ) : Quaternion
r Matrix3x3 Rotation matrix to create the quaternion from.
return Quaternion

CreateQuaternion() public static method

Constructs a quaternion from a 3x3 rotation matrix.
public static CreateQuaternion ( Matrix3x3 &r, Quaternion &q ) : void
r Matrix3x3 Rotation matrix to create the quaternion from.
q Quaternion Quaternion based on the rotation matrix.
return void

CreateScale() public static method

Constructs a non-uniform scaling matrix.
public static CreateScale ( System.Vector3 &scale ) : Matrix3x3
scale System.Vector3 Values defining the axis scales.
return Matrix3x3

CreateScale() public static method

Constructs a uniform scaling matrix.
public static CreateScale ( float scale ) : Matrix3x3
scale float Value to use in the diagonal.
return Matrix3x3

CreateScale() public static method

Constructs a non-uniform scaling matrix.
public static CreateScale ( float x, float y, float z ) : Matrix3x3
x float Scaling along the x axis.
y float Scaling along the y axis.
z float Scaling along the z axis.
return Matrix3x3

CreateScale() public static method

Constructs a non-uniform scaling matrix.
public static CreateScale ( System.Vector3 &scale, Matrix3x3 &matrix ) : void
scale System.Vector3 Values defining the axis scales.
matrix Matrix3x3 Scaling matrix.
return void

CreateScale() public static method

Constructs a uniform scaling matrix.
public static CreateScale ( float scale, Matrix3x3 &matrix ) : void
scale float Value to use in the diagonal.
matrix Matrix3x3 Scaling matrix.
return void

CreateScale() public static method

Constructs a non-uniform scaling matrix.
public static CreateScale ( float x, float y, float z, Matrix3x3 &matrix ) : void
x float Scaling along the x axis.
y float Scaling along the y axis.
z float Scaling along the z axis.
matrix Matrix3x3 Scaling matrix.
return void

Determinant() public method

Calculates the determinant of the matrix.
public Determinant ( ) : float
return float

Invert() public static method

Inverts the given matix.
public static Invert ( Matrix3x3 &matrix, Matrix3x3 &result ) : void
matrix Matrix3x3 Matrix to be inverted.
result Matrix3x3 Inverted matrix.
return void

Matrix3x3() public method

Constructs a new 3 row, 3 column matrix.
public Matrix3x3 ( float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33 ) : System
m11 float Value at row 1, column 1 of the matrix.
m12 float Value at row 1, column 2 of the matrix.
m13 float Value at row 1, column 3 of the matrix.
m21 float Value at row 2, column 1 of the matrix.
m22 float Value at row 2, column 2 of the matrix.
m23 float Value at row 2, column 3 of the matrix.
m31 float Value at row 3, column 1 of the matrix.
m32 float Value at row 3, column 2 of the matrix.
m33 float Value at row 3, column 3 of the matrix.
return System

Multiply() public static method

Multiplies the two matrices.
public static Multiply ( Matrix &a, Matrix3x3 &b, Matrix3x3 &result ) : void
a Matrix First matrix to multiply.
b Matrix3x3 Second matrix to multiply.
result Matrix3x3 Product of the multiplication.
return void

Multiply() public static method

Multiplies the two matrices.
public static Multiply ( Matrix3x3 &a, Matrix &b, Matrix3x3 &result ) : void
a Matrix3x3 First matrix to multiply.
b Matrix Second matrix to multiply.
result Matrix3x3 Product of the multiplication.
return void

Multiply() public static method

Multiplies the two matrices.
public static Multiply ( Matrix3x3 &a, Matrix3x3 &b, Matrix3x3 &result ) : void
a Matrix3x3 First matrix to multiply.
b Matrix3x3 Second matrix to multiply.
result Matrix3x3 Product of the multiplication.
return void

Multiply() public static method

Scales all components of the matrix.
public static Multiply ( Matrix3x3 &matrix, float scale, Matrix3x3 &result ) : void
matrix Matrix3x3 Matrix to scale.
scale float Amount to scale.
result Matrix3x3 Scaled matrix.
return void

MultiplyByTransposed() public static method

Multiplies a matrix with a transposed matrix.
public static MultiplyByTransposed ( Matrix3x3 &matrix, Matrix3x3 &transpose, Matrix3x3 &result ) : void
matrix Matrix3x3 Matrix to be multiplied.
transpose Matrix3x3 Matrix to be transposed and multiplied.
result Matrix3x3 Product of the multiplication.
return void

MultiplyTransposed() public static method

Multiplies a transposed matrix with another matrix.
public static MultiplyTransposed ( Matrix3x3 &transpose, Matrix3x3 &matrix, Matrix3x3 &result ) : void
transpose Matrix3x3 Matrix to be transposed and multiplied.
matrix Matrix3x3 Matrix to be multiplied.
result Matrix3x3 Product of the multiplication.
return void

Negate() public static method

Negates every element in the matrix.
public static Negate ( Matrix3x3 &matrix, Matrix3x3 &result ) : void
matrix Matrix3x3 Matrix to negate.
result Matrix3x3 Negated matrix.
return void

Subtract() public static method

Subtracts the two matrices from each other on a per-element basis.
public static Subtract ( Matrix3x3 &a, Matrix3x3 &b, Matrix3x3 &result ) : void
a Matrix3x3 First matrix to subtract.
b Matrix3x3 Second matrix to subtract.
result Matrix3x3 Difference of the two matrices.
return void

ToMatrix4X4() public static method

Creates a 4x4 matrix from a 3x3 matrix.
public static ToMatrix4X4 ( Matrix3x3 a ) : Matrix
a Matrix3x3 3x3 matrix.
return Matrix

ToMatrix4X4() public static method

Creates a 4x4 matrix from a 3x3 matrix.
public static ToMatrix4X4 ( Matrix3x3 &a, Matrix &b ) : void
a Matrix3x3 3x3 matrix.
b Matrix Created 4x4 matrix.
return void

ToString() public method

Creates a string representation of the matrix.
public ToString ( ) : string
return string

Transform() public static method

Transforms the vector by the matrix.
public static Transform ( System.Vector3 v, Matrix3x3 matrix ) : System.Vector3
v System.Vector3 Vector3 to transform.
matrix Matrix3x3 Matrix to use as the transformation.
return System.Vector3

Transform() public static method

Transforms the vector by the matrix.
public static Transform ( System.Vector3 &v, Matrix &matrix, System.Vector3 &result ) : void
v System.Vector3 Vector3 to transform.
matrix Matrix Matrix to use as the transformation.
result System.Vector3 Product of the transformation.
return void

Transform() public static method

Transforms the vector by the matrix.
public static Transform ( System.Vector3 &v, Matrix3x3 &matrix, System.Vector3 &result ) : void
v System.Vector3 Vector3 to transform.
matrix Matrix3x3 Matrix to use as the transformation.
result System.Vector3 Product of the transformation.
return void

TransformTranspose() public static method

Transforms the vector by the matrix's transpose.
public static TransformTranspose ( System.Vector3 v, Matrix3x3 matrix ) : System.Vector3
v System.Vector3 Vector3 to transform.
matrix Matrix3x3 Matrix to use as the transformation transpose.
return System.Vector3

TransformTranspose() public static method

Transforms the vector by the matrix's transpose.
public static TransformTranspose ( System.Vector3 &v, Matrix &matrix, System.Vector3 &result ) : void
v System.Vector3 Vector3 to transform.
matrix Matrix Matrix to use as the transformation transpose.
result System.Vector3 Product of the transformation.
return void

TransformTranspose() public static method

Transforms the vector by the matrix's transpose.
public static TransformTranspose ( System.Vector3 &v, Matrix3x3 &matrix, System.Vector3 &result ) : void
v System.Vector3 Vector3 to transform.
matrix Matrix3x3 Matrix to use as the transformation transpose.
result System.Vector3 Product of the transformation.
return void

Transpose() public static method

Computes the transposed matrix of a matrix.
public static Transpose ( Matrix &matrix, Matrix3x3 &result ) : void
matrix Matrix Matrix to transpose.
result Matrix3x3 Transposed matrix.
return void

Transpose() public static method

Computes the transposed matrix of a matrix.
public static Transpose ( Matrix3x3 &matrix, Matrix3x3 &result ) : void
matrix Matrix3x3 Matrix to transpose.
result Matrix3x3 Transposed matrix.
return void

operator() public static method

Multiplies the two matrices.
public static operator ( ) : Matrix3x3
return Matrix3x3

Property Details

M11 public_oe property

Value at row 1, column 1 of the matrix.
public float M11
return float

M12 public_oe property

Value at row 1, column 2 of the matrix.
public float M12
return float

M13 public_oe property

Value at row 1, column 3 of the matrix.
public float M13
return float

M21 public_oe property

Value at row 2, column 1 of the matrix.
public float M21
return float

M22 public_oe property

Value at row 2, column 2 of the matrix.
public float M22
return float

M23 public_oe property

Value at row 2, column 3 of the matrix.
public float M23
return float

M31 public_oe property

Value at row 3, column 1 of the matrix.
public float M31
return float

M32 public_oe property

Value at row 3, column 2 of the matrix.
public float M32
return float

M33 public_oe property

Value at row 3, column 3 of the matrix.
public float M33
return float