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.Matrix3 Struct Reference

Represents a 3x3 matrix containing 3D rotation and scale. More...

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

Public Member Functions

 Matrix3 (Vector3f row0, Vector3f row1, Vector3f row2)
 Constructs a new instance. More...
 
 Matrix3 (float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
 Constructs a new instance. More...
 
 Matrix3 (Matrix4 matrix)
 Constructs a new instance. More...
 
void Invert ()
 Converts this instance into its inverse. More...
 
void Transpose ()
 Converts this instance into its transpose. More...
 
Matrix3 Normalized ()
 Returns a normalised copy of this instance. More...
 
void Normalize ()
 Divides each element in the Matrix by the Determinant. More...
 
Matrix3 Inverted ()
 Returns an inverted copy of this instance. More...
 
Matrix3 ClearScale ()
 Returns a copy of this Matrix3 without scale. More...
 
Matrix3 ClearRotation ()
 Returns a copy of this Matrix3 without rotation. 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...
 
override string ToString ()
 Returns a System.String that represents the current Matrix3d. 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 (Matrix3 other)
 Indicates whether the current matrix is equal to another matrix. More...
 

Static Public Member Functions

static void CreateFromAxisAngle (Vector3f axis, float angle, out Matrix3 result)
 Build a rotation matrix from the specified axis/angle rotation. More...
 
static Matrix3 CreateFromAxisAngle (Vector3f axis, float angle)
 Build a rotation matrix from the specified axis/angle rotation. More...
 
static void CreateFromQuaternion (ref Quaternion q, out Matrix3 result)
 Build a rotation matrix from the specified quaternion. More...
 
static Matrix3 CreateFromQuaternion (Quaternion q)
 Build a rotation matrix from the specified quaternion. More...
 
static void CreateRotationX (float angle, out Matrix3 result)
 Builds a rotation matrix for a rotation around the x-axis. More...
 
static Matrix3 CreateRotationX (float angle)
 Builds a rotation matrix for a rotation around the x-axis. More...
 
static void CreateRotationY (float angle, out Matrix3 result)
 Builds a rotation matrix for a rotation around the y-axis. More...
 
static Matrix3 CreateRotationY (float angle)
 Builds a rotation matrix for a rotation around the y-axis. More...
 
static void CreateRotationZ (float angle, out Matrix3 result)
 Builds a rotation matrix for a rotation around the z-axis. More...
 
static Matrix3 CreateRotationZ (float angle)
 Builds a rotation matrix for a rotation around the z-axis. More...
 
static Matrix3 CreateScale (float scale)
 Creates a scale matrix. More...
 
static Matrix3 CreateScale (Vector3f scale)
 Creates a scale matrix. More...
 
static Matrix3 CreateScale (float x, float y, float z)
 Creates a scale matrix. More...
 
static void CreateScale (float scale, out Matrix3 result)
 Creates a scale matrix. More...
 
static void CreateScale (ref Vector3f scale, out Matrix3 result)
 Creates a scale matrix. More...
 
static void CreateScale (float x, float y, float z, out Matrix3 result)
 Creates a scale matrix. More...
 
static Matrix3 Mult (Matrix3 left, Matrix3 right)
 Multiplies two instances. More...
 
static void Mult (ref Matrix3 left, ref Matrix3 right, out Matrix3 result)
 Multiplies two instances. More...
 
static void Invert (ref Matrix3 mat, out Matrix3 result)
 Calculate the inverse of the given matrix More...
 
static Matrix3 Invert (Matrix3 mat)
 Calculate the inverse of the given matrix More...
 
static Matrix3 Transpose (Matrix3 mat)
 Calculate the transpose of the given matrix More...
 
static void Transpose (ref Matrix3 mat, out Matrix3 result)
 Calculate the transpose of the given matrix More...
 
static Matrix3 operator* (Matrix3 left, Matrix3 right)
 Matrix multiplication More...
 
static bool operator== (Matrix3 left, Matrix3 right)
 Compares two instances for equality. More...
 
static bool operator!= (Matrix3 left, Matrix3 right)
 Compares two instances for inequality. More...
 

Public Attributes

Vector3f Row0
 First row of the matrix. More...
 
Vector3f Row1
 Second row of the matrix. More...
 
Vector3f Row2
 Third row of the matrix. More...
 

Static Public Attributes

static readonly Matrix3 Identity = new Matrix3(Vector3f.UnitX, Vector3f.UnitY, Vector3f.UnitZ)
 The identity matrix. More...
 
static readonly Matrix3 Zero = new Matrix3(Vector3f.Zero, Vector3f.Zero, Vector3f.Zero)
 The zero matrix. More...
 

Properties

float Determinant [get]
 Gets the determinant of this matrix. More...
 
Vector3f Column0 [get]
 Gets the first column of this matrix. More...
 
Vector3f Column1 [get]
 Gets the second column of this matrix. More...
 
Vector3f Column2 [get]
 Gets the third 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 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 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...
 
Vector3f 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 3x3 matrix containing 3D rotation and scale.

Constructor & Destructor Documentation

makVrl.Matrix3.Matrix3 ( Vector3f  row0,
Vector3f  row1,
Vector3f  row2 
)
inline

Constructs a new instance.

Parameters
row0Top row of the matrix
row1Second row of the matrix
row2Bottom row of the matrix

References makVrl.Matrix3.Row0, makVrl.Matrix3.Row1, and makVrl.Matrix3.Row2.

Referenced by makVrl.Matrix3.Equals(), and makVrl.Matrix3.Transpose().

makVrl.Matrix3.Matrix3 ( float  m00,
float  m01,
float  m02,
float  m10,
float  m11,
float  m12,
float  m20,
float  m21,
float  m22 
)
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.
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.
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.

References makVrl.Matrix3.Row0, makVrl.Matrix3.Row1, and makVrl.Matrix3.Row2.

makVrl.Matrix3.Matrix3 ( Matrix4  matrix)
inline

Constructs a new instance.

Parameters
matrixA Matrix4 to take the upper-left 3x3 from.

References makVrl.Matrix3.Row0, makVrl.Matrix3.Row1, and makVrl.Matrix3.Row2.

Member Function Documentation

Matrix3 makVrl.Matrix3.ClearRotation ( )
inline

Returns a copy of this Matrix3 without rotation.

References makVrl.Vector3f.Length, makVrl.Matrix3.Row0, makVrl.Matrix3.Row1, and makVrl.Matrix3.Row2.

Matrix3 makVrl.Matrix3.ClearScale ( )
inline

Returns a copy of this Matrix3 without scale.

static void makVrl.Matrix3.CreateFromAxisAngle ( Vector3f  axis,
float  angle,
out Matrix3  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.

Referenced by makVrl.Matrix3.CreateFromAxisAngle(), and makVrl.Matrix3.CreateFromQuaternion().

static Matrix3 makVrl.Matrix3.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.Matrix3.CreateFromAxisAngle().

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

Build a rotation matrix from the specified quaternion.

Parameters
qQuaternion to translate.
resultMatrix result.

References makVrl.Matrix3.CreateFromAxisAngle().

Referenced by makVrl.Matrix3.CreateFromQuaternion().

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

Build a rotation matrix from the specified quaternion.

Parameters
qQuaternion to translate.
Returns
A matrix instance.

References makVrl.Matrix3.CreateFromQuaternion().

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

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

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

References makVrl.Matrix3.Identity.

Referenced by makVrl.Matrix3.CreateRotationX().

static Matrix3 makVrl.Matrix3.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 Matrix3 instance.

References makVrl.Matrix3.CreateRotationX().

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

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

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

References makVrl.Matrix3.Identity.

Referenced by makVrl.Matrix3.CreateRotationY().

static Matrix3 makVrl.Matrix3.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 Matrix3 instance.

References makVrl.Matrix3.CreateRotationY().

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

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

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

References makVrl.Matrix3.Identity.

Referenced by makVrl.Matrix3.CreateRotationZ().

static Matrix3 makVrl.Matrix3.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 Matrix3 instance.

References makVrl.Matrix3.CreateRotationZ().

static Matrix3 makVrl.Matrix3.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.Matrix3.CreateScale().

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

Creates a scale matrix.

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

References makVrl.Matrix3.CreateScale().

static Matrix3 makVrl.Matrix3.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.Matrix3.CreateScale().

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

Creates a scale matrix.

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

References makVrl.Matrix3.Identity.

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

Creates a scale matrix.

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

References makVrl.Matrix3.Identity.

static void makVrl.Matrix3.CreateScale ( float  x,
float  y,
float  z,
out Matrix3  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.Matrix3.Identity.

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

Indicates whether this instance and a specified object are equal.

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

References makVrl.Matrix3.Matrix3().

bool makVrl.Matrix3.Equals ( Matrix3  other)
inline

Indicates whether the current matrix is equal to another matrix.

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

References makVrl.Matrix3.Row0, makVrl.Matrix3.Row1, and makVrl.Matrix3.Row2.

Quaternion makVrl.Matrix3.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.

References makVrl.Matrix3.Row0, makVrl.Matrix3.Row1, and makVrl.Matrix3.Row2.

Vector3f makVrl.Matrix3.ExtractScale ( )
inline

Returns the scale component of this instance.

References makVrl.Vector3f.Length, makVrl.Matrix3.Row0, makVrl.Matrix3.Row1, and makVrl.Matrix3.Row2.

override int makVrl.Matrix3.GetHashCode ( )
inline

Returns the hashcode for this instance.

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

References makVrl.Vector3f.GetHashCode(), and makVrl.Matrix3.Row1.

void makVrl.Matrix3.Invert ( )
inline

Converts this instance into its inverse.

Referenced by makVrl.Matrix3.Invert().

static void makVrl.Matrix3.Invert ( ref Matrix3  mat,
out Matrix3  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 Matrix3 is singular.
static Matrix3 makVrl.Matrix3.Invert ( Matrix3  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.Matrix3.Invert().

Matrix3 makVrl.Matrix3.Inverted ( )
inline

Returns an inverted copy of this instance.

References makVrl.Matrix3.Determinant.

static Matrix3 makVrl.Matrix3.Mult ( Matrix3  left,
Matrix3  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
static void makVrl.Matrix3.Mult ( ref Matrix3  left,
ref Matrix3  right,
out Matrix3  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
void makVrl.Matrix3.Normalize ( )
inline

Divides each element in the Matrix by the Determinant.

References makVrl.Matrix3.Row0, makVrl.Matrix3.Row1, and makVrl.Matrix3.Row2.

Matrix3 makVrl.Matrix3.Normalized ( )
inline

Returns a normalised copy of this instance.

static bool makVrl.Matrix3.operator!= ( Matrix3  left,
Matrix3  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 Matrix3 makVrl.Matrix3.operator* ( Matrix3  left,
Matrix3  right 
)
inlinestatic

Matrix multiplication

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

Compares two instances for equality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left equals right; false otherwise.
override string makVrl.Matrix3.ToString ( )
inline

Returns a System.String that represents the current Matrix3d.

Returns
The string representation of the matrix.

References makVrl.Matrix3.Row0, makVrl.Matrix3.Row1, and makVrl.Matrix3.Row2.

void makVrl.Matrix3.Transpose ( )
inline

Converts this instance into its transpose.

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

Calculate the transpose of the given matrix

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

References makVrl.Matrix3.Column0, makVrl.Matrix3.Column1, makVrl.Matrix3.Column2, and makVrl.Matrix3.Matrix3().

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

Calculate the transpose of the given matrix

Parameters
matThe matrix to transpose
resultThe result of the calculation

Member Data Documentation

readonly Matrix3 makVrl.Matrix3.Identity = new Matrix3(Vector3f.UnitX, Vector3f.UnitY, Vector3f.UnitZ)
static
Vector3f makVrl.Matrix3.Row0
Vector3f makVrl.Matrix3.Row1
Vector3f makVrl.Matrix3.Row2
readonly Matrix3 makVrl.Matrix3.Zero = new Matrix3(Vector3f.Zero, Vector3f.Zero, Vector3f.Zero)
static

The zero matrix.

Property Documentation

Vector3f makVrl.Matrix3.Column0
get

Gets the first column of this matrix.

Referenced by makVrl.Matrix3.Transpose().

Vector3f makVrl.Matrix3.Column1
get

Gets the second column of this matrix.

Referenced by makVrl.Matrix3.Transpose().

Vector3f makVrl.Matrix3.Column2
get

Gets the third column of this matrix.

Referenced by makVrl.Matrix3.Transpose().

float makVrl.Matrix3.Determinant
get

Gets the determinant of this matrix.

Referenced by makVrl.Matrix3.Inverted().

Vector3f makVrl.Matrix3.Diagonal
getset

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

float makVrl.Matrix3.M11
getset

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

float makVrl.Matrix3.M12
getset

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

float makVrl.Matrix3.M13
getset

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

float makVrl.Matrix3.M21
getset

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

float makVrl.Matrix3.M22
getset

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

float makVrl.Matrix3.M23
getset

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

float makVrl.Matrix3.M31
getset

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

float makVrl.Matrix3.M32
getset

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

float makVrl.Matrix3.M33
getset

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

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

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

float makVrl.Matrix3.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 Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)