-
Notifications
You must be signed in to change notification settings - Fork 513
Quaternion
Chuck Walbourn edited this page Nov 3, 2015
·
25 revisions
A rotation represented as a four component vector modeled after the XNA Game Studio math library.
#include <SimpleMath.h>
using namespace DirectX::SimpleMath;
Quaternion q; // Creates the identity quaternion [0, 0, 0, 1]
Quaternion q(0, 0, 0, 1); // Creates a quaternion [0, 0, 0, 1]
Quaternion q( Vector3(0,0,0), 1); // Creates a quaternion [0, 0, 0, 1]
Quaternion q( Vector4(0,0,0,1) ); // Creates a quaternion [0, 0, 0, 1]
float arr[4] = { 0, 0, 0, 1 };
Quaternion q(arr); // Creates a quaternion [0, 0, 0, 1]
- x component of the quaternion
- y component of the quaternion
- z component of the quaternion
- w component of the quaternion
- Comparison operators:
==
and!=
- Assignment operators:
=
,+=
,-=
,*=
,/=
- Unary operators:
+
,-
- Binary operators:
+
,-
,*
,/
- Length
- LengthSquared
- Normalize
- Conjugate*
- Inverse
- Dot
- CreateFromAxisAngle
- CreateFromYawPitchRoll
- CreateFromRotationMatrix
- Lerp
- Slerp: Spherical linear interpolation
- Concatenate
- Identity: The identity quaternion [0, 0, 0, 1]
Quaternion can freely convert to and from a XMFLOAT4
and XMVECTOR
All content and source code for this package are subject to the terms of the MIT License.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
- Universal Windows Platform apps
- Windows desktop apps
- Windows 11
- Windows 10
- Windows 8.1
- Xbox One
- x86
- x64
- ARM64
- Visual Studio 2022
- Visual Studio 2019 (16.11)
- clang/LLVM v12 - v18
- MinGW 12.2, 13.2
- CMake 3.20