Blender V5.3
blender::math::DualQuaternionBase< T > Struct Template Reference

#include <BLI_math_quaternion_types.hh>

Public Member Functions

 DualQuaternionBase ()=delete
Dual-Quaternion
 DualQuaternionBase (const QuaternionBase< T > &non_dual, const QuaternionBase< T > &dual)
 DualQuaternionBase (const QuaternionBase< T > &non_dual, const QuaternionBase< T > &dual, const MatBase< T, 4, 4 > &scale_mat)
DualQuaternionBase & operator*= (const T &t) &
DualQuaternionBase & operator+= (const DualQuaternionBase &b) &

Static Public Member Functions

static DualQuaternionBase identity ()

Public Attributes

QuaternionBase< T > quat
QuaternionBase< T > trans
MatBase< T, 4, 4 > scale
T scale_weight
T quat_weight

Friends

DualQuaternionBase operator* (const DualQuaternionBase &a, const T &t)
DualQuaternionBase operator* (const T &t, const DualQuaternionBase &a)
DualQuaternionBase operator+ (const DualQuaternionBase &a, const DualQuaternionBase &b)
bool operator== (const DualQuaternionBase &a, const DualQuaternionBase &b)=default
std::ostream & operator<< (std::ostream &stream, const DualQuaternionBase &rot)

Detailed Description

template<typename T>
struct blender::math::DualQuaternionBase< T >

A math::DualQuaternionBase<T> implements dual-quaternion skinning with scale aware transformation. It allows volume preserving deformation for skinning.

The type is implemented so that multiple weighted math::DualQuaternionBase<T> can be aggregated into a final rotation. Calling normalize(dual_quat) is mandatory before trying to transform points with it.

Definition at line 204 of file BLI_math_quaternion_types.hh.

Constructor & Destructor Documentation

◆ DualQuaternionBase() [1/3]

◆ DualQuaternionBase() [2/3]

template<typename T>
blender::math::DualQuaternionBase< T >::DualQuaternionBase ( const QuaternionBase< T > & non_dual,
const QuaternionBase< T > & dual )

Dual quaternion without scaling.

Definition at line 352 of file BLI_math_quaternion.hh.

References blender::BLI_assert(), blender::math::is_unit_scale(), quat, quat_weight, scale_weight, and trans.

◆ DualQuaternionBase() [3/3]

template<typename T>
blender::math::DualQuaternionBase< T >::DualQuaternionBase ( const QuaternionBase< T > & non_dual,
const QuaternionBase< T > & dual,
const MatBase< T, 4, 4 > & scale_mat )

Dual quaternion with scaling.

Definition at line 360 of file BLI_math_quaternion.hh.

References blender::BLI_assert(), blender::math::is_unit_scale(), quat, quat_weight, scale, scale_weight, and trans.

Member Function Documentation

◆ identity()

template<typename T>
DualQuaternionBase blender::math::DualQuaternionBase< T >::identity ( )
inlinestatic

Static functions.

Definition at line 242 of file BLI_math_quaternion_types.hh.

Referenced by blender::math::normalize().

◆ operator*=()

template<typename T>
DualQuaternionBase< T > & blender::math::DualQuaternionBase< T >::operator*= ( const T & t) &

Methods. Operators. Apply a scalar weight to a dual quaternion.

Definition at line 417 of file BLI_math_quaternion.hh.

References blender::BLI_assert(), DualQuaternionBase(), quat, quat_weight, scale, scale_weight, T, and trans.

◆ operator+=()

template<typename T>
DualQuaternionBase< T > & blender::math::DualQuaternionBase< T >::operator+= ( const DualQuaternionBase< T > & b) &

Add two weighted dual-quaternions rotations.

Definition at line 371 of file BLI_math_quaternion.hh.

References b, blender::math::dot(), DualQuaternionBase(), quat, quat_weight, scale, scale_weight, T, and trans.

◆ operator* [1/2]

template<typename T>
DualQuaternionBase operator* ( const DualQuaternionBase< T > & a,
const T & t )
friend

Apply a scalar weight to a dual quaternion.

Definition at line 258 of file BLI_math_quaternion_types.hh.

◆ operator* [2/2]

template<typename T>
DualQuaternionBase operator* ( const T & t,
const DualQuaternionBase< T > & a )
friend

Apply a scalar weight to a dual quaternion.

Definition at line 266 of file BLI_math_quaternion_types.hh.

◆ operator+

template<typename T>
DualQuaternionBase operator+ ( const DualQuaternionBase< T > & a,
const DualQuaternionBase< T > & b )
friend

Add two weighted dual-quaternions rotations.

Definition at line 274 of file BLI_math_quaternion_types.hh.

◆ operator<<

template<typename T>
std::ostream & operator<< ( std::ostream & stream,
const DualQuaternionBase< T > & rot )
friend

Definition at line 283 of file BLI_math_quaternion_types.hh.

◆ operator==

template<typename T>
bool operator== ( const DualQuaternionBase< T > & a,
const DualQuaternionBase< T > & b )
friend

Member Data Documentation

◆ quat

◆ quat_weight

template<typename T>
T blender::math::DualQuaternionBase< T >::quat_weight

The weight of this dual-quaternion. Used for and summation & normalizing. A weight of 0 means the quaternion is not valid.

Definition at line 224 of file BLI_math_quaternion_types.hh.

Referenced by DualQuaternionBase(), DualQuaternionBase(), blender::math::is_normalized(), blender::math::normalize(), operator*=(), operator+=(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().

◆ scale

template<typename T>
MatBase<T, 4, 4> blender::math::DualQuaternionBase< T >::scale

Scaling is saved separately to handle cases of non orthonormal axes, non uniform scale and flipped axes.

Definition at line 217 of file BLI_math_quaternion_types.hh.

Referenced by DualQuaternionBase(), blender::math::normalize(), operator*=(), operator+=(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::math::transform_point().

◆ scale_weight

◆ trans


The documentation for this struct was generated from the following files: