#include <esve/engine/dim3/Transform.hxx>
Inheritance diagram for esve::engine::dim3::Transform:

Public Member Functions | |
Matrix elements | |
See the description of Transform. | |
| virtual const types::quat & | rotation () const =0 |
| Rotation state. | |
| virtual void | rotation (const types::quat &a)=0 |
| Rotation state. | |
| virtual const types::pure & | translation () const =0 |
| Translation state. | |
| virtual void | translation (const types::pure &a)=0 |
| Translation state. | |
| virtual types::real | scaling () const =0 |
| Scaling state. | |
| virtual void | scaling (types::real a)=0 |
| Scaling state. | |
Actions | |
The basis argument is similarity-conjugated: *this := basis*action*(basis)^(-1)*(*this)
| |
| virtual void | left_act (const Transform &a)=0 |
| *this := a * (*this) | |
| virtual void | right_act (const Transform &a)=0 |
| *this := (*this) * a | |
| virtual void | act (const Transform &action, const Transform &basis)=0 |
| General differential action. | |
| virtual void | rotate (types::real angle, const types::pure &axis, const Transform &basis=IDENTITY)=0 |
| Rotate around this axis by this angle (in radians). The axis must have unit length. | |
| virtual void | translate (const types::pure &dt, const Transform &basis=IDENTITY)=0 |
| *this := (*this) + dt | |
| virtual void | scalate (types::real ds, const Transform &basis=IDENTITY)=0 |
| *this := (*this)*ds | |
Other operations | |
| virtual void | identity ()=0 |
| *this := 1 | |
| virtual void | invert ()=0 |
| *this := (*this)^(-1) | |
| virtual void | assign (const Transform &a)=0 |
| *this := a | |
| virtual void | normalize ()=0 |
| Snap to closest orthogonal transform. The translation component is retained. | |
| virtual bool | operator== (const Transform &) const =0 |
| Equal by value. | |
| virtual bool | operator!= (const Transform &) const =0 |
| Unequal by value. | |
Static Public Attributes | |
| const Transform & | IDENTITY |
| The group identity element. | |
Transforms are implemented as upper-triangular Moebius transformations of the form
[ s 0 ][ 1 t ][ r 0 ] = [ s*r s*t*r ]
[ 0 1 ][ 0 1 ][ 0 r ] [ 0 r ]
where s is real, t is pure, and r is unitary.
Concatenation gives
[ s1*r1 s1*t1*r1 ][ s2*r2 s2*t2*r2 ]
[ 0 r1 ][ 0 r2 ]
= [ (s1*s2)(r1*r2) (s1*s2)*(r1*t2*conj(r1) + (1/s2)*t1)*(r1*r2) ]
[ 0 r1*r2 ]and the inverse is
[ conj(r) 0 ][ 1 -t ][ 1/s 0 ]
[ 0 conj(r) ][ 0 1 ][ 0 1 ]
= [ (1/s)*conj(r) (1/s)*(-s*conj(r)*t*r)*conj(r) ]
[ 0 conj(r) ]Thus we have found a subgroup of Moebius transformations consisting of operations within R^3.
In the public interface, r is rotation(), t is translation(), and s is scaling().
The order in which these compositional matrices are applied matches that of the 4x4 projective transformations used by OpenGL. In the real-projective (column-major) representation, s corresponds to the reciprocal of the lower-right entry, t corresponds to the 3x1 upper-right column, and r corresponds to the 3x3 upper-left minor. (Of course, there is a bijective correspondence between unit quaternions mod sign and real (unitary) orthogonal 3x3 matrices, both being representations of SO(3).)
+-----------+ +---+ +-----------+ +---+ +-----------+ +---+
| | | | | | | | | | | |
| | | | | | | | | | | |
| 1 | | 0 | | 1 | | t | | r | | 0 |
| | | | * | | | | * | | | |
| | | | | | | | | | | |
+-----------+ +---+ +-----------+ +---+ +-----------+ +---+
+-----------+ +---+ +-----------+ +---+ +-----------+ +---+
| 0 | |1/s| | 0 | | 1 | | 0 | | 1 |
+-----------+ +---+ +-----------+ +---+ +-----------+ +---+
+-----------+ +---+
| | | |
| | | |
= | r | | t |
| | | |
| | | |
+-----------+ +---+
+-----------+ +---+
| 0 | |1/s|
+-----------+ +---+
|
|
Rotation state.
Implemented in esve::engine::dim3::impl::Transform. |
|
|
Rotation state.
Implemented in esve::engine::dim3::impl::Transform. |
1.3.4