MeshLib C++ Docs
Loading...
Searching...
No Matches
MRRigidScaleXf3.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRRigidXf3.h"
4
5namespace MR
6{
9
10
13template <typename T>
15{
16 using V = Vector3<T>;
17
18 V a;
19 V b;
20 T s = 1;
21
22 constexpr RigidScaleXf3() noexcept = default;
23 constexpr RigidScaleXf3( const V & a, const V & b, T s ) noexcept : a( a ), b( b ), s( s ) { }
24 template <typename U>
25 constexpr explicit RigidScaleXf3( const RigidScaleXf3<U> & xf ) noexcept : a( xf.a ), b( xf.b ), s( T( xf.s ) ) { }
26 template <typename U>
27 constexpr explicit RigidScaleXf3( const RigidXf3<U> & xf ) noexcept : a( xf.a ), b( xf.b ), s( 1 ) { }
28
30 [[nodiscard]] AffineXf3<T> rigidScaleXf() const { return { s * Matrix3<T>( Quaternion<T>( a, a.length() ) ), b }; }
31
33 [[nodiscard]] AffineXf3<T> linearXf() const { return { s * Matrix3<T>::approximateLinearRotationMatrixFromEuler( a ), b }; }
34};
35
36}
AffineXf3< T > linearXf() const
converts this into not-rigid transformation but with matrix, which linearly depends on angles
Definition MRRigidScaleXf3.h:33
constexpr RigidScaleXf3(const RigidXf3< U > &xf) noexcept
Definition MRRigidScaleXf3.h:27
constexpr RigidScaleXf3() noexcept=default
T s
scaling
Definition MRRigidScaleXf3.h:20
auto length() const
Definition MRVector3.h:69
V b
shift
Definition MRRigidScaleXf3.h:19
V a
rotation angles relative to x,y,z axes
Definition MRRigidScaleXf3.h:18
constexpr RigidScaleXf3(const RigidScaleXf3< U > &xf) noexcept
Definition MRRigidScaleXf3.h:25
AffineXf3< T > rigidScaleXf() const
converts this into rigid (with scale) transformation, which non-linearly depends on angles
Definition MRRigidScaleXf3.h:30
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRMatrix3.h:24
Definition MRQuaternion.h:16
Definition MRRigidScaleXf3.h:15
Definition MRRigidXf3.h:16
Definition MRVector3.h:33