affine_rt
Rigid transform: rotation + translation.
Fields and methods
Members of the struct affine_rt. Most of what you do with a CGP type goes through the free functions listed below.
Fields
rotation_transform rotation | Rotation part of the rigid transform. |
vec3 translation | Translation part of the rigid transform, applied after the rotation. |
Methods
affine_rt() | Builds the identity transform (identity rotation, zero translation).3 overloads src |
affine_rt(rotation_transform const& rotation) | Builds a pure rotation with zero translation (explicit). src |
affine_rt(rotation_transform const& rotation, vec3 const& translation) | Builds the rigid transform p -> rotation*p + translation (explicit). src |
| Returns the 4x4 matrix ((R, t), (0, 1)) of the transform. src | |
| Returns the rigid transform of a mat4, with the translation of its last column and the rotation of its 3x3 block divided by the norm of the first row (a uniform scaling is thus dropped; identity rotation if that norm is below 1e-5). src | |
| Sets the translation and returns a reference to the transform. src | |
| Sets the rotation and returns a reference to the transform. src |
Functions taking a affine_rt
Transform 1
Convert 2
std::string str(affine_rt const& T)String listing the rotation (quaternion) and translation of the rigid transform.
Functions returning a affine_rt
Compute 1
Documented on another page
rotation_around_centerRigid transform that applies the rotation R around center instead of the origin, mapping p to R(p - center) + center.onrotation_transform
Operators
Show the 20 operators (+, -, *, ==, ...)
operator*
11 overloadsaffine operator*(affine_rt const& T1, affine const& T2)sourceComposition T1 o T2 of a rigid transform (parent) with an affine transform (child), exact for any scaling_xyz.
vec3 operator*(affine_rt const& T, vec3 const& p)sourceApply the rigid transform to a point: rotation * p + translation.
vec4 operator*(affine_rt const& T, vec4 const& p)sourceApply the rigid transform to a homogeneous vector, the translation being weighted by w.
affine_rt operator*(affine_rt const& T1, affine_rt const& T2)sourceComposition T1 o T2 of two rigid transforms.
affine_rt operator*(affine_rt const& T, rotation_transform const& R)sourceRigid transform T o R: the rotation is applied before T.
mat4 operator*(affine_rt const& T1, mat4 const& T2)sourceProduct of the 4x4 matrix of the rigid transform with a mat4.
mat4 operator*(affine_rt const& T1, mat3 const& T2)sourceProduct of the 4x4 matrix of the rigid transform with a mat3 extended to a mat4.
affine_rts operator*(float s, affine_rt const& T)sourceUniform 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)sourceUniform scaling by s applied after the rigid transform (rotation kept, translation and scaling multiplied by s).
affine_rts operator*(affine_rt const& T1, affine_rts const& T2)sourceComposition T1 o T2 of a rigid transform with a rotation-translation-scaling.
frame operator*(affine_rt const& T, frame const& f)sourceFrame transformed by the rigid transform: orientation and position are rotated, then the position is translated.
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.
std::ostream& operator<<(std::ostream& s, affine_rt const& T)Write str(T) of the rigid transform to the stream.
Documented on another page
operator*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).onaffineoperator*Rigid transform R o T: the rotation is applied after T, rotating its translation as well.onrotation_transformoperator*Product of a mat4 with the 4x4 matrix of the rigid transform.onmat4operator*Product of a mat3 extended to a mat4 with the 4x4 matrix of the rigid transform.onmat3operator*Composition T1 o T2 of a rotation-translation-scaling with a rigid transform.onaffine_rtsoperator+Copy of the rigid transform with tr added to its translation.onvec3