Namespace: DeltaEngine.Datatypes
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Tests.Datatypes.QuaternionTests
2 unit tests call DeltaEngine.Datatypes.Quaternion.FromRotationMatrix(DeltaEngine.Datatypes.Matrix)
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- m
- Type: DeltaEngine.Datatypes Matrix
Return Value
Type: QuaternionRemarks
Examples
[Test] public void MultiplyingTwoQuaternionsMatchesMultiplyingTwoMatrices() { var q1 = Quaternion.FromAxisAngle(Vector3D.Normalize(new Vector3D(1, 2, 3)), 40.0f); var q2 = Quaternion.FromAxisAngle(Vector3D.Normalize(new Vector3D(4, -5, 6)), -10.0f); var q3 = q1 * q2; var m1 = Matrix.FromQuaternion(q1); var m2 = Matrix.FromQuaternion(q2); var m3 = m1 * m2; Assert.AreEqual(q3, Quaternion.FromRotationMatrix(m3)); }
[Test] public void CheckCreateLookAt() { var matLookAt = Matrix.CreateLookAt(Vector3D.One, Vector3D.UnitY, Vector3D.UnitZ); var quaternion = Quaternion.CreateLookAt(Vector3D.One, Vector3D.UnitY, Vector3D.UnitZ); Assert.AreEqual(quaternion, Quaternion.FromRotationMatrix(matLookAt)); }
See Also