Get Involved


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.


  QuatPos::QuatPos() [code]

Constructs an uninitialized QuatPos.

 explicit QuatPos::QuatPos(const Quaternion& quat) [code]

Constructs a QuatPos from a quaternion.

  QuatPos::QuatPos(const Quaternion& quat, const Float3& pos) [code]

Constructs a QuatPos from a quaternion and a translation.

Transformation Functions

 QuatPos QuatPos::inverted() const [code]

Returns a QuatPos that performs the inverse transformation of the given QuatPos.

Float3 operator*(const QuatPos& qp, const Float3& v) [code]

Transforms v using qp. Equivalent to qp.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 another QuatPos or a Quaternion. The resulting QuatPos performs the transformation performed by b followed by the transformation performed by a.

Creation Functions

 static QuatPos QuatPos::identity() [code]

Returns the identity QuatPos{{0, 0, 0, 1}, {0, 0, 0}}.

 static QuatPos QuatPos::makeTranslation(const Float3& pos) [code]

Returns a QuatPos that performs translation only.

 static QuatPos QuatPos::makeRotation(const Float3& unitAxis, float radians) [code]

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.

 static QuatPos QuatPos::fromOrtho(const Float3x4& m) [code]
 static QuatPos QuatPos::fromOrtho(const Float4x4& m) [code]

Converts a transformation matrix to a QuatPos. The matrix must only consist of a rotation and/or translation component.