C# Class BEPUutilities2.Matrix

Provides SIMD-aware 4x4 matrix math.
All functions assume row vectors.
Mostra file Open project: RossNordby/scratchpad

Public Properties

Property Type Description
W Vector4
X Vector4
Y Vector4
Z Vector4

Public Methods

Method Description
CreateLookAt ( Vector3 position, Vector3 target, Vector3 upVector ) : Matrix

Creates a view matrix pointing from a position to a target with the given up vector.

CreateLookAt ( Vector3 &position, Vector3 &target, Vector3 &upVector, Matrix &viewMatrix ) : void

Creates a view matrix pointing from a position to a target with the given up vector.

CreateOrthographic ( float left, float right, float bottom, float top, float zNear, float zFar, Matrix &projection ) : void

Creates a right handed orthographic projection.

CreateView ( Vector3 position, Vector3 forward, Vector3 upVector ) : Matrix

Creates a view matrix pointing looking in a direction with a given up vector.

CreateView ( Vector3 &position, Vector3 &forward, Vector3 &upVector, Matrix &viewMatrix ) : void

Creates a view matrix pointing in a direction with a given up vector.

Invert ( Matrix m ) : Matrix

Inverts the matrix.

Invert ( Matrix &m, Matrix &inverted ) : void

Inverts the matrix.

Private Methods

Method Description
CreateFromAxisAngle ( Vector3 axis, float angle ) : Matrix
CreateFromAxisAngle ( Vector3 &axis, float angle, Matrix &result ) : void
CreateFromQuaternion ( Quaternion quaternion ) : Matrix
CreateFromQuaternion ( Quaternion &quaternion, Matrix &result ) : void
CreatePerspectiveFieldOfView ( float fieldOfView, float aspectRatio, float nearClip, float farClip ) : Matrix
CreatePerspectiveFieldOfView ( float fieldOfView, float aspectRatio, float nearClip, float farClip, Matrix &perspective ) : void
CreatePerspectiveFieldOfViewLH ( float fieldOfView, float aspectRatio, float nearClip, float farClip, Matrix &perspective ) : void
CreatePerspectiveFromFieldOfViews ( float verticalFieldOfView, float horizontalFieldOfView, float nearClip, float farClip ) : Matrix
CreatePerspectiveFromFieldOfViews ( float verticalFieldOfView, float horizontalFieldOfView, float nearClip, float farClip, Matrix &perspective ) : void
Multiply ( Matrix &a, Matrix &b, Matrix &result ) : void
Transform ( Vector4 &v, Matrix &m, Vector4 &result ) : void
TransformTranspose ( Vector4 &v, Matrix &m, Vector4 &result ) : void
Transpose ( Matrix m ) : Matrix
Transpose ( M m, M transposed ) : void
Transpose ( Matrix m, Matrix transposed ) : void
operator ( ) : Matrix

Method Details

CreateLookAt() public static method

Creates a view matrix pointing from a position to a target with the given up vector.
public static CreateLookAt ( Vector3 position, Vector3 target, Vector3 upVector ) : Matrix
position Vector3 Position of the camera.
target Vector3 Target of the camera.
upVector Vector3 Up vector of the camera.
return Matrix

CreateLookAt() public static method

Creates a view matrix pointing from a position to a target with the given up vector.
public static CreateLookAt ( Vector3 &position, Vector3 &target, Vector3 &upVector, Matrix &viewMatrix ) : void
position Vector3 Position of the camera.
target Vector3 Target of the camera.
upVector Vector3 Up vector of the camera.
viewMatrix Matrix Look at matrix.
return void

CreateOrthographic() public static method

Creates a right handed orthographic projection.
public static CreateOrthographic ( float left, float right, float bottom, float top, float zNear, float zFar, Matrix &projection ) : void
left float Leftmost coordinate of the projected area.
right float Rightmost coordinate of the projected area.
bottom float Bottom coordinate of the projected area.
top float Top coordinate of the projected area.
zNear float Near plane of the projection.
zFar float Far plane of the projection.
projection Matrix The resulting orthographic projection matrix.
return void

CreateView() public static method

Creates a view matrix pointing looking in a direction with a given up vector.
public static CreateView ( Vector3 position, Vector3 forward, Vector3 upVector ) : Matrix
position Vector3 Position of the camera.
forward Vector3 Forward direction of the camera.
upVector Vector3 Up vector of the camera.
return Matrix

CreateView() public static method

Creates a view matrix pointing in a direction with a given up vector.
public static CreateView ( Vector3 &position, Vector3 &forward, Vector3 &upVector, Matrix &viewMatrix ) : void
position Vector3 Position of the camera.
forward Vector3 Forward direction of the camera.
upVector Vector3 Up vector of the camera.
viewMatrix Matrix Look at matrix.
return void

Invert() public static method

Inverts the matrix.
public static Invert ( Matrix m ) : Matrix
m Matrix Matrix to invert.
return Matrix

Invert() public static method

Inverts the matrix.
public static Invert ( Matrix &m, Matrix &inverted ) : void
m Matrix Matrix to invert.
inverted Matrix Inverted version of the matrix.
return void

Property Details

W public_oe property

Row 4 of the matrix.
public Vector4 W
return Vector4

X public_oe property

Row 1 of the matrix.
public Vector4 X
return Vector4

Y public_oe property

Row 2 of the matrix.
public Vector4 Y
return Vector4

Z public_oe property

Row 3 of the matrix.
public Vector4 Z
return Vector4