C# Class Axiom.Math.Matrix4

Show file Open project: mono-soc-2011/axiom Class Usage Examples

Public Properties

Property Type Description
m00 Real
m10 Real
m20 Real
m30 Real

Public Methods

Method Description
Add ( Matrix4 left, Matrix4 right ) : Matrix4

Used to add two matrices together.

Compose ( Vector3 translation, Vector3 scale, Quaternion orientation ) : Matrix4

Creates a translation Matrix

ComposeInverse ( Vector3 translation, Vector3 scale, Quaternion orientation ) : Matrix4

Creates an inverse translation Matrix

Decompose ( Vector3 &translation, Vector3 &scale, Quaternion &orientation ) : void

Decompose the matrix.

Equals ( object obj ) : bool

Compares this Matrix to another object. This should be done because the equality operators (==, !=) have been overriden by this class.

ExtractRotation ( ) : Axiom.Math.Matrix3

Extract the 3x3 matrix representing the current rotation.

ExtractScale ( ) : Vector3

Extract scaling information.

FromMatrix3 ( Axiom.Math.Matrix3 right ) : Matrix4

Used to allow assignment from a Matrix3 to a Matrix4 object.

GetHashCode ( ) : int

Provides a unique hash code based on the member variables of this class. This should be done because the equality operators (==, !=) have been overriden by this class.

The standard implementation is a simple XOR operation between all local member variables.

GetMatrix3 ( ) : Axiom.Math.Matrix3

Returns a 3x3 portion of this 4x4 matrix.

Inverse ( ) : Matrix4

Returns an inverted matrix.

InverseAffine ( ) : Matrix4

Returns an inverted affine matrix.

MakeFloatArray ( float floats ) : void
MakeRealArray ( Real reals ) : void

Matrix4 ( Real m00, Real m01, Real m02, Real m03, Real m10, Real m11, Real m12, Real m13, Real m20, Real m21, Real m22, Real m23, Real m30, Real m31, Real m32, Real m33 ) : System

Creates a new Matrix4 with all the specified parameters.

Multiply ( Matrix4 left, Matrix4 right ) : Matrix4

Used to multiply (concatenate) two 4x4 Matrices.

Multiply ( Matrix4 matrix, Plane plane ) : Plane

Transforms a plane using the specified transform.

Multiply ( Matrix4 matrix, Vector3 vector ) : Vector3

Transforms the given 3-D vector by the matrix, projecting the result back into w = 1.

This means that the initial w is considered to be 1.0, and then all the tree elements of the resulting 3-D vector are divided by the resulting w.

Subtract ( Matrix4 left, Matrix4 right ) : Matrix4

Used to subtract two matrices.

ToString ( ) : string

Overrides the Object.ToString() method to provide a text representation of a Matrix4.

TransformAffine ( Vector3 v ) : Vector3

3-D Vector transformation specially for affine matrix.

Transforms the given 3-D vector by the matrix, projecting the result back into w = 1. The matrix must be an affine matrix. Matrix4.IsAffine.

TransformAffine ( Vector4 v ) : Vector4

4-D Vector transformation specially for affine matrix.

The matrix must be an affine matrix. Matrix4.IsAffine.

Transpose ( ) : Matrix4

Swap the rows of the matrix with the columns.

operator ( ) : Matrix4

Used to multiply (concatenate) two 4x4 Matrices.

operator ( ) : Plane

Used to multiply a transformation to a Plane.

operator ( ) : Vector3

Transforms the given 3-D vector by the matrix, projecting the result back into w = 1.

This means that the initial w is considered to be 1.0, and then all the tree elements of the resulting 3-D vector are divided by the resulting w.

operator ( ) : bool

Compares two Matrix4 instances for equality.

this ( int index ) : Real

Allows the Matrix to be accessed linearly (m[0] -> m[15]).

This indexer is only provided as a convenience, and is not recommended for use in intensive applications.

this ( int row, int col ) : Real

Allows the Matrix to be accessed like a 2d array (i.e. matrix[2,3])

This indexer is only provided as a convenience, and is not recommended for use in intensive applications.

Private Methods

Method Description
Adjoint ( ) : Matrix4

Used to generate the adjoint of this matrix.

Method Details

Add() public static method

Used to add two matrices together.
public static Add ( Matrix4 left, Matrix4 right ) : Matrix4
left Matrix4
right Matrix4
return Matrix4

Compose() public static method

Creates a translation Matrix
public static Compose ( Vector3 translation, Vector3 scale, Quaternion orientation ) : Matrix4
translation Vector3
scale Vector3
orientation Quaternion
return Matrix4

ComposeInverse() public static method

Creates an inverse translation Matrix
public static ComposeInverse ( Vector3 translation, Vector3 scale, Quaternion orientation ) : Matrix4
translation Vector3
scale Vector3
orientation Quaternion
return Matrix4

Decompose() public method

Decompose the matrix.
public Decompose ( Vector3 &translation, Vector3 &scale, Quaternion &orientation ) : void
translation Vector3
scale Vector3
orientation Quaternion
return void

Equals() public method

Compares this Matrix to another object. This should be done because the equality operators (==, !=) have been overriden by this class.
public Equals ( object obj ) : bool
obj object
return bool

ExtractRotation() public method

Extract the 3x3 matrix representing the current rotation.
public ExtractRotation ( ) : Axiom.Math.Matrix3
return Axiom.Math.Matrix3

ExtractScale() public method

Extract scaling information.
public ExtractScale ( ) : Vector3
return Vector3

FromMatrix3() public static method

Used to allow assignment from a Matrix3 to a Matrix4 object.
public static FromMatrix3 ( Axiom.Math.Matrix3 right ) : Matrix4
right Axiom.Math.Matrix3
return Matrix4

GetHashCode() public method

Provides a unique hash code based on the member variables of this class. This should be done because the equality operators (==, !=) have been overriden by this class.

The standard implementation is a simple XOR operation between all local member variables.

public GetHashCode ( ) : int
return int

GetMatrix3() public method

Returns a 3x3 portion of this 4x4 matrix.
public GetMatrix3 ( ) : Axiom.Math.Matrix3
return Axiom.Math.Matrix3

Inverse() public method

Returns an inverted matrix.
public Inverse ( ) : Matrix4
return Matrix4

InverseAffine() public method

Returns an inverted affine matrix.
public InverseAffine ( ) : Matrix4
return Matrix4

MakeFloatArray() public method

public MakeFloatArray ( float floats ) : void
floats float
return void

MakeRealArray() public method

public MakeRealArray ( Real reals ) : void
reals Real
return void

Matrix4() public method

Creates a new Matrix4 with all the specified parameters.
public Matrix4 ( Real m00, Real m01, Real m02, Real m03, Real m10, Real m11, Real m12, Real m13, Real m20, Real m21, Real m22, Real m23, Real m30, Real m31, Real m32, Real m33 ) : System
m00 Real
m01 Real
m02 Real
m03 Real
m10 Real
m11 Real
m12 Real
m13 Real
m20 Real
m21 Real
m22 Real
m23 Real
m30 Real
m31 Real
m32 Real
m33 Real
return System

Multiply() public static method

Used to multiply (concatenate) two 4x4 Matrices.
public static Multiply ( Matrix4 left, Matrix4 right ) : Matrix4
left Matrix4
right Matrix4
return Matrix4

Multiply() public static method

Transforms a plane using the specified transform.
public static Multiply ( Matrix4 matrix, Plane plane ) : Plane
matrix Matrix4 Transformation matrix.
plane Plane Plane to transform.
return Plane

Multiply() public static method

Transforms the given 3-D vector by the matrix, projecting the result back into w = 1.

This means that the initial w is considered to be 1.0, and then all the tree elements of the resulting 3-D vector are divided by the resulting w.

public static Multiply ( Matrix4 matrix, Vector3 vector ) : Vector3
matrix Matrix4 A Matrix4.
vector Vector3 A Vector3.
return Vector3

Subtract() public static method

Used to subtract two matrices.
public static Subtract ( Matrix4 left, Matrix4 right ) : Matrix4
left Matrix4
right Matrix4
return Matrix4

ToString() public method

Overrides the Object.ToString() method to provide a text representation of a Matrix4.
public ToString ( ) : string
return string

TransformAffine() public method

3-D Vector transformation specially for affine matrix.
Transforms the given 3-D vector by the matrix, projecting the result back into w = 1. The matrix must be an affine matrix. Matrix4.IsAffine.
public TransformAffine ( Vector3 v ) : Vector3
v Vector3
return Vector3

TransformAffine() public method

4-D Vector transformation specially for affine matrix.
The matrix must be an affine matrix. Matrix4.IsAffine.
public TransformAffine ( Vector4 v ) : Vector4
v Vector4
return Vector4

Transpose() public method

Swap the rows of the matrix with the columns.
public Transpose ( ) : Matrix4
return Matrix4

operator() public static method

Used to multiply (concatenate) two 4x4 Matrices.
public static operator ( ) : Matrix4
return Matrix4

operator() public static method

Used to multiply a transformation to a Plane.
public static operator ( ) : Plane
return Plane

operator() public static method

Transforms the given 3-D vector by the matrix, projecting the result back into w = 1.

This means that the initial w is considered to be 1.0, and then all the tree elements of the resulting 3-D vector are divided by the resulting w.

public static operator ( ) : Vector3
return Vector3

operator() public static method

Compares two Matrix4 instances for equality.
public static operator ( ) : bool
return bool

this() public method

Allows the Matrix to be accessed linearly (m[0] -> m[15]).
This indexer is only provided as a convenience, and is not recommended for use in intensive applications.
public this ( int index ) : Real
index int
return Real

this() public method

Allows the Matrix to be accessed like a 2d array (i.e. matrix[2,3])
This indexer is only provided as a convenience, and is not recommended for use in intensive applications.
public this ( int row, int col ) : Real
row int
col int
return Real

Property Details

m00 public property

public Real m00
return Real

m10 public property

public Real m10
return Real

m20 public property

public Real m20
return Real

m30 public property

public Real m30
return Real