Transform#

struct Transform#

3D transformation represented by position and rotation.

This structure represents a 3D transformation consisting of a position (translation) and rotation (quaternion). It provides composition operations through multiplication and is commonly used for object positioning and coordinate space transformations.

Public Functions

inline Transform()#

Default constructor creating identity transform.

Creates a transform with zero translation and identity rotation (no rotation).

inline Transform(const Vec3 &v, const Quat &q = Quat())#

Constructor with position and optional rotation.

Parameters:
  • v[in] Position vector

  • q[in] Rotation quaternion (default: identity rotation)

inline Transform operator*(const Transform &rhs) const#

Transform composition operator.

Composes two transforms such that the result represents applying this transform followed by the rhs transform.

Parameters:

rhs[in] The transform to compose with this transform

Returns:

The composed transform

Public Members

Vec3 p#

Position (translation) component.

Quat q#

Rotation component as a quaternion.