URL: https://graphicscomputing.fr/cgp/reference/affine_rt/
Description: Rigid transform: rotation + translation.

# affine_rt

Rigid transform: rotation + translation.

Fields:

- `rotation_transform rotation` - Rotation part of the rigid transform.
- `vec3 translation` - Translation part of the rigid transform, applied after the rotation.

Functions taking it:

- `affine_rt inverse(affine_rt const& T)` - Inverse rigid transform (rotation + translation).
- `std::string type_str(affine_rt const&)` - Type name "affine_rt".
- `std::string str(affine_rt const& T)` - String listing the rotation (quaternion) and translation of the rigid transform.

Functions returning it:

- `affine_rt rotation_around_center(rotation_transform const& R, vec3 const& center)` - Rigid transform that applies the rotation R around center instead of the origin, mapping p to R(p - center) + center.

Operators:

- `affine operator*(affine_rt const& T1, affine const& T2)` - Composition T1 o T2 of a rigid transform (parent) with an affine transform (child), exact for any scaling_xyz.
- `affine operator*(affine const& T1, affine_rt const& T2)` - Composition T1 o T2 of an affine transform with a rigid transform, returned as an affine; asserts that T1.scaling_xyz is uniform (use T1.matrix()*T2.matrix() otherwise).
- `vec3 operator*(affine_rt const& T, vec3 const& p)` - Apply the rigid transform to a point: rotation * p + translation.
- `vec4 operator*(affine_rt const& T, vec4 const& p)` - Apply the rigid transform to a homogeneous vector, the translation being weighted by w.
- `affine_rt operator*(affine_rt const& T1, affine_rt const& T2)` - Composition T1 o T2 of two rigid transforms.
- `affine_rt operator*(affine_rt const& T, rotation_transform const& R)` - Rigid transform T o R: the rotation is applied before T.
- `affine_rt operator*(rotation_transform const& R, affine_rt const& T)` - Rigid transform R o T: the rotation is applied after T, rotating its translation as well.
- `affine_rt operator+(vec3 const& tr, affine_rt const& T)` - Copy of the rigid transform with tr added to its translation.
- `affine_rt operator+(affine_rt const& T, vec3 const& tr)` - Copy of the rigid transform with tr added to its translation.
- `affine_rt operator-(affine_rt const& T, vec3 const& tr)` - Copy of the rigid transform with tr subtracted from its translation.
- `mat4 operator*(affine_rt const& T1, mat4 const& T2)` - Product of the 4x4 matrix of the rigid transform with a mat4.
- `mat4 operator*(mat4 const& T1, affine_rt const& T2)` - Product of a mat4 with the 4x4 matrix of the rigid transform.
- `mat4 operator*(affine_rt const& T1, mat3 const& T2)` - Product of the 4x4 matrix of the rigid transform with a mat3 extended to a mat4.
- `mat4 operator*(mat3 const& T1, affine_rt const& T2)` - Product of a mat3 extended to a mat4 with the 4x4 matrix of the rigid transform.
- `std::ostream& operator<<(std::ostream& s, affine_rt const& T)` - Write str(T) of the rigid transform to the stream.
- `affine_rts operator*(float s, affine_rt const& T)` - Uniform scaling by s applied after the rigid transform (rotation kept, translation and scaling multiplied by s).
- `affine_rts operator*(affine_rt const& T, float s)` - Uniform scaling by s applied after the rigid transform (rotation kept, translation and scaling multiplied by s).
- `affine_rts operator*(affine_rts const& T1, affine_rt const& T2)` - Composition T1 o T2 of a rotation-translation-scaling with a rigid transform.
- `affine_rts operator*(affine_rt const& T1, affine_rts const& T2)` - Composition T1 o T2 of a rigid transform with a rotation-translation-scaling.
- `frame operator*(affine_rt const& T, frame const& f)` - Frame transformed by the rigid transform: orientation and position are rotated, then the position is translated.
