template<class T>
Magnum::SceneGraph::BasicRigidMatrixTransformation3D class

Three-dimensional rigid transformation implemented using matrices.

Unlike BasicMatrixTransformation3D this class allows only rotation, reflection and translation (no scaling or setting arbitrary transformations). This allows to use Math::Matrix4::invertedRigid() for faster computation of inverse transformations.

Base classes

template<class T>
class AbstractBasicTranslationRotation3D
Base transformation for three-dimensional scenes supporting translation and rotation.

Public types

using DataType = Math::Matrix4<T>
Underlying transformation type.

Public functions

auto transformation() const -> Math::Matrix4<T>
Object transformation.
auto setTransformation(const Math::Matrix4<T>& transformation) -> Object<BasicRigidMatrixTransformation3D<T>>&
Set transformation.
auto resetTransformation() -> Object<BasicRigidMatrixTransformation3D<T>>&
Reset object transformation.
auto normalizeRotation() -> Object<BasicRigidMatrixTransformation3D<T>>&
Normalize rotation part.
auto transform(const Math::Matrix4<T>& transformation) -> Object<BasicRigidMatrixTransformation3D<T>>&
Transform object.
auto transformLocal(const Math::Matrix4<T>& transformation) -> Object<BasicRigidMatrixTransformation3D<T>>&
Transform object as a local transformation.
auto translate(const Math::Vector3<T>& vector) -> Object<BasicRigidMatrixTransformation3D<T>>&
Translate object.
auto translateLocal(const Math::Vector3<T>& vector) -> Object<BasicRigidMatrixTransformation3D<T>>&
Translate object as a local transformation.
auto rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis) -> Object<BasicRigidMatrixTransformation3D<T>>&
Rotate object.
auto rotateLocal(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis) -> Object<BasicRigidMatrixTransformation3D<T>>&
Rotate object as a local transformation.
auto rotateX(Math::Rad<T> angle) -> Object<BasicRigidMatrixTransformation3D<T>>&
Rotate object around X axis.
auto rotateXLocal(Math::Rad<T> angle) -> Object<BasicRigidMatrixTransformation3D<T>>&
Rotate object around X axis as a local transformation.
auto rotateY(Math::Rad<T> angle) -> Object<BasicRigidMatrixTransformation3D<T>>&
Rotate object around Y axis.
auto rotateYLocal(Math::Rad<T> angle) -> Object<BasicRigidMatrixTransformation3D<T>>&
Rotate object around Y axis as a local transformation.
auto rotateZ(Math::Rad<T> angle) -> Object<BasicRigidMatrixTransformation3D<T>>&
Rotate object around Z axis.
auto rotateZLocal(Math::Rad<T> angle) -> Object<BasicRigidMatrixTransformation3D<T>>&
Rotate object around Z axis as a local transformation.
auto reflect(const Math::Vector3<T>& normal) -> Object<BasicRigidMatrixTransformation3D<T>>&
Reflect object.
auto reflectLocal(const Math::Vector3<T>& normal) -> Object<BasicRigidMatrixTransformation3D<T>>&
Reflect object as a local transformation.

Private functions

void doResetTransformation() override final virtual
Polymorphic implementation for resetTransformation()
void doRotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis) override final virtual
Polymorphic implementation for rotate()
void doRotateLocal(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis) override final virtual
Polymorphic implementation for rotateLocal()
void doRotateX(Math::Rad<T> angle) override final virtual
Polymorphic implementation for rotateX()
void doRotateXLocal(Math::Rad<T> angle) override final virtual
Polymorphic implementation for rotateXLocal()
void doRotateY(Math::Rad<T> angle) override final virtual
Polymorphic implementation for rotateY()
void doRotateYLocal(Math::Rad<T> angle) override final virtual
Polymorphic implementation for rotateYLocal()
void doRotateZ(Math::Rad<T> angle) override final virtual
Polymorphic implementation for rotateZ()
void doRotateZLocal(Math::Rad<T> angle) override final virtual
Polymorphic implementation for rotateZLocal()

Function documentation

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::setTransformation(const Math::Matrix4<T>& transformation)

Set transformation.

Returns Reference to self (for method chaining)

Expects that the matrix represents rigid transformation.

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::resetTransformation()

Reset object transformation.

Returns Reference to self (for method chaining)

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::normalizeRotation()

Normalize rotation part.

Returns Reference to self (for method chaining)

Normalizes the rotation part using Math::Algorithms::gramSchmidtOrthonormalize() to prevent rounding errors when rotating the object subsequently.

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::transform(const Math::Matrix4<T>& transformation)

Transform object.

Returns Reference to self (for method chaining)

Expects that the matrix represents rigid transformation.

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::transformLocal(const Math::Matrix4<T>& transformation)

Transform object as a local transformation.

Similar to the above, except that the transformation is applied before all others.

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::translate(const Math::Vector3<T>& vector)

Translate object.

Returns Reference to self (for method chaining)

Same as calling transform() with Math::Matrix4::translation().

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::translateLocal(const Math::Vector3<T>& vector)

Translate object as a local transformation.

Similar to the above, except that the transformation is applied before all others. Same as calling transformLocal() with Math::Matrix4::translation().

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis)

Rotate object.

Parameters
angle Angle (counterclockwise)
normalizedAxis Normalized rotation axis
Returns Reference to self (for method chaining)

Same as calling transform() with Math::Matrix4::rotation().

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::rotateLocal(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis)

Rotate object as a local transformation.

Similar to the above, except that the transformation is applied before all others. Same as calling transformLocal() with Math::Matrix4::rotation().

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::rotateX(Math::Rad<T> angle)

Rotate object around X axis.

Parameters
angle Angle (counterclockwise)
Returns Reference to self (for method chaining)

Same as calling transform() with Math::Matrix4::rotationX().

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::rotateXLocal(Math::Rad<T> angle)

Rotate object around X axis as a local transformation.

Similar to the above, except that the transformation is applied before all others. Same as calling transformLocal() with Math::Matrix4::rotationX().

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::rotateY(Math::Rad<T> angle)

Rotate object around Y axis.

Parameters
angle Angle (counterclockwise)
Returns Reference to self (for method chaining)

Same as calling transform() with Math::Matrix4::rotationY().

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::rotateYLocal(Math::Rad<T> angle)

Rotate object around Y axis as a local transformation.

Similar to the above, except that the transformation is applied before all others. Same as calling transformLocal() with Math::Matrix4::rotationY().

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::rotateZ(Math::Rad<T> angle)

Rotate object around Z axis.

Parameters
angle Angle (counterclockwise)
Returns Reference to self (for method chaining)

Same as calling transform() with Math::Matrix4::rotationZ().

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::rotateZLocal(Math::Rad<T> angle)

Rotate object around Z axis as a local transformation.

Similar to the above, except that the transformation is applied before all others. Same as calling transformLocal() with Math::Matrix4::rotationZ().

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::reflect(const Math::Vector3<T>& normal)

Reflect object.

Parameters
normal Normal of the plane through which to reflect (normalized)
Returns Reference to self (for method chaining)

Same as calling transform() with Math::Matrix4::reflection().

template<class T>
Object<BasicRigidMatrixTransformation3D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::reflectLocal(const Math::Vector3<T>& normal)

Reflect object as a local transformation.

Similar to the above, except that the transformation is applied before all others. Same as calling transformLocal() with Math::Matrix4::reflection().

template<class T>
void Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::doRotateX(Math::Rad<T> angle) override final virtual private

Polymorphic implementation for rotateX()

Default implementation calls rotate() with Math::Vector3::xAxis().

template<class T>
void Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::doRotateXLocal(Math::Rad<T> angle) override final virtual private

Polymorphic implementation for rotateXLocal()

Default implementation calls rotateLocal() with Math::Vector3::xAxis().

template<class T>
void Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::doRotateY(Math::Rad<T> angle) override final virtual private

Polymorphic implementation for rotateY()

Default implementation calls rotate() with Math::Vector3::yAxis().

template<class T>
void Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::doRotateYLocal(Math::Rad<T> angle) override final virtual private

Polymorphic implementation for rotateYLocal()

Default implementation calls rotateLocal() with Math::Vector3::yAxis().

template<class T>
void Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::doRotateZ(Math::Rad<T> angle) override final virtual private

Polymorphic implementation for rotateZ()

Default implementation calls rotate() with Math::Vector3::zAxis().

template<class T>
void Magnum::SceneGraph::BasicRigidMatrixTransformation3D<T>::doRotateZLocal(Math::Rad<T> angle) override final virtual private

Polymorphic implementation for rotateZLocal()

Default implementation calls rotateLocal() with Math::Vector3::zAxis().