SOFA API  1df67014
Open source framework for multi-physics simuation
sofa::type::QuatNoInit< Real > Class Template Reference

#include <Quat.h>

Same as Quat except the values are not initialized by default. More...

Inheritance diagram for sofa::type::QuatNoInit< Real >:

Detailed Description

template<class Real>
class sofa::type::QuatNoInit< Real >

Same as Quat except the values are not initialized by default.

Public Member Functions

constexpr QuatNoInit () noexcept
 
- Public Member Functions inherited from sofa::type::Quat< Real >
constexpr Quat ()
 
constexpr Quat (qNoInit)
 Fast constructor: no initialization. More...
 
 ~Quat ()=default
 
constexpr Quat (Real x, Real y, Real z, Real w)
 
template<class Real2 >
constexpr Quat (const Real2 q[])
 
template<class Real2 >
constexpr Quat (const Quat< Real2 > &q)
 
 Quat (const Vec3 &axis, Real angle)
 
 Quat (const Vec3 &vFrom, const Vec3 &vTo)
 
void set (Real x, Real y, Real z, Real w)
 
const Realptr () const
 Cast into a standard C array of elements. More...
 
Realptr ()
 Cast into a standard C array of elements. More...
 
bool isNormalized ()
 Returns true if norm of Quaternion is one, false otherwise. More...
 
void normalize ()
 Normalize a quaternion. More...
 
void clear ()
 
void fromFrame (const Vec3 &x, const Vec3 &y, const Vec3 &z)
 Convert the reference frame orientation into an orientation quaternion. More...
 
void fromMatrix (const Mat3x3 &m)
 Convert a rotation matrix into an orientation quaternion. More...
 
void toMatrix (Mat3x3 &m) const
 Convert the quaternion into an orientation matrix. More...
 
constexpr void toHomogeneousMatrix (Mat4x4 &m) const
 
constexpr auto rotate (const Vec3 &v) const -> Vec3
 Apply the rotation to a given vector. More...
 
constexpr auto inverseRotate (const Vec3 &v) const -> Vec3
 Apply the inverse rotation to a given vector. More...
 
auto operator+ (const Quat &q1) const -> Quat
 
constexpr auto operator* (const Quat &q1) const -> Quat
 
constexpr auto operator* (const Real &r) const -> Quat
 
auto operator/ (const Real &r) const -> Quat
 
void operator*= (const Real &r)
 
void operator/= (const Real &r)
 
constexpr auto quatVectMult (const Vec3 &vect) const -> Quat
 Given two Quats, multiply them together to get a third quaternion. More...
 
constexpr auto vectQuatMult (const Vec3 &vect) const -> Quat
 
constexpr Realoperator[] (Size index)
 
constexpr const Realoperator[] (Size index) const
 
auto inverse () const -> Quat
 
auto quatToRotationVector () const -> Vec3
 Given a quaternion, compute rotation vector (axis times angle) More...
 
auto toEulerVector () const -> Vec3
 
void slerp (const Quat &a, const Quat &b, Real t, bool allowFlip=true)
 Returns the slerp interpolation of Quaternions a and b, at time t. More...
 
constexpr void buildRotationMatrix (Real m[4][4]) const
 
constexpr void writeOpenGlMatrix (double *m) const
 
constexpr void writeOpenGlMatrix (float *m) const
 
auto axisToQuat (Vec3 a, Real phi) -> Quat
 Given an axis and angle, compute quaternion. More...
 
void quatToAxis (Vec3 &a, Real &phi) const
 Given a quaternion, compute an axis and angle. More...
 
void setFromUnitVectors (const Vec3 &vFrom, const Vec3 &vTo)
 Sets this quaternion to the rotation required to rotate direction vector vFrom to direction vector vTo. vFrom and vTo are assumed to be normalized. More...
 
auto slerp (const Quat &q1, Real t) const -> Quat
 
auto slerp2 (const Quat &q1, Real t) const -> Quat
 
void operator+= (const Quat &q2)
 
constexpr void operator*= (const Quat &q1)
 
bool operator== (const Quat &q) const
 
bool operator!= (const Quat &q) const
 

Additional Inherited Members

- Static Public Attributes inherited from sofa::type::Quat< Real >
static constexpr Size static_size = 4
 
static constexpr Size total_size = 4
 Compile-time constant specifying the number of scalars within this vector (equivalent to the size() method) More...
 
static constexpr Size spatial_dimensions = 3
 Compile-time constant specifying the number of dimensions of space (NOT equivalent to total_size for quaternions) More...
 
- Static Public Member Functions inherited from sofa::type::Quat< Real >
static Quat identity ()
 
static auto createQuaterFromFrame (const Vec3 &lox, const Vec3 &loy, const Vec3 &loz) -> Quat
 
static auto createFromRotationVector (const Vec3 &a) -> Quat
 Create using rotation vector (axis*angle) given in parent coordinates. More...
 
static auto createQuaterFromEuler (const Vec3 &v, EulerOrder order=EulerOrder::ZYX) -> Quat
 
static auto fromEuler (Real alpha, Real beta, Real gamma, EulerOrder order=EulerOrder::ZYX) -> Quat
 Create a quaternion from Euler angles. More...
 
static auto createFromRotationVector (Real a0, Real a1, Real a2) -> Quat
 Create using the entries of a rotation vector (axis*angle) given in parent coordinates. More...
 
static auto set (const Vec3 &a)
 Create using rotation vector (axis*angle) given in parent coordinates. More...
 
static auto set (Real a0, Real a1, Real a2)
 Create using using the entries of a rotation vector (axis*angle) given in parent coordinates. More...
 
static auto quatDiff (Quat a, const Quat &b) -> Quat
 Return the quaternion resulting of the movement between 2 quaternions. More...
 
static auto angularDisplacement (const Quat &a, const Quat &b) -> Vec3
 Return the eulerian vector resulting of the movement between 2 quaternions. More...
 
static Size size ()
 

Constructor details

◆ QuatNoInit()

template<class Real >
constexpr sofa::type::QuatNoInit< Real >::QuatNoInit ( )
inlineconstexprnoexcept