QuatPos
A transformation consisting of a rotation followed by a translation.
A QuatPos
behaves like a Float4x4
or Float3x4
that performs only rotation and translation.
While Float4x4
uses 64 bytes of storage and Float3x4
uses 48 bytes, QuatPos
uses only 28
bytes.
Header File
#include <ply-math/Matrix.h>
Also included from <ply-math/Base.h>
.
Data Members
-
The rotation component.
-
The translation component.
Constructors
-
Constructs an uninitialized
QuatPos
. -
Constructs a
QuatPos
from a quaternion. -
Constructs a
QuatPos
from a quaternion and a translation. -
Returns a
QuatPos
that performs the inverse transformation of the givenQuatPos
. -
Transforms
v
usingqp
. Equivalent toqp.quat * v + qp.pos
. QuatPos operator*(const QuatPos& a, const QuatPos& b)
[code]QuatPos operator*(const QuatPos& a, const Quaternion& b)
[code]QuatPos operator*(const Quaternion& a, const QuatPos& b)
[code]-
Composes a
QuatPos
with anotherQuatPos
or aQuaternion
. The resultingQuatPos
performs the transformation performed byb
followed by the transformation performed bya
. -
Returns the identity
QuatPos{{0, 0, 0, 1}, {0, 0, 0}}
. -
Returns a
QuatPos
that performs translation only. -
Returns a
QuatPos
that performs rotation only.unitAxis
must have unit length. The angle is specified in radians. Rotation follows the right-hand rule in a right-handed coordinate system. -
Converts a transformation matrix to a
QuatPos
. The matrix must only consist of a rotation and/or translation component.