The Open Toolkit library  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
OpenTK.Matrix4x3 Struct Reference

Represents a 3x4 matrix. More...

Inherits IEquatable< Matrix4x3 >.

Public Member Functions

 Matrix4x3 (Vector3 row0, Vector3 row1, Vector3 row2, Vector3 row3)
 Constructs a new instance. More...
 
 Matrix4x3 (float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22, float m30, float m31, float m32)
 Constructs a new instance. More...
 
void Invert ()
 Converts this instance into it's inverse by inverting the upper-left 3x3 and replacing Row3. More...
 
override string ToString ()
 Returns a System.String that represents the current Matrix4x3. 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 (Matrix4x3 other)
 Indicates whether the current matrix is equal to another matrix. More...
 

Static Public Member Functions

static void CreateFromAxisAngle (Vector3 axis, float angle, out Matrix4x3 result)
 Build a rotation matrix from the specified axis/angle rotation. More...
 
static Matrix4x3 CreateFromAxisAngle (Vector3 axis, float angle)
 Build a rotation matrix from the specified axis/angle rotation. More...
 
static void CreateFromQuaternion (ref Quaternion q, out Matrix4x3 result)
 Builds a rotation matrix from a quaternion. More...
 
static Matrix4x3 CreateFromQuaternion (Quaternion q)
 Builds a rotation matrix from a quaternion. More...
 
static void CreateRotationX (float angle, out Matrix4x3 result)
 Builds a rotation matrix for a rotation around the x-axis. More...
 
static Matrix4x3 CreateRotationX (float angle)
 Builds a rotation matrix for a rotation around the x-axis. More...
 
static void CreateRotationY (float angle, out Matrix4x3 result)
 Builds a rotation matrix for a rotation around the y-axis. More...
 
static Matrix4x3 CreateRotationY (float angle)
 Builds a rotation matrix for a rotation around the y-axis. More...
 
static void CreateRotationZ (float angle, out Matrix4x3 result)
 Builds a rotation matrix for a rotation around the z-axis. More...
 
static Matrix4x3 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 Matrix4x3 result)
 Creates a translation matrix. More...
 
static void CreateTranslation (ref Vector3 vector, out Matrix4x3 result)
 Creates a translation matrix. More...
 
static Matrix4x3 CreateTranslation (float x, float y, float z)
 Creates a translation matrix. More...
 
static Matrix4x3 CreateTranslation (Vector3 vector)
 Creates a translation matrix. More...
 
static Matrix4x3 CreateScale (float scale)
 Build a scaling matrix More...
 
static Matrix4x3 CreateScale (Vector3 scale)
 Build a scaling matrix More...
 
static Matrix4x3 CreateScale (float x, float y, float z)
 Build a scaling matrix More...
 
static Matrix4 Mult (Matrix4x3 left, Matrix3x4 right)
 This isn't quite a multiply, but the result may be useful in some situations. Multiplies two instances. More...
 
static void Mult (ref Matrix4x3 left, ref Matrix3x4 right, out Matrix4 result)
 This isn't quite a multiply, but the result may be useful in some situations. Multiplies two instances. More...
 
static Matrix4x3 Mult (Matrix4x3 left, Matrix4x3 right)
 Multiplies two instances. More...
 
static void Mult (ref Matrix4x3 left, ref Matrix4x3 right, out Matrix4x3 result)
 This isn't quite a multiply, but the result may be useful in some situations. Multiplies two instances. More...
 
static Matrix4x3 Mult (Matrix4x3 left, float right)
 Multiplies an instance by a scalar. More...
 
static void Mult (ref Matrix4x3 left, float right, out Matrix4x3 result)
 Multiplies an instance by a scalar. More...
 
static Matrix4x3 Add (Matrix4x3 left, Matrix4x3 right)
 Adds two instances. More...
 
static void Add (ref Matrix4x3 left, ref Matrix4x3 right, out Matrix4x3 result)
 Adds two instances. More...
 
static Matrix4x3 Subtract (Matrix4x3 left, Matrix4x3 right)
 Subtracts one instance from another. More...
 
static void Subtract (ref Matrix4x3 left, ref Matrix4x3 right, out Matrix4x3 result)
 Subtracts one instance from another. More...
 
static Matrix4x3 Invert (Matrix4x3 mat)
 Calculate the inverse of the given matrix More...
 
static void Invert (ref Matrix4x3 mat, out Matrix4x3 result)
 Calculate the inverse of the given matrix More...
 
static Matrix3x4 Transpose (Matrix4x3 mat)
 Calculate the transpose of the given matrix More...
 
static void Transpose (ref Matrix4x3 mat, out Matrix3x4 result)
 Calculate the transpose of the given matrix More...
 
static Matrix4 operator* (Matrix4x3 left, Matrix3x4 right)
 Matrix multiplication More...
 
static Matrix4x3 operator* (Matrix4x3 left, Matrix4x3 right)
 Matrix multiplication More...
 
static Matrix4x3 operator* (Matrix4x3 left, float right)
 Matrix-scalar multiplication More...
 
static Matrix4x3 operator+ (Matrix4x3 left, Matrix4x3 right)
 Matrix addition More...
 
static Matrix4x3 operator- (Matrix4x3 left, Matrix4x3 right)
 Matrix subtraction More...
 
static bool operator== (Matrix4x3 left, Matrix4x3 right)
 Compares two instances for equality. More...
 
static bool operator!= (Matrix4x3 left, Matrix4x3 right)
 Compares two instances for inequality. More...
 

Public Attributes

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

Static Public Attributes

static readonly Matrix4x3 Zero = new Matrix4x3(Vector3.Zero, Vector3.Zero, Vector3.Zero, Vector3.Zero)
 The zero matrix More...
 

Properties

Vector4 Column0 [get]
 Gets the first column of this matrix. More...
 
Vector4 Column1 [get]
 Gets the second column of this matrix. More...
 
Vector4 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...
 
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...
 
Vector3 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 3x4 matrix.

Constructor & Destructor Documentation

OpenTK.Matrix4x3.Matrix4x3 ( Vector3  row0,
Vector3  row1,
Vector3  row2,
Vector3  row3 
)

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
OpenTK.Matrix4x3.Matrix4x3 ( float  m00,
float  m01,
float  m02,
float  m10,
float  m11,
float  m12,
float  m20,
float  m21,
float  m22,
float  m30,
float  m31,
float  m32 
)

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.
m30First 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.

Member Function Documentation

static Matrix4x3 OpenTK.Matrix4x3.Add ( Matrix4x3  left,
Matrix4x3  right 
)
static

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 OpenTK.Matrix4x3.Add ( ref Matrix4x3  left,
ref Matrix4x3  right,
out Matrix4x3  result 
)
static

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.
static void OpenTK.Matrix4x3.CreateFromAxisAngle ( Vector3  axis,
float  angle,
out Matrix4x3  result 
)
static

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.
static Matrix4x3 OpenTK.Matrix4x3.CreateFromAxisAngle ( Vector3  axis,
float  angle 
)
static

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.
static void OpenTK.Matrix4x3.CreateFromQuaternion ( ref Quaternion  q,
out Matrix4x3  result 
)
static

Builds a rotation matrix from a quaternion.

Parameters
qThe quaternion to rotate by.
resultA matrix instance.
static Matrix4x3 OpenTK.Matrix4x3.CreateFromQuaternion ( Quaternion  q)
static

Builds a rotation matrix from a quaternion.

Parameters
qThe quaternion to rotate by.
Returns
A matrix instance.
static void OpenTK.Matrix4x3.CreateRotationX ( float  angle,
out Matrix4x3  result 
)
static

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

Parameters
angleThe counter-clockwise angle in radians.
resultThe resulting Matrix4 instance.
static Matrix4x3 OpenTK.Matrix4x3.CreateRotationX ( float  angle)
static

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

Parameters
angleThe counter-clockwise angle in radians.
Returns
The resulting Matrix4 instance.
static void OpenTK.Matrix4x3.CreateRotationY ( float  angle,
out Matrix4x3  result 
)
static

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

Parameters
angleThe counter-clockwise angle in radians.
resultThe resulting Matrix4 instance.
static Matrix4x3 OpenTK.Matrix4x3.CreateRotationY ( float  angle)
static

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

Parameters
angleThe counter-clockwise angle in radians.
Returns
The resulting Matrix4 instance.
static void OpenTK.Matrix4x3.CreateRotationZ ( float  angle,
out Matrix4x3  result 
)
static

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

Parameters
angleThe counter-clockwise angle in radians.
resultThe resulting Matrix4 instance.
static Matrix4x3 OpenTK.Matrix4x3.CreateRotationZ ( float  angle)
static

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

Parameters
angleThe counter-clockwise angle in radians.
Returns
The resulting Matrix4 instance.
static Matrix4x3 OpenTK.Matrix4x3.CreateScale ( float  scale)
static

Build a scaling matrix

Parameters
scaleSingle scale factor for x,y and z axes
Returns
A scaling matrix
static Matrix4x3 OpenTK.Matrix4x3.CreateScale ( Vector3  scale)
static

Build a scaling matrix

Parameters
scaleScale factors for x,y and z axes
Returns
A scaling matrix
static Matrix4x3 OpenTK.Matrix4x3.CreateScale ( float  x,
float  y,
float  z 
)
static

Build a scaling matrix

Parameters
xScale factor for x-axis
yScale factor for y-axis
zScale factor for z-axis
Returns
A scaling matrix
static void OpenTK.Matrix4x3.CreateTranslation ( float  x,
float  y,
float  z,
out Matrix4x3  result 
)
static

Creates a translation matrix.

Parameters
xX translation.
yY translation.
zZ translation.
resultThe resulting Matrix4 instance.
static void OpenTK.Matrix4x3.CreateTranslation ( ref Vector3  vector,
out Matrix4x3  result 
)
static

Creates a translation matrix.

Parameters
vectorThe translation vector.
resultThe resulting Matrix4 instance.
static Matrix4x3 OpenTK.Matrix4x3.CreateTranslation ( float  x,
float  y,
float  z 
)
static

Creates a translation matrix.

Parameters
xX translation.
yY translation.
zZ translation.
Returns
The resulting Matrix4 instance.
static Matrix4x3 OpenTK.Matrix4x3.CreateTranslation ( Vector3  vector)
static

Creates a translation matrix.

Parameters
vectorThe translation vector.
Returns
The resulting Matrix4 instance.
override bool OpenTK.Matrix4x3.Equals ( object  obj)

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.
bool OpenTK.Matrix4x3.Equals ( Matrix4x3  other)

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.
override int OpenTK.Matrix4x3.GetHashCode ( )

Returns the hashcode for this instance.

Returns
A System.Int32 containing the unique hashcode for this instance.
void OpenTK.Matrix4x3.Invert ( )

Converts this instance into it's inverse by inverting the upper-left 3x3 and replacing Row3.

static Matrix4x3 OpenTK.Matrix4x3.Invert ( Matrix4x3  mat)
static

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.
static void OpenTK.Matrix4x3.Invert ( ref Matrix4x3  mat,
out Matrix4x3  result 
)
static

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 OpenTK.Matrix4x3.Mult ( Matrix4x3  left,
Matrix3x4  right 
)
static

This isn't quite a multiply, but the result may be useful in some situations. 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 OpenTK.Matrix4x3.Mult ( ref Matrix4x3  left,
ref Matrix3x4  right,
out Matrix4  result 
)
static

This isn't quite a multiply, but the result may be useful in some situations. 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 Matrix4x3 OpenTK.Matrix4x3.Mult ( Matrix4x3  left,
Matrix4x3  right 
)
static

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 OpenTK.Matrix4x3.Mult ( ref Matrix4x3  left,
ref Matrix4x3  right,
out Matrix4x3  result 
)
static

This isn't quite a multiply, but the result may be useful in some situations. 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 Matrix4x3 OpenTK.Matrix4x3.Mult ( Matrix4x3  left,
float  right 
)
static

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
static void OpenTK.Matrix4x3.Mult ( ref Matrix4x3  left,
float  right,
out Matrix4x3  result 
)
static

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
static bool OpenTK.Matrix4x3.operator!= ( Matrix4x3  left,
Matrix4x3  right 
)
static

Compares two instances for inequality.

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

Matrix multiplication

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

Matrix multiplication

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

Matrix-scalar multiplication

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

Matrix addition

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

Matrix subtraction

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

Compares two instances for equality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left equals right; false otherwise.
static Matrix4x3 OpenTK.Matrix4x3.Subtract ( Matrix4x3  left,
Matrix4x3  right 
)
static

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 OpenTK.Matrix4x3.Subtract ( ref Matrix4x3  left,
ref Matrix4x3  right,
out Matrix4x3  result 
)
static

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 OpenTK.Matrix4x3.ToString ( )

Returns a System.String that represents the current Matrix4x3.

Returns
The string representation of the matrix.
static Matrix3x4 OpenTK.Matrix4x3.Transpose ( Matrix4x3  mat)
static

Calculate the transpose of the given matrix

Parameters
matThe matrix to transpose
Returns
The transpose of the given matrix
static void OpenTK.Matrix4x3.Transpose ( ref Matrix4x3  mat,
out Matrix3x4  result 
)
static

Calculate the transpose of the given matrix

Parameters
matThe matrix to transpose
resultThe result of the calculation

Member Data Documentation

Vector3 OpenTK.Matrix4x3.Row0

Top row of the matrix

Vector3 OpenTK.Matrix4x3.Row1

2nd row of the matrix

Vector3 OpenTK.Matrix4x3.Row2

3rd row of the matrix

Vector3 OpenTK.Matrix4x3.Row3

Bottom row of the matrix

readonly Matrix4x3 OpenTK.Matrix4x3.Zero = new Matrix4x3(Vector3.Zero, Vector3.Zero, Vector3.Zero, Vector3.Zero)
static

The zero matrix

Property Documentation

Vector4 OpenTK.Matrix4x3.Column0
get

Gets the first column of this matrix.

Vector4 OpenTK.Matrix4x3.Column1
get

Gets the second column of this matrix.

Vector4 OpenTK.Matrix4x3.Column2
get

Gets the third column of this matrix.

Vector3 OpenTK.Matrix4x3.Diagonal
getset

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

float OpenTK.Matrix4x3.M11
getset

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

float OpenTK.Matrix4x3.M12
getset

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

float OpenTK.Matrix4x3.M13
getset

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

float OpenTK.Matrix4x3.M21
getset

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

float OpenTK.Matrix4x3.M22
getset

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

float OpenTK.Matrix4x3.M23
getset

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

float OpenTK.Matrix4x3.M31
getset

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

float OpenTK.Matrix4x3.M32
getset

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

float OpenTK.Matrix4x3.M33
getset

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

float OpenTK.Matrix4x3.M41
getset

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

float OpenTK.Matrix4x3.M42
getset

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

float OpenTK.Matrix4x3.M43
getset

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

float OpenTK.Matrix4x3.this[int rowIndex, int columnIndex]
getset

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

float OpenTK.Matrix4x3.Trace
get

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