MeshLib
 
Loading...
Searching...
No Matches
MRRigidXf3.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRAffineXf3.h"
4#include "MRQuaternion.h"
5
6namespace MR
7{
8
11template <typename T>
13{
14 using V = Vector3<T>;
15
16 V a;
17 V b;
18
19 constexpr RigidXf3() noexcept = default;
20 constexpr RigidXf3( const V & a, const V & b ) noexcept : a( a ), b( b ) { }
21 template <typename U>
22 constexpr explicit RigidXf3( const RigidXf3<U> & xf ) noexcept : a( xf.a ), b( xf.b ) { }
23
25 [[nodiscard]] AffineXf3<T> rigidXf() const { return { Matrix3<T>( Quaternion<T>( a, a.length() ) ), b }; }
26
29};
30
31} // namespace MR
Definition MRCameraOrientationPlugin.h:7
Definition MRMesh/MRAffineXf.h:14
Definition MRMesh/MRMatrix3.h:13
Definition MRQuaternion.h:13
Definition MRRigidXf3.h:13
V b
shift
Definition MRRigidXf3.h:17
constexpr RigidXf3(const RigidXf3< U > &xf) noexcept
Definition MRRigidXf3.h:22
constexpr RigidXf3() noexcept=default
V a
rotation angles relative to x,y,z axes
Definition MRRigidXf3.h:16
AffineXf3< T > linearXf() const
converts this into not-rigid transformation but with matrix, which linearly depends on angles
Definition MRRigidXf3.h:28
AffineXf3< T > rigidXf() const
converts this into rigid transformation, which non-linearly depends on angles
Definition MRRigidXf3.h:25
Definition MRMesh/MRVector3.h:19
auto length() const
Definition MRMesh/MRVector3.h:47