4x4 Matrix from 16 floats, access happens via indexer, optimizations done in BuildService.
View code on GitHub
Namespace: DeltaEngine.DatatypesAssembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Matrix type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Matrix( Single ) | Initializes a new instance of the Matrix class | |
Matrix(String) | Initializes a new instance of the Matrix class |
Methods
Name | Description | |
---|---|---|
CreateLookAt | ||
CreateOrthoProjection(Size) | ||
CreateOrthoProjection(Size, Single, Single) | ||
CreatePerspective | ||
CreateRotationX | ||
CreateRotationY | ||
CreateRotationZ | ||
CreateRotationZYX(EulerAngles) | ||
CreateRotationZYX(Single, Single, Single) | ||
CreateScale(Vector3D) | ||
CreateScale(Single, Single, Single) | ||
CreateTranslation | ||
Equals(Object) | (Overrides ValueType Equals(Object).) | |
Equals(Matrix) | ||
FromAxisAngle | ||
FromQuaternion |
Further details on how to compute matrix from quaternion:
http://renderfeather.googlecode.com/hg-history/034a1900d6e8b6c92440382658d2b01fc732c5de/Doc/optimized%2520Matrix%2520quaternion%2520conversion.pdf
View code on GitHub | |
Frustum | ||
GetDeterminant |
More details how to calculate Matrix Determinants: http://en.wikipedia.org/wiki/Determinant
View code on GitHub | |
GetHashCode | (Overrides ValueType GetHashCode .) | |
InverseTranspose | ||
Invert | ||
IsNearlyEqual | ||
ToString | (Overrides ValueType ToString .) | |
TransformHomogeneousCoordinate | ||
TransformNormal | ||
Transpose |
Operators
Name | Description | |
---|---|---|
Division | ||
Equality | ||
Inequality | ||
Multiply(Matrix, Matrix) | ||
Multiply(Matrix, Vector3D) |
Fields
Name | Description | |
---|---|---|
Identity | ||
SizeInBytes |
Properties
Name | Description | |
---|---|---|
Forward | ||
GetValues | ||
Item | ||
Right | ||
Translation | ||
Up |
Remarks
Examples
[Test] public void MatrixZero() { matrix = new Matrix(); for (int i = 0; i < 16; i++) Assert.AreEqual(0, matrix[i]); }
[Test] public void CreateWith16Floats() { AssertValues0To15(); }
[Test] public void CreateFromString() { var textMatrix = new Matrix("0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15"); for (int i = 0; i < 16; i++) Assert.AreEqual(textMatrix[i], matrix[i]); }
See Also