The Open Toolkit library
1.0
|
Represents a 4x4 matrix containing 3D rotation, scale, transform, and projection with double-precision components. More...
Inherits IEquatable< Matrix4d >.
Public Member Functions | |
Matrix4d (Vector4d row0, Vector4d row1, Vector4d row2, Vector4d row3) | |
Constructs a new instance. More... | |
Matrix4d (double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23, double m30, double m31, double m32, double m33) | |
Constructs a new instance. More... | |
void | Invert () |
Converts this instance into its inverse. More... | |
void | Transpose () |
Converts this instance into its transpose. More... | |
Matrix4d | Normalized () |
Returns a normalised copy of this instance. More... | |
void | Normalize () |
Divides each element in the Matrix by the Determinant. More... | |
Matrix4d | Inverted () |
Returns an inverted copy of this instance. More... | |
Matrix4d | ClearTranslation () |
Returns a copy of this Matrix4d without translation. More... | |
Matrix4d | ClearScale () |
Returns a copy of this Matrix4d without scale. More... | |
Matrix4d | ClearRotation () |
Returns a copy of this Matrix4d without rotation. More... | |
Matrix4d | ClearProjection () |
Returns a copy of this Matrix4d without projection. More... | |
Vector3d | ExtractTranslation () |
Returns the translation component of this instance. More... | |
Vector3d | ExtractScale () |
Returns the scale component of this instance. More... | |
Quaterniond | ExtractRotation (bool row_normalise=true) |
Returns the rotation component of this instance. Quite slow. More... | |
Vector4d | ExtractProjection () |
Returns the projection component of this instance. More... | |
override string | ToString () |
Returns a System.String that represents the current Matrix44. 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 (Matrix4d other) |
Indicates whether the current matrix is equal to another matrix. More... | |
Static Public Member Functions | |
static void | CreateFromAxisAngle (Vector3d axis, double angle, out Matrix4d result) |
Build a rotation matrix from the specified axis/angle rotation. More... | |
static Matrix4d | CreateFromAxisAngle (Vector3d axis, double angle) |
Build a rotation matrix from the specified axis/angle rotation. More... | |
static void | CreateRotationX (double angle, out Matrix4d result) |
Builds a rotation matrix for a rotation around the x-axis. More... | |
static Matrix4d | CreateRotationX (double angle) |
Builds a rotation matrix for a rotation around the x-axis. More... | |
static void | CreateRotationY (double angle, out Matrix4d result) |
Builds a rotation matrix for a rotation around the y-axis. More... | |
static Matrix4d | CreateRotationY (double angle) |
Builds a rotation matrix for a rotation around the y-axis. More... | |
static void | CreateRotationZ (double angle, out Matrix4d result) |
Builds a rotation matrix for a rotation around the z-axis. More... | |
static Matrix4d | CreateRotationZ (double angle) |
Builds a rotation matrix for a rotation around the z-axis. More... | |
static void | CreateTranslation (double x, double y, double z, out Matrix4d result) |
Creates a translation matrix. More... | |
static void | CreateTranslation (ref Vector3d vector, out Matrix4d result) |
Creates a translation matrix. More... | |
static Matrix4d | CreateTranslation (double x, double y, double z) |
Creates a translation matrix. More... | |
static Matrix4d | CreateTranslation (Vector3d vector) |
Creates a translation matrix. More... | |
static void | CreateOrthographic (double width, double height, double zNear, double zFar, out Matrix4d result) |
Creates an orthographic projection matrix. More... | |
static Matrix4d | CreateOrthographic (double width, double height, double zNear, double zFar) |
Creates an orthographic projection matrix. More... | |
static void | CreateOrthographicOffCenter (double left, double right, double bottom, double top, double zNear, double zFar, out Matrix4d result) |
Creates an orthographic projection matrix. More... | |
static Matrix4d | CreateOrthographicOffCenter (double left, double right, double bottom, double top, double zNear, double zFar) |
Creates an orthographic projection matrix. More... | |
static void | CreatePerspectiveFieldOfView (double fovy, double aspect, double zNear, double zFar, out Matrix4d result) |
Creates a perspective projection matrix. More... | |
static Matrix4d | CreatePerspectiveFieldOfView (double fovy, double aspect, double zNear, double zFar) |
Creates a perspective projection matrix. More... | |
static void | CreatePerspectiveOffCenter (double left, double right, double bottom, double top, double zNear, double zFar, out Matrix4d result) |
Creates an perspective projection matrix. More... | |
static Matrix4d | CreatePerspectiveOffCenter (double left, double right, double bottom, double top, double zNear, double zFar) |
Creates an perspective projection matrix. More... | |
static void | CreateFromQuaternion (ref Quaterniond q, ref Matrix4d m) |
Build a rotation matrix from the specified quaternion. More... | |
static Matrix4d | CreateFromQuaternion (ref Quaterniond q) |
Build a rotation matrix from the specified quaternion. More... | |
static Matrix4d | Translation (Vector3d trans) |
Build a translation matrix with the given translation More... | |
static Matrix4d | Translation (double x, double y, double z) |
Build a translation matrix with the given translation More... | |
static Matrix4d | Scale (double scale) |
Build a scaling matrix More... | |
static Matrix4d | Scale (Vector3d scale) |
Build a scaling matrix More... | |
static Matrix4d | Scale (double x, double y, double z) |
Build a scaling matrix More... | |
static Matrix4d | RotateX (double angle) |
Build a rotation matrix that rotates about the x-axis More... | |
static Matrix4d | RotateY (double angle) |
Build a rotation matrix that rotates about the y-axis More... | |
static Matrix4d | RotateZ (double angle) |
Build a rotation matrix that rotates about the z-axis More... | |
static Matrix4d | Rotate (Vector3d axis, double angle) |
Build a rotation matrix to rotate about the given axis More... | |
static Matrix4d | Rotate (Quaterniond q) |
Build a rotation matrix from a quaternion More... | |
static Matrix4d | LookAt (Vector3d eye, Vector3d target, Vector3d up) |
Build a world space to camera space matrix More... | |
static Matrix4d | LookAt (double eyeX, double eyeY, double eyeZ, double targetX, double targetY, double targetZ, double upX, double upY, double upZ) |
Build a world space to camera space matrix More... | |
static Matrix4d | Frustum (double left, double right, double bottom, double top, double near, double far) |
Build a projection matrix More... | |
static Matrix4d | Perspective (double fovy, double aspect, double near, double far) |
Build a projection matrix More... | |
static Matrix4d | Add (Matrix4d left, Matrix4d right) |
Adds two instances. More... | |
static void | Add (ref Matrix4d left, ref Matrix4d right, out Matrix4d result) |
Adds two instances. More... | |
static Matrix4d | Subtract (Matrix4d left, Matrix4d right) |
Subtracts one instance from another. More... | |
static void | Subtract (ref Matrix4d left, ref Matrix4d right, out Matrix4d result) |
Subtracts one instance from another. More... | |
static Matrix4d | Mult (Matrix4d left, Matrix4d right) |
Multiplies two instances. More... | |
static void | Mult (ref Matrix4d left, ref Matrix4d right, out Matrix4d result) |
Multiplies two instances. More... | |
static Matrix4d | Mult (Matrix4d left, double right) |
Multiplies an instance by a scalar. More... | |
static void | Mult (ref Matrix4d left, double right, out Matrix4d result) |
Multiplies an instance by a scalar. More... | |
static Matrix4d | Invert (Matrix4d mat) |
Calculate the inverse of the given matrix More... | |
static Matrix4d | Transpose (Matrix4d mat) |
Calculate the transpose of the given matrix More... | |
static void | Transpose (ref Matrix4d mat, out Matrix4d result) |
Calculate the transpose of the given matrix More... | |
static Matrix4d | operator* (Matrix4d left, Matrix4d right) |
Matrix multiplication More... | |
static Matrix4d | operator* (Matrix4d left, float right) |
Matrix-scalar multiplication More... | |
static Matrix4d | operator+ (Matrix4d left, Matrix4d right) |
Matrix addition More... | |
static Matrix4d | operator- (Matrix4d left, Matrix4d right) |
Matrix subtraction More... | |
static bool | operator== (Matrix4d left, Matrix4d right) |
Compares two instances for equality. More... | |
static bool | operator!= (Matrix4d left, Matrix4d right) |
Compares two instances for inequality. More... | |
Public Attributes | |
Vector4d | Row0 |
Top row of the matrix More... | |
Vector4d | Row1 |
2nd row of the matrix More... | |
Vector4d | Row2 |
3rd row of the matrix More... | |
Vector4d | Row3 |
Bottom row of the matrix More... | |
Static Public Attributes | |
static Matrix4d | Identity = new Matrix4d(Vector4d.UnitX, Vector4d.UnitY, Vector4d.UnitZ, Vector4d.UnitW) |
The identity matrix More... | |
Properties | |
double | Determinant [get] |
The determinant of this matrix More... | |
Vector4d | Column0 [get, set] |
The first column of this matrix More... | |
Vector4d | Column1 [get, set] |
The second column of this matrix More... | |
Vector4d | Column2 [get, set] |
The third column of this matrix More... | |
Vector4d | Column3 [get, set] |
The fourth column of this matrix More... | |
double | M11 [get, set] |
Gets or sets the value at row 1, column 1 of this instance. More... | |
double | M12 [get, set] |
Gets or sets the value at row 1, column 2 of this instance. More... | |
double | M13 [get, set] |
Gets or sets the value at row 1, column 3 of this instance. More... | |
double | M14 [get, set] |
Gets or sets the value at row 1, column 4 of this instance. More... | |
double | M21 [get, set] |
Gets or sets the value at row 2, column 1 of this instance. More... | |
double | M22 [get, set] |
Gets or sets the value at row 2, column 2 of this instance. More... | |
double | M23 [get, set] |
Gets or sets the value at row 2, column 3 of this instance. More... | |
double | M24 [get, set] |
Gets or sets the value at row 2, column 4 of this instance. More... | |
double | M31 [get, set] |
Gets or sets the value at row 3, column 1 of this instance. More... | |
double | M32 [get, set] |
Gets or sets the value at row 3, column 2 of this instance. More... | |
double | M33 [get, set] |
Gets or sets the value at row 3, column 3 of this instance. More... | |
double | M34 [get, set] |
Gets or sets the value at row 3, column 4 of this instance. More... | |
double | M41 [get, set] |
Gets or sets the value at row 4, column 1 of this instance. More... | |
double | M42 [get, set] |
Gets or sets the value at row 4, column 2 of this instance. More... | |
double | M43 [get, set] |
Gets or sets the value at row 4, column 3 of this instance. More... | |
double | M44 [get, set] |
Gets or sets the value at row 4, column 4 of this instance. More... | |
Vector4d | Diagonal [get, set] |
Gets or sets the values along the main diagonal of the matrix. More... | |
double | Trace [get] |
Gets the trace of the matrix, the sum of the values along the diagonal. More... | |
double | this[int rowIndex, int columnIndex] [get, set] |
Gets or sets the value at a specified row and column. More... | |
Represents a 4x4 matrix containing 3D rotation, scale, transform, and projection with double-precision components.
Constructs a new instance.
row0 | Top row of the matrix |
row1 | Second row of the matrix |
row2 | Third row of the matrix |
row3 | Bottom row of the matrix |
OpenTK.Matrix4d.Matrix4d | ( | double | m00, |
double | m01, | ||
double | m02, | ||
double | m03, | ||
double | m10, | ||
double | m11, | ||
double | m12, | ||
double | m13, | ||
double | m20, | ||
double | m21, | ||
double | m22, | ||
double | m23, | ||
double | m30, | ||
double | m31, | ||
double | m32, | ||
double | m33 | ||
) |
Constructs a new instance.
m00 | First item of the first row. |
m01 | Second item of the first row. |
m02 | Third item of the first row. |
m03 | Fourth item of the first row. |
m10 | First item of the second row. |
m11 | Second item of the second row. |
m12 | Third item of the second row. |
m13 | Fourth item of the second row. |
m20 | First item of the third row. |
m21 | Second item of the third row. |
m22 | Third item of the third row. |
m23 | First item of the third row. |
m30 | Fourth item of the fourth row. |
m31 | Second item of the fourth row. |
m32 | Third item of the fourth row. |
m33 | Fourth item of the fourth row. |
Adds two instances.
left | The left operand of the addition. |
right | The right operand of the addition. |
|
static |
Adds two instances.
left | The left operand of the addition. |
right | The right operand of the addition. |
result | A new instance that is the result of the addition. |
|
static |
Build a rotation matrix from the specified axis/angle rotation.
axis | The axis to rotate about. |
angle | Angle in radians to rotate counter-clockwise (looking in the direction of the given axis). |
result | A matrix instance. |
Build a rotation matrix from the specified axis/angle rotation.
axis | The axis to rotate about. |
angle | Angle in radians to rotate counter-clockwise (looking in the direction of the given axis). |
|
static |
Build a rotation matrix from the specified quaternion.
q | Quaternion to translate. |
m | Matrix result. |
|
static |
Build a rotation matrix from the specified quaternion.
q | Quaternion to translate. |
|
static |
Creates an orthographic projection matrix.
width | The width of the projection volume. |
height | The height of the projection volume. |
zNear | The near edge of the projection volume. |
zFar | The far edge of the projection volume. |
result | The resulting Matrix4d instance. |
|
static |
Creates an orthographic projection matrix.
width | The width of the projection volume. |
height | The height of the projection volume. |
zNear | The near edge of the projection volume. |
zFar | The far edge of the projection volume. |
<rereturns>The resulting Matrix4d instance.</rereturns>
|
static |
Creates an orthographic projection matrix.
left | The left edge of the projection volume. |
right | The right edge of the projection volume. |
bottom | The bottom edge of the projection volume. |
top | The top edge of the projection volume. |
zNear | The near edge of the projection volume. |
zFar | The far edge of the projection volume. |
result | The resulting Matrix4d instance. |
|
static |
Creates an orthographic projection matrix.
left | The left edge of the projection volume. |
right | The right edge of the projection volume. |
bottom | The bottom edge of the projection volume. |
top | The top edge of the projection volume. |
zNear | The near edge of the projection volume. |
zFar | The far edge of the projection volume. |
|
static |
Creates a perspective projection matrix.
fovy | Angle of the field of view in the y direction (in radians) |
aspect | Aspect ratio of the view (width / height) |
zNear | Distance to the near clip plane |
zFar | Distance to the far clip plane |
result | A projection matrix that transforms camera space to raster space |
System.ArgumentOutOfRangeException | Thrown under the following conditions:
|
|
static |
Creates a perspective projection matrix.
fovy | Angle of the field of view in the y direction (in radians) |
aspect | Aspect ratio of the view (width / height) |
zNear | Distance to the near clip plane |
zFar | Distance to the far clip plane |
System.ArgumentOutOfRangeException | Thrown under the following conditions:
|
|
static |
Creates an perspective projection matrix.
left | Left edge of the view frustum |
right | Right edge of the view frustum |
bottom | Bottom edge of the view frustum |
top | Top edge of the view frustum |
zNear | Distance to the near clip plane |
zFar | Distance to the far clip plane |
result | A projection matrix that transforms camera space to raster space |
System.ArgumentOutOfRangeException | Thrown under the following conditions:
|
|
static |
Creates an perspective projection matrix.
left | Left edge of the view frustum |
right | Right edge of the view frustum |
bottom | Bottom edge of the view frustum |
top | Top edge of the view frustum |
zNear | Distance to the near clip plane |
zFar | Distance to the far clip plane |
System.ArgumentOutOfRangeException | Thrown under the following conditions:
|
|
static |
Builds a rotation matrix for a rotation around the x-axis.
angle | The counter-clockwise angle in radians. |
result | The resulting Matrix4d instance. |
|
static |
Builds a rotation matrix for a rotation around the x-axis.
angle | The counter-clockwise angle in radians. |
|
static |
Builds a rotation matrix for a rotation around the y-axis.
angle | The counter-clockwise angle in radians. |
result | The resulting Matrix4d instance. |
|
static |
Builds a rotation matrix for a rotation around the y-axis.
angle | The counter-clockwise angle in radians. |
|
static |
Builds a rotation matrix for a rotation around the z-axis.
angle | The counter-clockwise angle in radians. |
result | The resulting Matrix4d instance. |
|
static |
Builds a rotation matrix for a rotation around the z-axis.
angle | The counter-clockwise angle in radians. |
|
static |
Creates a translation matrix.
x | X translation. |
y | Y translation. |
z | Z translation. |
result | The resulting Matrix4d instance. |
Creates a translation matrix.
vector | The translation vector. |
result | The resulting Matrix4d instance. |
|
static |
Creates a translation matrix.
x | X translation. |
y | Y translation. |
z | Z translation. |
Creates a translation matrix.
vector | The translation vector. |
override bool OpenTK.Matrix4d.Equals | ( | object | obj | ) |
Indicates whether this instance and a specified object are equal.
obj | The object to compare to. |
bool OpenTK.Matrix4d.Equals | ( | Matrix4d | other | ) |
Indicates whether the current matrix is equal to another matrix.
other | A matrix to compare with this matrix. |
Vector4d OpenTK.Matrix4d.ExtractProjection | ( | ) |
Returns the projection component of this instance.
Quaterniond OpenTK.Matrix4d.ExtractRotation | ( | bool | row_normalise = true | ) |
Returns the rotation component of this instance. Quite slow.
row_normalise | Whether the method should row-normalise (i.e. remove scale from) the Matrix. Pass false if you know it's already normalised. |
Vector3d OpenTK.Matrix4d.ExtractScale | ( | ) |
Returns the scale component of this instance.
Vector3d OpenTK.Matrix4d.ExtractTranslation | ( | ) |
Returns the translation component of this instance.
|
static |
Build a projection matrix
left | Left edge of the view frustum |
right | Right edge of the view frustum |
bottom | Bottom edge of the view frustum |
top | Top edge of the view frustum |
near | Distance to the near clip plane |
far | Distance to the far clip plane |
override int OpenTK.Matrix4d.GetHashCode | ( | ) |
Returns the hashcode for this instance.
void OpenTK.Matrix4d.Invert | ( | ) |
Converts this instance into its inverse.
Calculate the inverse of the given matrix
mat | The matrix to invert |
InvalidOperationException | Thrown if the Matrix4d is singular. |
Matrix4d OpenTK.Matrix4d.Inverted | ( | ) |
Returns an inverted copy of this instance.
Build a world space to camera space matrix
eye | Eye (camera) position in world space |
target | Target position in world space |
up | Up vector in world space (should not be parallel to the camera direction, that is target - eye) |
|
static |
Build a world space to camera space matrix
eyeX | Eye (camera) position in world space |
eyeY | Eye (camera) position in world space |
eyeZ | Eye (camera) position in world space |
targetX | Target position in world space |
targetY | Target position in world space |
targetZ | Target position in world space |
upX | Up vector in world space (should not be parallel to the camera direction, that is target - eye) |
upY | Up vector in world space (should not be parallel to the camera direction, that is target - eye) |
upZ | Up vector in world space (should not be parallel to the camera direction, that is target - eye) |
Multiplies two instances.
left | The left operand of the multiplication. |
right | The right operand of the multiplication. |
|
static |
Multiplies two instances.
left | The left operand of the multiplication. |
right | The right operand of the multiplication. |
result | A new instance that is the result of the multiplication |
Multiplies an instance by a scalar.
left | The left operand of the multiplication. |
right | The right operand of the multiplication. |
Multiplies an instance by a scalar.
left | The left operand of the multiplication. |
right | The right operand of the multiplication. |
result | A new instance that is the result of the multiplication |
void OpenTK.Matrix4d.Normalize | ( | ) |
Divides each element in the Matrix by the Determinant.
Matrix4d OpenTK.Matrix4d.Normalized | ( | ) |
Returns a normalised copy of this instance.
Compares two instances for inequality.
left | The first instance. |
right | The second instance. |
Matrix multiplication
left | left-hand operand |
right | right-hand operand |
Matrix-scalar multiplication
left | left-hand operand |
right | right-hand operand |
Matrix addition
left | left-hand operand |
right | right-hand operand |
Matrix subtraction
left | left-hand operand |
right | right-hand operand |
Compares two instances for equality.
left | The first instance. |
right | The second instance. |
|
static |
Build a projection matrix
fovy | Angle of the field of view in the y direction (in radians) |
aspect | Aspect ratio of the view (width / height) |
near | Distance to the near clip plane |
far | Distance to the far clip plane |
Build a rotation matrix to rotate about the given axis
axis | the axis to rotate about |
angle | angle in radians to rotate counter-clockwise (looking in the direction of the given axis) |
|
static |
Build a rotation matrix from a quaternion
q | the quaternion |
|
static |
Build a rotation matrix that rotates about the x-axis
angle | angle in radians to rotate counter-clockwise around the x-axis |
|
static |
Build a rotation matrix that rotates about the y-axis
angle | angle in radians to rotate counter-clockwise around the y-axis |
|
static |
Build a rotation matrix that rotates about the z-axis
angle | angle in radians to rotate counter-clockwise around the z-axis |
|
static |
Build a scaling matrix
scale | Single scale factor for x,y and z axes |
Build a scaling matrix
scale | Scale factors for x,y and z axes |
|
static |
Build a scaling matrix
x | Scale factor for x-axis |
y | Scale factor for y-axis |
z | Scale factor for z-axis |
Subtracts one instance from another.
left | The left operand of the subraction. |
right | The right operand of the subraction. |
|
static |
Subtracts one instance from another.
left | The left operand of the subraction. |
right | The right operand of the subraction. |
result | A new instance that is the result of the subraction. |
override string OpenTK.Matrix4d.ToString | ( | ) |
Returns a System.String that represents the current Matrix44.
Build a translation matrix with the given translation
trans | The vector to translate along |
|
static |
Build a translation matrix with the given translation
x | X translation |
y | Y translation |
z | Z translation |
void OpenTK.Matrix4d.Transpose | ( | ) |
Converts this instance into its transpose.
Calculate the transpose of the given matrix
mat | The matrix to transpose |
Calculate the transpose of the given matrix
mat | The matrix to transpose |
result | The result of the calculation |
|
static |
The identity matrix
Vector4d OpenTK.Matrix4d.Row0 |
Top row of the matrix
Vector4d OpenTK.Matrix4d.Row1 |
2nd row of the matrix
Vector4d OpenTK.Matrix4d.Row2 |
3rd row of the matrix
Vector4d OpenTK.Matrix4d.Row3 |
Bottom row of the matrix
|
getset |
The first column of this matrix
|
getset |
The second column of this matrix
|
getset |
The third column of this matrix
|
getset |
The fourth column of this matrix
|
get |
The determinant of this matrix
|
getset |
Gets or sets the values along the main diagonal of the matrix.
|
getset |
Gets or sets the value at row 1, column 1 of this instance.
|
getset |
Gets or sets the value at row 1, column 2 of this instance.
|
getset |
Gets or sets the value at row 1, column 3 of this instance.
|
getset |
Gets or sets the value at row 1, column 4 of this instance.
|
getset |
Gets or sets the value at row 2, column 1 of this instance.
|
getset |
Gets or sets the value at row 2, column 2 of this instance.
|
getset |
Gets or sets the value at row 2, column 3 of this instance.
|
getset |
Gets or sets the value at row 2, column 4 of this instance.
|
getset |
Gets or sets the value at row 3, column 1 of this instance.
|
getset |
Gets or sets the value at row 3, column 2 of this instance.
|
getset |
Gets or sets the value at row 3, column 3 of this instance.
|
getset |
Gets or sets the value at row 3, column 4 of this instance.
|
getset |
Gets or sets the value at row 4, column 1 of this instance.
|
getset |
Gets or sets the value at row 4, column 2 of this instance.
|
getset |
Gets or sets the value at row 4, column 3 of this instance.
|
getset |
Gets or sets the value at row 4, column 4 of this instance.
|
getset |
Gets or sets the value at a specified row and column.
|
get |
Gets the trace of the matrix, the sum of the values along the diagonal.