VR-Link C# API Documentation
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties
makVrl.Matrix4 Struct Reference

Represents a 4x4 matrix containing 3D rotation, scale, transform, and projection. More...

+ Inheritance diagram for makVrl.Matrix4:
+ Collaboration diagram for makVrl.Matrix4:

Public Member Functions

 Matrix4 (Vector4 row0, Vector4 row1, Vector4 row2, Vector4 row3)
 Constructs a new instance. More...
 
 Matrix4 (float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
 Constructs a new instance. More...
 
void Invert ()
 Converts this instance into its inverse. More...
 
void Transpose ()
 Converts this instance into its transpose. More...
 
Matrix4 Normalized ()
 Returns a normalised copy of this instance. More...
 
void Normalize ()
 Divides each element in the Matrix by the Determinant. More...
 
Matrix4 Inverted ()
 Returns an inverted copy of this instance. More...
 
Matrix4 ClearTranslation ()
 Returns a copy of this Matrix4 without translation. More...
 
Matrix4 ClearScale ()
 Returns a copy of this Matrix4 without scale. More...
 
Matrix4 ClearRotation ()
 Returns a copy of this Matrix4 without rotation. More...
 
Matrix4 ClearProjection ()
 Returns a copy of this Matrix4 without projection. More...
 
Vector3f ExtractTranslation ()
 Returns the translation component of this instance. More...
 
Vector3f ExtractScale ()
 Returns the scale component of this instance. More...
 
Quaternion ExtractRotation (bool row_normalise=true)
 Returns the rotation component of this instance. More...
 
Vector4 ExtractProjection ()
 Returns the projection component of this instance. More...
 
override string ToString ()
 Returns a System.String that represents the current Matrix4. More...
 
override int GetHashCode ()
 Returns the hashcode for this instance. More...
 
override bool Equals (object obj)
 Indicates whether this instance and a specified object are equal. More...
 
bool Equals (Matrix4 other)
 Indicates whether the current matrix is equal to another matrix. More...
 

Static Public Member Functions

static void CreateFromAxisAngle (Vector3f axis, float angle, out Matrix4 result)
 Build a rotation matrix from the specified axis/angle rotation. More...
 
static Matrix4 CreateFromAxisAngle (Vector3f axis, float angle)
 Build a rotation matrix from the specified axis/angle rotation. More...
 
static void CreateFromQuaternion (ref Quaternion q, out Matrix4 result)
 Builds a rotation matrix from a quaternion. More...
 
static Matrix4 CreateFromQuaternion (Quaternion q)
 Builds a rotation matrix from a quaternion. More...
 
static void CreateRotationX (float angle, out Matrix4 result)
 Builds a rotation matrix for a rotation around the x-axis. More...
 
static Matrix4 CreateRotationX (float angle)
 Builds a rotation matrix for a rotation around the x-axis. More...
 
static void CreateRotationY (float angle, out Matrix4 result)
 Builds a rotation matrix for a rotation around the y-axis. More...
 
static Matrix4 CreateRotationY (float angle)
 Builds a rotation matrix for a rotation around the y-axis. More...
 
static void CreateRotationZ (float angle, out Matrix4 result)
 Builds a rotation matrix for a rotation around the z-axis. More...
 
static Matrix4 CreateRotationZ (float angle)
 Builds a rotation matrix for a rotation around the z-axis. More...
 
static void CreateTranslation (float x, float y, float z, out Matrix4 result)
 Creates a translation matrix. More...
 
static void CreateTranslation (ref Vector3f vector, out Matrix4 result)
 Creates a translation matrix. More...
 
static Matrix4 CreateTranslation (float x, float y, float z)
 Creates a translation matrix. More...
 
static Matrix4 CreateTranslation (Vector3f vector)
 Creates a translation matrix. More...
 
static Matrix4 CreateScale (float scale)
 Creates a scale matrix. More...
 
static Matrix4 CreateScale (Vector3f scale)
 Creates a scale matrix. More...
 
static Matrix4 CreateScale (float x, float y, float z)
 Creates a scale matrix. More...
 
static void CreateScale (float scale, out Matrix4 result)
 Creates a scale matrix. More...
 
static void CreateScale (ref Vector3f scale, out Matrix4 result)
 Creates a scale matrix. More...
 
static void CreateScale (float x, float y, float z, out Matrix4 result)
 Creates a scale matrix. More...
 
static void CreateOrthographic (float width, float height, float zNear, float zFar, out Matrix4 result)
 Creates an orthographic projection matrix. More...
 
static Matrix4 CreateOrthographic (float width, float height, float zNear, float zFar)
 Creates an orthographic projection matrix. More...
 
static void CreateOrthographicOffCenter (float left, float right, float bottom, float top, float zNear, float zFar, out Matrix4 result)
 Creates an orthographic projection matrix. More...
 
static Matrix4 CreateOrthographicOffCenter (float left, float right, float bottom, float top, float zNear, float zFar)
 Creates an orthographic projection matrix. More...
 
static void CreatePerspectiveFieldOfView (float fovy, float aspect, float zNear, float zFar, out Matrix4 result)
 Creates a perspective projection matrix. More...
 
static Matrix4 CreatePerspectiveFieldOfView (float fovy, float aspect, float zNear, float zFar)
 Creates a perspective projection matrix. More...
 
static void CreatePerspectiveOffCenter (float left, float right, float bottom, float top, float zNear, float zFar, out Matrix4 result)
 Creates an perspective projection matrix. More...
 
static Matrix4 CreatePerspectiveOffCenter (float left, float right, float bottom, float top, float zNear, float zFar)
 Creates an perspective projection matrix. More...
 
static Matrix4 Translation (Vector3f trans)
 Builds a translation matrix. More...
 
static Matrix4 Translation (float x, float y, float z)
 Build a translation matrix with the given translation More...
 
static Matrix4 RotateX (float angle)
 Build a rotation matrix that rotates about the x-axis More...
 
static Matrix4 RotateY (float angle)
 Build a rotation matrix that rotates about the y-axis More...
 
static Matrix4 RotateZ (float angle)
 Build a rotation matrix that rotates about the z-axis More...
 
static Matrix4 Rotate (Vector3f axis, float angle)
 Build a rotation matrix to rotate about the given axis More...
 
static Matrix4 Rotate (Quaternion q)
 Build a rotation matrix from a quaternion More...
 
static Matrix4 Scale (float scale)
 Build a scaling matrix More...
 
static Matrix4 Scale (Vector3f scale)
 Build a scaling matrix More...
 
static Matrix4 Scale (float x, float y, float z)
 Build a scaling matrix More...
 
static Matrix4 Frustum (float left, float right, float bottom, float top, float near, float far)
 Build a projection matrix More...
 
static Matrix4 Perspective (float fovy, float aspect, float near, float far)
 Build a projection matrix More...
 
static Matrix4 LookAt (Vector3f eye, Vector3f target, Vector3f up)
 Build a world space to camera space matrix More...
 
static Matrix4 LookAt (float eyeX, float eyeY, float eyeZ, float targetX, float targetY, float targetZ, float upX, float upY, float upZ)
 Build a world space to camera space matrix More...
 
static Matrix4 Add (Matrix4 left, Matrix4 right)
 Adds two instances. More...
 
static void Add (ref Matrix4 left, ref Matrix4 right, out Matrix4 result)
 Adds two instances. More...
 
static Matrix4 Subtract (Matrix4 left, Matrix4 right)
 Subtracts one instance from another. More...
 
static void Subtract (ref Matrix4 left, ref Matrix4 right, out Matrix4 result)
 Subtracts one instance from another. More...
 
static Matrix4 Mult (Matrix4 left, Matrix4 right)
 Multiplies two instances. More...
 
static void Mult (ref Matrix4 left, ref Matrix4 right, out Matrix4 result)
 Multiplies two instances. More...
 
static Matrix4 Mult (Matrix4 left, float right)
 Multiplies an instance by a scalar. More...
 
static void Mult (ref Matrix4 left, float right, out Matrix4 result)
 Multiplies an instance by a scalar. More...
 
static void Invert (ref Matrix4 mat, out Matrix4 result)
 Calculate the inverse of the given matrix More...
 
static Matrix4 Invert (Matrix4 mat)
 Calculate the inverse of the given matrix More...
 
static Matrix4 Transpose (Matrix4 mat)
 Calculate the transpose of the given matrix More...
 
static void Transpose (ref Matrix4 mat, out Matrix4 result)
 Calculate the transpose of the given matrix More...
 
static Matrix4 operator* (Matrix4 left, Matrix4 right)
 Matrix multiplication More...
 
static Matrix4 operator* (Matrix4 left, float right)
 Matrix-scalar multiplication More...
 
static Matrix4 operator+ (Matrix4 left, Matrix4 right)
 Matrix addition More...
 
static Matrix4 operator- (Matrix4 left, Matrix4 right)
 Matrix subtraction More...
 
static bool operator== (Matrix4 left, Matrix4 right)
 Compares two instances for equality. More...
 
static bool operator!= (Matrix4 left, Matrix4 right)
 Compares two instances for inequality. More...
 

Public Attributes

Vector4 Row0
 Top row of the matrix. More...
 
Vector4 Row1
 2nd row of the matrix. More...
 
Vector4 Row2
 3rd row of the matrix. More...
 
Vector4 Row3
 Bottom row of the matrix. More...
 

Static Public Attributes

static readonly Matrix4 Identity = new Matrix4(Vector4.UnitX, Vector4.UnitY, Vector4.UnitZ, Vector4.UnitW)
 The identity matrix. More...
 
static readonly Matrix4 Zero = new Matrix4(Vector4.Zero, Vector4.Zero, Vector4.Zero, Vector4.Zero)
 The zero matrix. More...
 

Properties

float Determinant [get]
 Gets the determinant of this matrix. More...
 
Vector4 Column0 [get, set]
 Gets the first column of this matrix. More...
 
Vector4 Column1 [get, set]
 Gets the second column of this matrix. More...
 
Vector4 Column2 [get, set]
 Gets the third column of this matrix. More...
 
Vector4 Column3 [get, set]
 Gets the fourth column of this matrix. More...
 
float M11 [get, set]
 Gets or sets the value at row 1, column 1 of this instance. More...
 
float M12 [get, set]
 Gets or sets the value at row 1, column 2 of this instance. More...
 
float M13 [get, set]
 Gets or sets the value at row 1, column 3 of this instance. More...
 
float M14 [get, set]
 Gets or sets the value at row 1, column 4 of this instance. More...
 
float M21 [get, set]
 Gets or sets the value at row 2, column 1 of this instance. More...
 
float M22 [get, set]
 Gets or sets the value at row 2, column 2 of this instance. More...
 
float M23 [get, set]
 Gets or sets the value at row 2, column 3 of this instance. More...
 
float M24 [get, set]
 Gets or sets the value at row 2, column 4 of this instance. More...
 
float M31 [get, set]
 Gets or sets the value at row 3, column 1 of this instance. More...
 
float M32 [get, set]
 Gets or sets the value at row 3, column 2 of this instance. More...
 
float M33 [get, set]
 Gets or sets the value at row 3, column 3 of this instance. More...
 
float M34 [get, set]
 Gets or sets the value at row 3, column 4 of this instance. More...
 
float M41 [get, set]
 Gets or sets the value at row 4, column 1 of this instance. More...
 
float M42 [get, set]
 Gets or sets the value at row 4, column 2 of this instance. More...
 
float M43 [get, set]
 Gets or sets the value at row 4, column 3 of this instance. More...
 
float M44 [get, set]
 Gets or sets the value at row 4, column 4 of this instance. More...
 
Vector4 Diagonal [get, set]
 Gets or sets the values along the main diagonal of the matrix. More...
 
float Trace [get]
 Gets the trace of the matrix, the sum of the values along the diagonal. More...
 
float this[int rowIndex, int columnIndex] [get, set]
 Gets or sets the value at a specified row and column. More...
 

Detailed Description

Represents a 4x4 matrix containing 3D rotation, scale, transform, and projection.

See Also
Matrix4d

Constructor & Destructor Documentation

makVrl.Matrix4.Matrix4 ( Vector4  row0,
Vector4  row1,
Vector4  row2,
Vector4  row3 
)
inline

Constructs a new instance.

Parameters
row0Top row of the matrix.
row1Second row of the matrix.
row2Third row of the matrix.
row3Bottom row of the matrix.

References makVrl.Matrix4.Row0, makVrl.Matrix4.Row1, makVrl.Matrix4.Row2, and makVrl.Matrix4.Row3.

Referenced by makVrl.Matrix4.Equals(), makVrl.Matrix4.Frustum(), and makVrl.Matrix4.Transpose().

makVrl.Matrix4.Matrix4 ( float  m00,
float  m01,
float  m02,
float  m03,
float  m10,
float  m11,
float  m12,
float  m13,
float  m20,
float  m21,
float  m22,
float  m23,
float  m30,
float  m31,
float  m32,
float  m33 
)
inline

Constructs a new instance.

Parameters
m00First item of the first row of the matrix.
m01Second item of the first row of the matrix.
m02Third item of the first row of the matrix.
m03Fourth item of the first row of the matrix.
m10First item of the second row of the matrix.
m11Second item of the second row of the matrix.
m12Third item of the second row of the matrix.
m13Fourth item of the second row of the matrix.
m20First item of the third row of the matrix.
m21Second item of the third row of the matrix.
m22Third item of the third row of the matrix.
m23First item of the third row of the matrix.
m30Fourth item of the fourth row of the matrix.
m31Second item of the fourth row of the matrix.
m32Third item of the fourth row of the matrix.
m33Fourth item of the fourth row of the matrix.

References makVrl.Matrix4.Row0, makVrl.Matrix4.Row1, makVrl.Matrix4.Row2, and makVrl.Matrix4.Row3.

Member Function Documentation

static Matrix4 makVrl.Matrix4.Add ( Matrix4  left,
Matrix4  right 
)
inlinestatic

Adds two instances.

Parameters
leftThe left operand of the addition.
rightThe right operand of the addition.
Returns
A new instance that is the result of the addition.
static void makVrl.Matrix4.Add ( ref Matrix4  left,
ref Matrix4  right,
out Matrix4  result 
)
inlinestatic

Adds two instances.

Parameters
leftThe left operand of the addition.
rightThe right operand of the addition.
resultA new instance that is the result of the addition.
Matrix4 makVrl.Matrix4.ClearProjection ( )
inline

Returns a copy of this Matrix4 without projection.

References makVrl.Vector4.Zero.

Matrix4 makVrl.Matrix4.ClearRotation ( )
inline
Matrix4 makVrl.Matrix4.ClearScale ( )
inline

Returns a copy of this Matrix4 without scale.

Matrix4 makVrl.Matrix4.ClearTranslation ( )
inline

Returns a copy of this Matrix4 without translation.

References makVrl.Vector3f.Zero.

static void makVrl.Matrix4.CreateFromAxisAngle ( Vector3f  axis,
float  angle,
out Matrix4  result 
)
inlinestatic

Build a rotation matrix from the specified axis/angle rotation.

Parameters
axisThe axis to rotate about.
angleAngle in radians to rotate counter-clockwise (looking in the direction of the given axis).
resultA matrix instance.

References makVrl.Vector4.UnitW.

Referenced by makVrl.Matrix4.CreateFromAxisAngle(), makVrl.Matrix4.CreateFromQuaternion(), and makVrl.Matrix4.Rotate().

static Matrix4 makVrl.Matrix4.CreateFromAxisAngle ( Vector3f  axis,
float  angle 
)
inlinestatic

Build a rotation matrix from the specified axis/angle rotation.

Parameters
axisThe axis to rotate about.
angleAngle in radians to rotate counter-clockwise (looking in the direction of the given axis).
Returns
A matrix instance.

References makVrl.Matrix4.CreateFromAxisAngle().

static void makVrl.Matrix4.CreateFromQuaternion ( ref Quaternion  q,
out Matrix4  result 
)
inlinestatic

Builds a rotation matrix from a quaternion.

Parameters
qThe quaternion to rotate by.
resultA matrix instance.

References makVrl.Matrix4.CreateFromAxisAngle().

Referenced by makVrl.Matrix4.CreateFromQuaternion(), and makVrl.Matrix4.Rotate().

static Matrix4 makVrl.Matrix4.CreateFromQuaternion ( Quaternion  q)
inlinestatic

Builds a rotation matrix from a quaternion.

Parameters
qThe quaternion to rotate by.
Returns
A matrix instance.

References makVrl.Matrix4.CreateFromQuaternion().

static void makVrl.Matrix4.CreateOrthographic ( float  width,
float  height,
float  zNear,
float  zFar,
out Matrix4  result 
)
inlinestatic

Creates an orthographic projection matrix.

Parameters
widthThe width of the projection volume.
heightThe height of the projection volume.
zNearThe near edge of the projection volume.
zFarThe far edge of the projection volume.
resultThe resulting Matrix4 instance.

References makVrl.Matrix4.CreateOrthographicOffCenter().

static Matrix4 makVrl.Matrix4.CreateOrthographic ( float  width,
float  height,
float  zNear,
float  zFar 
)
inlinestatic

Creates an orthographic projection matrix.

Parameters
widthThe width of the projection volume.
heightThe height of the projection volume.
zNearThe near edge of the projection volume.
zFarThe far edge of the projection volume.

<rereturns>The resulting Matrix4 instance.</rereturns>

References makVrl.Matrix4.CreateOrthographicOffCenter().

static void makVrl.Matrix4.CreateOrthographicOffCenter ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar,
out Matrix4  result 
)
inlinestatic

Creates an orthographic projection matrix.

Parameters
leftThe left edge of the projection volume.
rightThe right edge of the projection volume.
bottomThe bottom edge of the projection volume.
topThe top edge of the projection volume.
zNearThe near edge of the projection volume.
zFarThe far edge of the projection volume.
resultThe resulting Matrix4 instance.

References makVrl.Matrix4.Identity.

Referenced by makVrl.Matrix4.CreateOrthographic(), and makVrl.Matrix4.CreateOrthographicOffCenter().

static Matrix4 makVrl.Matrix4.CreateOrthographicOffCenter ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)
inlinestatic

Creates an orthographic projection matrix.

Parameters
leftThe left edge of the projection volume.
rightThe right edge of the projection volume.
bottomThe bottom edge of the projection volume.
topThe top edge of the projection volume.
zNearThe near edge of the projection volume.
zFarThe far edge of the projection volume.
Returns
The resulting Matrix4 instance.

References makVrl.Matrix4.CreateOrthographicOffCenter().

static void makVrl.Matrix4.CreatePerspectiveFieldOfView ( float  fovy,
float  aspect,
float  zNear,
float  zFar,
out Matrix4  result 
)
inlinestatic

Creates a perspective projection matrix.

Parameters
fovyAngle of the field of view in the y direction (in radians)
aspectAspect ratio of the view (width / height)
zNearDistance to the near clip plane
zFarDistance to the far clip plane
resultA projection matrix that transforms camera space to raster space
Exceptions
System.ArgumentOutOfRangeExceptionThrown under the following conditions:
  • fovy is zero, less than zero or larger than Math.PI
  • aspect is negative or zero
  • zNear is negative or zero
  • zFar is negative or zero
  • zNear is larger than zFar

References makVrl.Matrix4.CreatePerspectiveOffCenter().

Referenced by makVrl.Matrix4.CreatePerspectiveFieldOfView().

static Matrix4 makVrl.Matrix4.CreatePerspectiveFieldOfView ( float  fovy,
float  aspect,
float  zNear,
float  zFar 
)
inlinestatic

Creates a perspective projection matrix.

Parameters
fovyAngle of the field of view in the y direction (in radians)
aspectAspect ratio of the view (width / height)
zNearDistance to the near clip plane
zFarDistance to the far clip plane
Returns
A projection matrix that transforms camera space to raster space
Exceptions
System.ArgumentOutOfRangeExceptionThrown under the following conditions:
  • fovy is zero, less than zero or larger than Math.PI
  • aspect is negative or zero
  • zNear is negative or zero
  • zFar is negative or zero
  • zNear is larger than zFar

References makVrl.Matrix4.CreatePerspectiveFieldOfView().

static void makVrl.Matrix4.CreatePerspectiveOffCenter ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar,
out Matrix4  result 
)
inlinestatic

Creates an perspective projection matrix.

Parameters
leftLeft edge of the view frustum
rightRight edge of the view frustum
bottomBottom edge of the view frustum
topTop edge of the view frustum
zNearDistance to the near clip plane
zFarDistance to the far clip plane
resultA projection matrix that transforms camera space to raster space
Exceptions
System.ArgumentOutOfRangeExceptionThrown under the following conditions:
  • zNear is negative or zero
  • zFar is negative or zero
  • zNear is larger than zFar

Referenced by makVrl.Matrix4.CreatePerspectiveFieldOfView(), and makVrl.Matrix4.CreatePerspectiveOffCenter().

static Matrix4 makVrl.Matrix4.CreatePerspectiveOffCenter ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)
inlinestatic

Creates an perspective projection matrix.

Parameters
leftLeft edge of the view frustum
rightRight edge of the view frustum
bottomBottom edge of the view frustum
topTop edge of the view frustum
zNearDistance to the near clip plane
zFarDistance to the far clip plane
Returns
A projection matrix that transforms camera space to raster space
Exceptions
System.ArgumentOutOfRangeExceptionThrown under the following conditions:
  • zNear is negative or zero
  • zFar is negative or zero
  • zNear is larger than zFar

References makVrl.Matrix4.CreatePerspectiveOffCenter().

static void makVrl.Matrix4.CreateRotationX ( float  angle,
out Matrix4  result 
)
inlinestatic

Builds a rotation matrix for a rotation around the x-axis.

Parameters
angleThe counter-clockwise angle in radians.
resultThe resulting Matrix4 instance.

References makVrl.Matrix4.Identity.

Referenced by makVrl.Matrix4.CreateRotationX(), and makVrl.Matrix4.RotateX().

static Matrix4 makVrl.Matrix4.CreateRotationX ( float  angle)
inlinestatic

Builds a rotation matrix for a rotation around the x-axis.

Parameters
angleThe counter-clockwise angle in radians.
Returns
The resulting Matrix4 instance.

References makVrl.Matrix4.CreateRotationX().

static void makVrl.Matrix4.CreateRotationY ( float  angle,
out Matrix4  result 
)
inlinestatic

Builds a rotation matrix for a rotation around the y-axis.

Parameters
angleThe counter-clockwise angle in radians.
resultThe resulting Matrix4 instance.

References makVrl.Matrix4.Identity.

Referenced by makVrl.Matrix4.CreateRotationY(), and makVrl.Matrix4.RotateY().

static Matrix4 makVrl.Matrix4.CreateRotationY ( float  angle)
inlinestatic

Builds a rotation matrix for a rotation around the y-axis.

Parameters
angleThe counter-clockwise angle in radians.
Returns
The resulting Matrix4 instance.

References makVrl.Matrix4.CreateRotationY().

static void makVrl.Matrix4.CreateRotationZ ( float  angle,
out Matrix4  result 
)
inlinestatic

Builds a rotation matrix for a rotation around the z-axis.

Parameters
angleThe counter-clockwise angle in radians.
resultThe resulting Matrix4 instance.

References makVrl.Matrix4.Identity.

Referenced by makVrl.Matrix4.CreateRotationZ(), and makVrl.Matrix4.RotateZ().

static Matrix4 makVrl.Matrix4.CreateRotationZ ( float  angle)
inlinestatic

Builds a rotation matrix for a rotation around the z-axis.

Parameters
angleThe counter-clockwise angle in radians.
Returns
The resulting Matrix4 instance.

References makVrl.Matrix4.CreateRotationZ().

static Matrix4 makVrl.Matrix4.CreateScale ( float  scale)
inlinestatic

Creates a scale matrix.

Parameters
scaleSingle scale factor for the x, y, and z axes.
Returns
A scale matrix.

Referenced by makVrl.Matrix4.CreateScale().

static Matrix4 makVrl.Matrix4.CreateScale ( Vector3f  scale)
inlinestatic

Creates a scale matrix.

Parameters
scaleScale factors for the x, y, and z axes.
Returns
A scale matrix.

References makVrl.Matrix4.CreateScale().

static Matrix4 makVrl.Matrix4.CreateScale ( float  x,
float  y,
float  z 
)
inlinestatic

Creates a scale matrix.

Parameters
xScale factor for the x axis.
yScale factor for the y axis.
zScale factor for the z axis.
Returns
A scale matrix.

References makVrl.Matrix4.CreateScale().

static void makVrl.Matrix4.CreateScale ( float  scale,
out Matrix4  result 
)
inlinestatic

Creates a scale matrix.

Parameters
scaleSingle scale factor for the x, y, and z axes.
resultA scale matrix.

References makVrl.Matrix4.Identity.

static void makVrl.Matrix4.CreateScale ( ref Vector3f  scale,
out Matrix4  result 
)
inlinestatic

Creates a scale matrix.

Parameters
scaleScale factors for the x, y, and z axes.
resultA scale matrix.

References makVrl.Matrix4.Identity.

static void makVrl.Matrix4.CreateScale ( float  x,
float  y,
float  z,
out Matrix4  result 
)
inlinestatic

Creates a scale matrix.

Parameters
xScale factor for the x axis.
yScale factor for the y axis.
zScale factor for the z axis.
resultA scale matrix.

References makVrl.Matrix4.Identity.

static void makVrl.Matrix4.CreateTranslation ( float  x,
float  y,
float  z,
out Matrix4  result 
)
inlinestatic

Creates a translation matrix.

Parameters
xX translation.
yY translation.
zZ translation.
resultThe resulting Matrix4 instance.

References makVrl.Matrix4.Identity.

Referenced by makVrl.Matrix4.CreateTranslation(), and makVrl.Matrix4.Translation().

static void makVrl.Matrix4.CreateTranslation ( ref Vector3f  vector,
out Matrix4  result 
)
inlinestatic

Creates a translation matrix.

Parameters
vectorThe translation vector.
resultThe resulting Matrix4 instance.

References makVrl.Matrix4.Identity.

static Matrix4 makVrl.Matrix4.CreateTranslation ( float  x,
float  y,
float  z 
)
inlinestatic

Creates a translation matrix.

Parameters
xX translation.
yY translation.
zZ translation.
Returns
The resulting Matrix4 instance.

References makVrl.Matrix4.CreateTranslation().

static Matrix4 makVrl.Matrix4.CreateTranslation ( Vector3f  vector)
inlinestatic

Creates a translation matrix.

Parameters
vectorThe translation vector.
Returns
The resulting Matrix4 instance.

References makVrl.Matrix4.CreateTranslation(), makVrl.Vector3f.X, makVrl.Vector3f.Y, and makVrl.Vector3f.Z.

override bool makVrl.Matrix4.Equals ( object  obj)
inline

Indicates whether this instance and a specified object are equal.

Parameters
objThe object to compare tresult.
Returns
True if the instances are equal; false otherwise.

References makVrl.Matrix4.Matrix4().

bool makVrl.Matrix4.Equals ( Matrix4  other)
inline

Indicates whether the current matrix is equal to another matrix.

Parameters
otherAn matrix to compare with this matrix.
Returns
true if the current matrix is equal to the matrix parameter; otherwise, false.

References makVrl.Matrix4.Row0, makVrl.Matrix4.Row1, makVrl.Matrix4.Row2, and makVrl.Matrix4.Row3.

Vector4 makVrl.Matrix4.ExtractProjection ( )
inline

Returns the projection component of this instance.

References makVrl.Matrix4.Column3.

Quaternion makVrl.Matrix4.ExtractRotation ( bool  row_normalise = true)
inline

Returns the rotation component of this instance.

Quite slow.

Parameters
row_normaliseWhether the method should row-normalise (i.e. remove scale from) the Matrix. Pass false if you know it's already normalised.
Vector3f makVrl.Matrix4.ExtractScale ( )
inline

Returns the scale component of this instance.

References makVrl.Vector3f.Length, makVrl.Matrix4.Row0, makVrl.Matrix4.Row1, makVrl.Matrix4.Row2, and makVrl.Vector4.Xyz.

Vector3f makVrl.Matrix4.ExtractTranslation ( )
inline

Returns the translation component of this instance.

static Matrix4 makVrl.Matrix4.Frustum ( float  left,
float  right,
float  bottom,
float  top,
float  near,
float  far 
)
inlinestatic

Build a projection matrix

Parameters
leftLeft edge of the view frustum
rightRight edge of the view frustum
bottomBottom edge of the view frustum
topTop edge of the view frustum
nearDistance to the near clip plane
farDistance to the far clip plane
Returns
A projection matrix that transforms camera space to raster space

References makVrl.Matrix4.Matrix4().

Referenced by makVrl.Matrix4.Perspective().

override int makVrl.Matrix4.GetHashCode ( )
inline

Returns the hashcode for this instance.

Returns
A System.Int32 containing the unique hashcode for this instance.

References makVrl.Vector4.GetHashCode(), makVrl.Matrix4.Row1, and makVrl.Matrix4.Row3.

void makVrl.Matrix4.Invert ( )
inline

Converts this instance into its inverse.

Referenced by makVrl.Matrix4.Invert().

static void makVrl.Matrix4.Invert ( ref Matrix4  mat,
out Matrix4  result 
)
inlinestatic

Calculate the inverse of the given matrix

Parameters
matThe matrix to invert
resultThe inverse of the given matrix if it has one, or the input if it is singular
Exceptions
InvalidOperationExceptionThrown if the Matrix4 is singular.
static Matrix4 makVrl.Matrix4.Invert ( Matrix4  mat)
inlinestatic

Calculate the inverse of the given matrix

Parameters
matThe matrix to invert
Returns
The inverse of the given matrix if it has one, or the input if it is singular
Exceptions
InvalidOperationExceptionThrown if the Matrix4 is singular.

References makVrl.Matrix4.Invert().

Matrix4 makVrl.Matrix4.Inverted ( )
inline

Returns an inverted copy of this instance.

References makVrl.Matrix4.Determinant.

static Matrix4 makVrl.Matrix4.LookAt ( Vector3f  eye,
Vector3f  target,
Vector3f  up 
)
inlinestatic

Build a world space to camera space matrix

Parameters
eyeEye (camera) position in world space
targetTarget position in world space
upUp vector in world space (should not be parallel to the camera direction, that is target - eye)
Returns
A Matrix4 that transforms world space to camera space

References makVrl.Vector3f.Y.

Referenced by makVrl.Matrix4.LookAt().

static Matrix4 makVrl.Matrix4.LookAt ( float  eyeX,
float  eyeY,
float  eyeZ,
float  targetX,
float  targetY,
float  targetZ,
float  upX,
float  upY,
float  upZ 
)
inlinestatic

Build a world space to camera space matrix

Parameters
eyeXEye (camera) position in world space
eyeYEye (camera) position in world space
eyeZEye (camera) position in world space
targetXTarget position in world space
targetYTarget position in world space
targetZTarget position in world space
upXUp vector in world space (should not be parallel to the camera direction, that is target - eye)
upYUp vector in world space (should not be parallel to the camera direction, that is target - eye)
upZUp vector in world space (should not be parallel to the camera direction, that is target - eye)
Returns
A Matrix4 that transforms world space to camera space

References makVrl.Matrix4.LookAt().

static Matrix4 makVrl.Matrix4.Mult ( Matrix4  left,
Matrix4  right 
)
inlinestatic

Multiplies two instances.

Parameters
leftThe left operand of the multiplication.
rightThe right operand of the multiplication.
Returns
A new instance that is the result of the multiplication.

Referenced by makVrl.Matrix4.Mult().

static void makVrl.Matrix4.Mult ( ref Matrix4  left,
ref Matrix4  right,
out Matrix4  result 
)
inlinestatic

Multiplies two instances.

Parameters
leftThe left operand of the multiplication.
rightThe right operand of the multiplication.
resultA new instance that is the result of the multiplication.
static Matrix4 makVrl.Matrix4.Mult ( Matrix4  left,
float  right 
)
inlinestatic

Multiplies an instance by a scalar.

Parameters
leftThe left operand of the multiplication.
rightThe right operand of the multiplication.
Returns
A new instance that is the result of the multiplication

References makVrl.Matrix4.Mult().

static void makVrl.Matrix4.Mult ( ref Matrix4  left,
float  right,
out Matrix4  result 
)
inlinestatic

Multiplies an instance by a scalar.

Parameters
leftThe left operand of the multiplication.
rightThe right operand of the multiplication.
resultA new instance that is the result of the multiplication
void makVrl.Matrix4.Normalize ( )
inline

Divides each element in the Matrix by the Determinant.

References makVrl.Matrix4.Row0, makVrl.Matrix4.Row1, makVrl.Matrix4.Row2, and makVrl.Matrix4.Row3.

Matrix4 makVrl.Matrix4.Normalized ( )
inline

Returns a normalised copy of this instance.

static bool makVrl.Matrix4.operator!= ( Matrix4  left,
Matrix4  right 
)
inlinestatic

Compares two instances for inequality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left does not equal right; false otherwise.
static Matrix4 makVrl.Matrix4.operator* ( Matrix4  left,
Matrix4  right 
)
inlinestatic

Matrix multiplication

Parameters
leftleft-hand operand
rightright-hand operand
Returns
A new Matrix4 which holds the result of the multiplication
static Matrix4 makVrl.Matrix4.operator* ( Matrix4  left,
float  right 
)
inlinestatic

Matrix-scalar multiplication

Parameters
leftleft-hand operand
rightright-hand operand
Returns
A new Matrix4 which holds the result of the multiplication
static Matrix4 makVrl.Matrix4.operator+ ( Matrix4  left,
Matrix4  right 
)
inlinestatic

Matrix addition

Parameters
leftleft-hand operand
rightright-hand operand
Returns
A new Matrix4 which holds the result of the addition
static Matrix4 makVrl.Matrix4.operator- ( Matrix4  left,
Matrix4  right 
)
inlinestatic

Matrix subtraction

Parameters
leftleft-hand operand
rightright-hand operand
Returns
A new Matrix4 which holds the result of the subtraction
static bool makVrl.Matrix4.operator== ( Matrix4  left,
Matrix4  right 
)
inlinestatic

Compares two instances for equality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left equals right; false otherwise.
static Matrix4 makVrl.Matrix4.Perspective ( float  fovy,
float  aspect,
float  near,
float  far 
)
inlinestatic

Build a projection matrix

Parameters
fovyAngle of the field of view in the y direction (in radians)
aspectAspect ratio of the view (width / height)
nearDistance to the near clip plane
farDistance to the far clip plane
Returns
A projection matrix that transforms camera space to raster space

References makVrl.Matrix4.Frustum().

static Matrix4 makVrl.Matrix4.Rotate ( Vector3f  axis,
float  angle 
)
inlinestatic

Build a rotation matrix to rotate about the given axis

Parameters
axisthe axis to rotate about
angleangle in radians to rotate counter-clockwise (looking in the direction of the given axis)
Returns
A rotation matrix

References makVrl.Matrix4.CreateFromAxisAngle().

static Matrix4 makVrl.Matrix4.Rotate ( Quaternion  q)
inlinestatic

Build a rotation matrix from a quaternion

Parameters
qthe quaternion
Returns
A rotation matrix

References makVrl.Matrix4.CreateFromQuaternion().

static Matrix4 makVrl.Matrix4.RotateX ( float  angle)
inlinestatic

Build a rotation matrix that rotates about the x-axis

Parameters
angleangle in radians to rotate counter-clockwise around the x-axis
Returns
A rotation matrix

References makVrl.Matrix4.CreateRotationX().

static Matrix4 makVrl.Matrix4.RotateY ( float  angle)
inlinestatic

Build a rotation matrix that rotates about the y-axis

Parameters
angleangle in radians to rotate counter-clockwise around the y-axis
Returns
A rotation matrix

References makVrl.Matrix4.CreateRotationY().

static Matrix4 makVrl.Matrix4.RotateZ ( float  angle)
inlinestatic

Build a rotation matrix that rotates about the z-axis

Parameters
angleangle in radians to rotate counter-clockwise around the z-axis
Returns
A rotation matrix

References makVrl.Matrix4.CreateRotationZ().

static Matrix4 makVrl.Matrix4.Scale ( float  scale)
inlinestatic

Build a scaling matrix

Parameters
scaleSingle scale factor for x,y and z axes
Returns
A scaling matrix

Referenced by makVrl.Matrix4.Scale().

static Matrix4 makVrl.Matrix4.Scale ( Vector3f  scale)
inlinestatic

Build a scaling matrix

Parameters
scaleScale factors for x,y and z axes
Returns
A scaling matrix

References makVrl.Matrix4.Scale(), makVrl.Vector3f.X, makVrl.Vector3f.Y, and makVrl.Vector3f.Z.

static Matrix4 makVrl.Matrix4.Scale ( float  x,
float  y,
float  z 
)
inlinestatic

Build a scaling matrix

Parameters
xScale factor for x-axis
yScale factor for y-axis
zScale factor for z-axis
Returns
A scaling matrix

References makVrl.Vector4.UnitW.

static Matrix4 makVrl.Matrix4.Subtract ( Matrix4  left,
Matrix4  right 
)
inlinestatic

Subtracts one instance from another.

Parameters
leftThe left operand of the subraction.
rightThe right operand of the subraction.
Returns
A new instance that is the result of the subraction.
static void makVrl.Matrix4.Subtract ( ref Matrix4  left,
ref Matrix4  right,
out Matrix4  result 
)
inlinestatic

Subtracts one instance from another.

Parameters
leftThe left operand of the subraction.
rightThe right operand of the subraction.
resultA new instance that is the result of the subraction.
override string makVrl.Matrix4.ToString ( )
inline

Returns a System.String that represents the current Matrix4.

Returns
The string representation of the matrix.

References makVrl.Matrix4.Row0, makVrl.Matrix4.Row1, makVrl.Matrix4.Row2, and makVrl.Matrix4.Row3.

static Matrix4 makVrl.Matrix4.Translation ( Vector3f  trans)
inlinestatic

Builds a translation matrix.

Parameters
transThe translation vector.
Returns
A new Matrix4 instance.

References makVrl.Matrix4.CreateTranslation().

static Matrix4 makVrl.Matrix4.Translation ( float  x,
float  y,
float  z 
)
inlinestatic

Build a translation matrix with the given translation

Parameters
xX translation
yY translation
zZ translation
Returns
A Translation matrix

References makVrl.Matrix4.CreateTranslation().

void makVrl.Matrix4.Transpose ( )
inline

Converts this instance into its transpose.

static Matrix4 makVrl.Matrix4.Transpose ( Matrix4  mat)
inlinestatic

Calculate the transpose of the given matrix

Parameters
matThe matrix to transpose
Returns
The transpose of the given matrix

References makVrl.Matrix4.Column0, makVrl.Matrix4.Column1, makVrl.Matrix4.Column2, makVrl.Matrix4.Column3, and makVrl.Matrix4.Matrix4().

static void makVrl.Matrix4.Transpose ( ref Matrix4  mat,
out Matrix4  result 
)
inlinestatic

Calculate the transpose of the given matrix

Parameters
matThe matrix to transpose
resultThe result of the calculation

Member Data Documentation

readonly Matrix4 makVrl.Matrix4.Identity = new Matrix4(Vector4.UnitX, Vector4.UnitY, Vector4.UnitZ, Vector4.UnitW)
static
Vector4 makVrl.Matrix4.Row0
Vector4 makVrl.Matrix4.Row1
Vector4 makVrl.Matrix4.Row2
Vector4 makVrl.Matrix4.Row3
readonly Matrix4 makVrl.Matrix4.Zero = new Matrix4(Vector4.Zero, Vector4.Zero, Vector4.Zero, Vector4.Zero)
static

The zero matrix.

Property Documentation

Vector4 makVrl.Matrix4.Column0
getset

Gets the first column of this matrix.

Referenced by makVrl.Vector3f.TransformPosition(), makVrl.Vector3f.TransformVector(), and makVrl.Matrix4.Transpose().

Vector4 makVrl.Matrix4.Column1
getset

Gets the second column of this matrix.

Referenced by makVrl.Vector3f.TransformPosition(), makVrl.Vector3f.TransformVector(), and makVrl.Matrix4.Transpose().

Vector4 makVrl.Matrix4.Column2
getset

Gets the third column of this matrix.

Referenced by makVrl.Vector3f.TransformPosition(), makVrl.Vector3f.TransformVector(), and makVrl.Matrix4.Transpose().

Vector4 makVrl.Matrix4.Column3
getset

Gets the fourth column of this matrix.

Referenced by makVrl.Matrix4.ExtractProjection(), and makVrl.Matrix4.Transpose().

float makVrl.Matrix4.Determinant
get

Gets the determinant of this matrix.

Referenced by makVrl.Matrix4.Inverted().

Vector4 makVrl.Matrix4.Diagonal
getset

Gets or sets the values along the main diagonal of the matrix.

float makVrl.Matrix4.M11
getset

Gets or sets the value at row 1, column 1 of this instance.

float makVrl.Matrix4.M12
getset

Gets or sets the value at row 1, column 2 of this instance.

float makVrl.Matrix4.M13
getset

Gets or sets the value at row 1, column 3 of this instance.

float makVrl.Matrix4.M14
getset

Gets or sets the value at row 1, column 4 of this instance.

float makVrl.Matrix4.M21
getset

Gets or sets the value at row 2, column 1 of this instance.

float makVrl.Matrix4.M22
getset

Gets or sets the value at row 2, column 2 of this instance.

float makVrl.Matrix4.M23
getset

Gets or sets the value at row 2, column 3 of this instance.

float makVrl.Matrix4.M24
getset

Gets or sets the value at row 2, column 4 of this instance.

float makVrl.Matrix4.M31
getset

Gets or sets the value at row 3, column 1 of this instance.

float makVrl.Matrix4.M32
getset

Gets or sets the value at row 3, column 2 of this instance.

float makVrl.Matrix4.M33
getset

Gets or sets the value at row 3, column 3 of this instance.

float makVrl.Matrix4.M34
getset

Gets or sets the value at row 3, column 4 of this instance.

float makVrl.Matrix4.M41
getset

Gets or sets the value at row 4, column 1 of this instance.

float makVrl.Matrix4.M42
getset

Gets or sets the value at row 4, column 2 of this instance.

float makVrl.Matrix4.M43
getset

Gets or sets the value at row 4, column 3 of this instance.

float makVrl.Matrix4.M44
getset

Gets or sets the value at row 4, column 4 of this instance.

float makVrl.Matrix4.this[int rowIndex, int columnIndex]
getset

Gets or sets the value at a specified row and column.

float makVrl.Matrix4.Trace
get

Gets the trace of the matrix, the sum of the values along the diagonal.


The documentation for this struct was generated from the following file:

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)