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

#include <BLI_math_quaternion_types.hh>

Public Member Functions

 DualQuaternionBase ()=delete
 
 BLI_STRUCT_EQUALITY_OPERATORS_5 (DualQuaternionBase, quat, trans, quat_weight, scale_weight, scale) friend std
 
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)
 
DualQuaternionBaseoperator*= (const T &t)
 
DualQuaternionBaseoperator+= (const DualQuaternionBase &b)
 

Static Public Member Functions

static DualQuaternionBase identity ()
 

Public Attributes

QuaternionBase< Tquat
 
QuaternionBase< Ttrans
 
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)
 

Detailed Description

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

A blender::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 blender::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 188 of file BLI_math_quaternion_types.hh.

Constructor & Destructor Documentation

◆ DualQuaternionBase() [1/3]

template<typename T >
blender::math::DualQuaternionBase< T >::DualQuaternionBase ( )
delete

◆ 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 346 of file BLI_math_quaternion.hh.

References BLI_assert, and blender::math::is_unit_scale().

◆ 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 354 of file BLI_math_quaternion.hh.

References BLI_assert, and blender::math::is_unit_scale().

Member Function Documentation

◆ BLI_STRUCT_EQUALITY_OPERATORS_5()

template<typename T >
blender::math::DualQuaternionBase< T >::BLI_STRUCT_EQUALITY_OPERATORS_5 ( DualQuaternionBase< T > ,
quat ,
trans ,
quat_weight ,
scale_weight ,
scale  )
inline

Definition at line 265 of file BLI_math_quaternion_types.hh.

References rot.

◆ identity()

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

Static functions.

Definition at line 226 of file BLI_math_quaternion_types.hh.

References blender::math::DualQuaternionBase< T >::DualQuaternionBase().

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

◆ operator*=()

◆ operator+=()

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

Add two weighted dual-quaternions rotations.

Definition at line 365 of file BLI_math_quaternion.hh.

References b, and blender::math::DualQuaternionBase< T >::quat.

Friends And Related Symbol Documentation

◆ 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 242 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 250 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 258 of file BLI_math_quaternion_types.hh.

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 208 of file BLI_math_quaternion_types.hh.

Referenced by blender::math::is_normalized(), blender::math::normalize(), blender::math::DualQuaternionBase< T >::operator*=(), blender::math::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 201 of file BLI_math_quaternion_types.hh.

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

◆ scale_weight

◆ trans


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