affine_rts
Similarity transform: rotation + translation + uniform scaling.
Fields and methods
Members of the struct affine_rts. Most of what you do with a CGP type goes through the free functions listed below.
Fields
rotation_transform rotation | Rotation part of the similarity transform. |
vec3 translation | Translation part of the similarity transform, applied after the scaling and the rotation. |
float scaling | Uniform scaling factor, applied before the rotation (default 1). |
Methods
affine_rts() | Builds the identity transform (identity rotation, zero translation, scaling 1).3 overloads src |
affine_rts(affine_rt const& T) | Builds the similarity with the rotation and translation of a rigid transform and scaling 1 (implicit conversion). src |
affine_rts(rotation_transform const& rotation, vec3 const& translation, float scaling) | Builds the similarity p -> scaling*(rotation*p) + translation (explicit). src |
| Sets the uniform scaling factor and returns a reference to the transform. src | |
| Sets the translation and returns a reference to the transform. src | |
| Sets the rotation and returns a reference to the transform. src | |
| Returns the 4x4 matrix ((s R, t), (0, 1)) of the transform. src |
Functions taking a affine_rts
Transform 1
Convert 2
std::string str(affine_rts const& T)String listing the rotation (quaternion), translation and scaling of the transform.
Functions returning a affine_rts
None.
Operators
Show the 24 operators (+, -, *, ==, ...)
operator*
10 overloadsaffine operator*(affine_rts const& T1, affine const& T2)sourceComposition T1 o T2 of a rotation-translation-scaling (parent) with an affine transform (child), exact for any scaling_xyz.
vec3 operator*(affine_rts const& T, vec3 const& p)sourceApply the transform to a point: scaling * (rotation * p) + translation.
vec4 operator*(affine_rts const& T, vec4 const& p)sourceApply the transform to a homogeneous vector, the translation being weighted by w.
affine_rts operator*(affine_rts const& T1, affine_rts const& T2)sourceComposition T1 o T2 of two rotation-translation-scaling transforms.
affine_rts operator*(affine_rts const& T, rotation_transform const& R)sourceTransform T o R: the rotation is applied before T.
affine_rts operator*(float s, affine_rts const& T)sourceCopy of the transform with its scaling multiplied by s, the translation being left unchanged.
affine_rts operator*(affine_rts const& T, float s)sourceCopy of the transform with its scaling multiplied by s, the translation being left unchanged.
affine_rts operator*(affine_rts const& T1, affine_rt const& T2)sourceComposition T1 o T2 of a rotation-translation-scaling with a rigid transform.
mat4 operator*(affine_rts const& T1, mat4 const& T2)sourceProduct of the 4x4 matrix of the transform with a mat4.
mat4 operator*(affine_rts const& T1, mat3 const& T2)sourceProduct of the 4x4 matrix of the transform with a mat3 extended to a mat4.
affine_rts operator+(affine_rts const& T, vec3 const& tr)Copy of the transform with tr added to its translation.
affine_rts operator-(affine_rts const& T, vec3 const& tr)Copy of the transform with tr subtracted from its translation.
affine_rts operator/(affine_rts const& T, float s)Copy of the transform with its scaling divided by s, the translation being left unchanged.
std::ostream& operator<<(std::ostream& s, affine_rts const& T)Write str(T) of the transform to the stream.
Documented on another page
operator*Composition T1 o T2 of an affine transform with a rotation-translation-scaling, returned as an affine; asserts that T1.scaling_xyz is uniform (use T1.matrix()*T2.matrix() otherwise).onaffineoperator*x33 overloadsonrotation_transformoperator*x33 overloadsonaffine_rtoperator*Product of a mat4 with the 4x4 matrix of the transform.onmat4operator*Product of a mat3 extended to a mat4 with the 4x4 matrix of the transform.onmat3operator+Copy of the transform with tr added to its translation.onvec3