HDK
|
#include <ImathQuat.h>
Public Types | |
typedef T | BaseType |
Public Member Functions | |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T & | operator[] (int index) IMATH_NOEXCEPT |
IMATH_HOSTDEVICE constexpr T | operator[] (int index) const IMATH_NOEXCEPT |
Basic Algebra | |
Note that the operator return values are NOT normalized | |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat < T > & | operator*= (const Quat< T > &q) IMATH_NOEXCEPT |
Quaternion multiplication. More... | |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat < T > & | operator*= (T t) IMATH_NOEXCEPT |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat < T > & | operator/= (const Quat< T > &q) IMATH_NOEXCEPT |
Quaterion division, using the inverse() More... | |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat < T > & | operator/= (T t) IMATH_NOEXCEPT |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat < T > & | operator+= (const Quat< T > &q) IMATH_NOEXCEPT |
Quaternion addition. More... | |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat < T > & | operator-= (const Quat< T > &q) IMATH_NOEXCEPT |
Quaternion subtraction. More... | |
template<class S > | |
IMATH_HOSTDEVICE constexpr bool | operator== (const Quat< S > &q) const IMATH_NOEXCEPT |
Equality. More... | |
template<class S > | |
IMATH_HOSTDEVICE constexpr bool | operator!= (const Quat< S > &q) const IMATH_NOEXCEPT |
Inequality. More... | |
Query | |
IMATH_HOSTDEVICE constexpr T | length () const IMATH_NOEXCEPT |
Return the R4 length. More... | |
IMATH_HOSTDEVICE constexpr T | angle () const IMATH_NOEXCEPT |
Return the angle of the axis/angle representation. More... | |
IMATH_HOSTDEVICE constexpr Vec3< T > | axis () const IMATH_NOEXCEPT |
Return the axis of the axis/angle representation. More... | |
IMATH_HOSTDEVICE constexpr Matrix33< T > | toMatrix33 () const IMATH_NOEXCEPT |
Return a 3x3 rotation matrix. More... | |
IMATH_HOSTDEVICE constexpr Matrix44< T > | toMatrix44 () const IMATH_NOEXCEPT |
Return a 4x4 rotation matrix. More... | |
IMATH_HOSTDEVICE Quat< T > | log () const IMATH_NOEXCEPT |
Return the logarithm of the quaterion. More... | |
IMATH_HOSTDEVICE Quat< T > | exp () const IMATH_NOEXCEPT |
Return the exponent of the quaterion. More... | |
Utility Methods | |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat< T > & | invert () IMATH_NOEXCEPT |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat< T > | inverse () const IMATH_NOEXCEPT |
Return 1/this, leaving this unchanged. More... | |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat< T > & | normalize () IMATH_NOEXCEPT |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat< T > | normalized () const IMATH_NOEXCEPT |
Return a normalized quaternion, leaving this unmodified. More... | |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Vec3< T > | rotateVector (const Vec3< T > &original) const IMATH_NOEXCEPT |
Rotate the given point by the quaterion. More... | |
IMATH_HOSTDEVICE constexpr T | euclideanInnerProduct (const Quat< T > &q) const IMATH_NOEXCEPT |
Return the Euclidean inner product. More... | |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat< T > & | setAxisAngle (const Vec3< T > &axis, T radians) IMATH_NOEXCEPT |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Quat< T > & | setRotation (const Vec3< T > &fromDirection, const Vec3< T > &toDirection) IMATH_NOEXCEPT |
Public Attributes | |
Direct access to elements | |
T | r |
The real part. More... | |
Vec3< T > | v |
The imaginary vector. More... | |
Constructors | |
IMATH_HOSTDEVICE constexpr | Quat () IMATH_NOEXCEPT |
Default constructor is the identity quat. More... | |
IMATH_HOSTDEVICE constexpr | Quat (const Quat &q) IMATH_NOEXCEPT |
Copy constructor. More... | |
template<class S > | |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 | Quat (const Quat< S > &q) IMATH_NOEXCEPT |
Construct from a quaternion of a another base type. More... | |
IMATH_HOSTDEVICE constexpr | Quat (T s, T i, T j, T k) IMATH_NOEXCEPT |
Initialize with real part s and imaginary vector 1(i,j,k)`. More... | |
IMATH_HOSTDEVICE constexpr | Quat (T s, Vec3< T > d) IMATH_NOEXCEPT |
Initialize with real part s and imaginary vector d More... | |
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Quat < T > & | operator= (const Quat< T > &q) IMATH_NOEXCEPT |
Assignment. More... | |
IMATH_HOSTDEVICE | ~Quat () IMATH_NOEXCEPT=default |
Destructor. More... | |
IMATH_HOSTDEVICE static constexpr Quat< T > | identity () IMATH_NOEXCEPT |
The identity quaternion. More... | |
The Quat class implements the quaternion numerical type – you will probably want to use this class to represent orientations in R3 and to convert between various euler angle reps. You should probably use Imath::Euler<> for that.
Definition at line 42 of file ImathQuat.h.
The base type: In templates that accept a parameter V
, you can refer to T
as V::BaseType
Definition at line 193 of file ImathQuat.h.
|
inline |
Default constructor is the identity quat.
Definition at line 272 of file ImathQuat.h.
Copy constructor.
Definition at line 297 of file ImathQuat.h.
|
inline |
Construct from a quaternion of a another base type.
Definition at line 279 of file ImathQuat.h.
Initialize with real part s
and imaginary vector 1(i,j,k)`.
Definition at line 285 of file ImathQuat.h.
Initialize with real part s
and imaginary vector d
Definition at line 291 of file ImathQuat.h.
|
default |
Destructor.
|
inline |
Return the angle of the axis/angle representation.
Definition at line 669 of file ImathQuat.h.
|
inline |
Return the axis of the axis/angle representation.
Definition at line 676 of file ImathQuat.h.
|
inline |
Return the Euclidean inner product.
Definition at line 491 of file ImathQuat.h.
|
inline |
Return the exponent of the quaterion.
Definition at line 645 of file ImathQuat.h.
|
inlinestatic |
The identity quaternion.
Definition at line 304 of file ImathQuat.h.
|
inline |
Return 1/this, leaving this unchanged.
Definition at line 447 of file ImathQuat.h.
Invert in place: this = 1 / this.
Definition at line 461 of file ImathQuat.h.
Return the R4 length.
Definition at line 412 of file ImathQuat.h.
|
inline |
Return the logarithm of the quaterion.
Definition at line 620 of file ImathQuat.h.
|
inline |
|
inline |
Return a normalized quaternion, leaving this unmodified.
Definition at line 437 of file ImathQuat.h.
|
inline |
Inequality.
Definition at line 397 of file ImathQuat.h.
|
inline |
Quaternion multiplication.
Definition at line 320 of file ImathQuat.h.
|
inline |
Scalar multiplication: multiply both real and imaginary parts by the given scalar.
Definition at line 330 of file ImathQuat.h.
|
inline |
Quaternion addition.
Definition at line 356 of file ImathQuat.h.
|
inline |
Quaternion subtraction.
Definition at line 365 of file ImathQuat.h.
|
inline |
Quaterion division, using the inverse()
Definition at line 339 of file ImathQuat.h.
|
inline |
Scalar division: multiply both real and imaginary parts by the given scalar.
Definition at line 347 of file ImathQuat.h.
|
inline |
Assignment.
Definition at line 311 of file ImathQuat.h.
|
inline |
Equality.
Definition at line 389 of file ImathQuat.h.
|
inline |
Element access: q[0] is the real part, (q[1],q[2],q[3]) is the imaginary part.
Definition at line 374 of file ImathQuat.h.
|
inline |
Element access: q[0] is the real part, (q[1],q[2],q[3]) is the imaginary part.
Definition at line 381 of file ImathQuat.h.
|
inline |
Rotate the given point by the quaterion.
Definition at line 471 of file ImathQuat.h.
|
inline |
Set the quaterion to be a rotation around the given axis by the given angle.
Definition at line 683 of file ImathQuat.h.
|
inline |
Set the quaternion to be a rotation that transforms the direction vector fromDirection
to toDirection
Definition at line 692 of file ImathQuat.h.
|
inline |
Return a 3x3 rotation matrix.
Definition at line 797 of file ImathQuat.h.
|
inline |
Return a 4x4 rotation matrix.
Definition at line 814 of file ImathQuat.h.
The imaginary vector.
Definition at line 53 of file ImathQuat.h.