C# Class NewTOAPIA.Graphics.Matrix4

显示文件 Open project: Wiladams/NewTOAPIA Class Usage Examples

Public Properties

Property Type Description
Identity Matrix4

Public Methods

Method Description
Frustum ( float left, float right, float bottom, float top, float near, float far ) : Matrix4

Build a projection matrix

Invert ( Matrix4 mat ) : Matrix4

Calculate the inverse of the given matrix

LookAt ( Vector3f eye, Vector3f target, Vector3f up ) : Matrix4

Build a world space to camera space matrix

Matrix4 ( ) : System
Matrix4 ( float elements ) : System
Matrix4 ( float4 row0, float4 row1, float4 row2, float4 row3 ) : System

Construct a new matrix from 4 vectors representing each row

Mult ( Matrix4 left, Matrix4 right ) : Matrix4

Post multiply this matrix by another matrix

Mult ( Matrix4 &left, Matrix4 &right, Matrix4 &result ) : void
Perspective ( float fovy, float aspect, float near, float far ) : Matrix4

Build a projection matrix

Rotate ( Quaternion q ) : Matrix4

Build a rotation matrix from a quaternion

Rotate ( float3 axis, float angle ) : Matrix4

Build a rotation matrix to rotate about the given axis

RotateX ( float angle ) : Matrix4

Build a rotation matrix that rotates about the x-axis

RotateY ( float angle ) : Matrix4

Build a rotation matrix that rotates about the y-axis

RotateZ ( float angle ) : Matrix4

Build a rotation matrix that rotates about the z-axis

Scale ( float x, float y, float z ) : void
Set ( float vec ) : void
SetToIdentity ( ) : void
ToString ( ) : string

Returns a System.String that represents the current Matrix44.

Translate ( float x, float y, float z ) : void
Translation ( Vector3f trans ) : Matrix4

Build a translation matrix with the given translation

Translation ( float x, float y, float z ) : Matrix4

Build a translation matrix with the given translation

Transpose ( Matrix4 mat ) : Matrix4

Calculate the transpose of the given matrix

Transpose ( ) : void
Transpose ( Matrix4 &mat, Matrix4 &result ) : void

Calculate the transpose of the given matrix

get ( int x, int y ) : float
operator ( ) : Matrix4

Matrix multiplication

Method Details

Frustum() public static method

Build a projection matrix
public static Frustum ( float left, float right, float bottom, float top, float near, float far ) : Matrix4
left float Left edge of the view frustum
right float Right edge of the view frustum
bottom float Bottom edge of the view frustum
top float Top edge of the view frustum
near float Distance to the near clip plane
far float Distance to the far clip plane
return Matrix4

Invert() public static method

Calculate the inverse of the given matrix
Thrown if the Matrix4 is singular.
public static Invert ( Matrix4 mat ) : Matrix4
mat Matrix4 The matrix to invert
return Matrix4

LookAt() public static method

Build a world space to camera space matrix
public static LookAt ( Vector3f eye, Vector3f target, Vector3f up ) : Matrix4
eye Vector3f Eye (camera) position in world space
target Vector3f Target position in world space
up Vector3f Up vector in world space (should not be parallel to the camera direction, that is target - eye)
return Matrix4

Matrix4() public method

public Matrix4 ( ) : System
return System

Matrix4() public method

public Matrix4 ( float elements ) : System
elements float
return System

Matrix4() public method

Construct a new matrix from 4 vectors representing each row
public Matrix4 ( float4 row0, float4 row1, float4 row2, float4 row3 ) : System
row0 float4 Top row of the matrix
row1 float4 2nd row of the matrix
row2 float4 3rd row of the matrix
row3 float4 Bottom row of the matrix
return System

Mult() public static method

Post multiply this matrix by another matrix
public static Mult ( Matrix4 left, Matrix4 right ) : Matrix4
left Matrix4
right Matrix4 The matrix to multiply
return Matrix4

Mult() public static method

public static Mult ( Matrix4 &left, Matrix4 &right, Matrix4 &result ) : void
left Matrix4
right Matrix4
result Matrix4
return void

Perspective() public static method

Build a projection matrix
public static Perspective ( float fovy, float aspect, float near, float far ) : Matrix4
fovy float Angle of the field of view in the y direction (in radians)
aspect float Aspect ratio of the view (width / height)
near float Distance to the near clip plane
far float Distance to the far clip plane
return Matrix4

Rotate() public static method

Build a rotation matrix from a quaternion
public static Rotate ( Quaternion q ) : Matrix4
q Quaternion the quaternion
return Matrix4

Rotate() public static method

Build a rotation matrix to rotate about the given axis
public static Rotate ( float3 axis, float angle ) : Matrix4
axis float3 the axis to rotate about
angle float angle in radians to rotate counter-clockwise (looking in the direction of the given axis)
return Matrix4

RotateX() public static method

Build a rotation matrix that rotates about the x-axis
public static RotateX ( float angle ) : Matrix4
angle float angle in radians to rotate counter-clockwise around the x-axis
return Matrix4

RotateY() public static method

Build a rotation matrix that rotates about the y-axis
public static RotateY ( float angle ) : Matrix4
angle float angle in radians to rotate counter-clockwise around the y-axis
return Matrix4

RotateZ() public static method

Build a rotation matrix that rotates about the z-axis
public static RotateZ ( float angle ) : Matrix4
angle float angle in radians to rotate counter-clockwise around the z-axis
return Matrix4

Scale() public method

public Scale ( float x, float y, float z ) : void
x float
y float
z float
return void

Set() public method

public Set ( float vec ) : void
vec float
return void

SetToIdentity() public method

public SetToIdentity ( ) : void
return void

ToString() public method

Returns a System.String that represents the current Matrix44.
public ToString ( ) : string
return string

Translate() public method

public Translate ( float x, float y, float z ) : void
x float
y float
z float
return void

Translation() public static method

Build a translation matrix with the given translation
public static Translation ( Vector3f trans ) : Matrix4
trans Vector3f The vector to translate along
return Matrix4

Translation() public static method

Build a translation matrix with the given translation
public static Translation ( float x, float y, float z ) : Matrix4
x float X translation
y float Y translation
z float Z translation
return Matrix4

Transpose() public static method

Calculate the transpose of the given matrix
public static Transpose ( Matrix4 mat ) : Matrix4
mat Matrix4 The matrix to transpose
return Matrix4

Transpose() public method

public Transpose ( ) : void
return void

Transpose() public static method

Calculate the transpose of the given matrix
public static Transpose ( Matrix4 &mat, Matrix4 &result ) : void
mat Matrix4 The matrix to transpose
result Matrix4
return void

get() public method

public get ( int x, int y ) : float
x int
y int
return float

operator() public static method

Matrix multiplication
public static operator ( ) : Matrix4
return Matrix4

Property Details

Identity static_oe public_oe property

The identity matrix
static public Matrix4 Identity
return Matrix4