HDK
|
#include "UT_API.h"
#include "UT_Array.h"
#include "UT_Assert.h"
#include "UT_Matrix3.h"
#include "UT_Matrix4.h"
#include "UT_Quaternion.h"
#include "UT_SmallArray.h"
#include "UT_Vector3.h"
#include "UT_Vector4.h"
#include <SYS/SYS_Math.h>
Go to the source code of this file.
Classes | |
class | UT_SlerpCache< PREC > |
struct | UT_Detail::QuatSlerp< T, NORMALIZE_WEIGHTS > |
struct | UT_Detail::QuatSlerp< T, false > |
struct | UT_Detail::QuatSlerp< T, true > |
Namespaces | |
UT_Detail | |
Macros | |
#define | UT_TRANSFORM_COMBINE(M, A) |
#define | IF_UT_TRANSFORM_COMBINE(M, A) |
Enumerations | |
enum | UT_ScaleInheritanceMode { UT_ScaleInheritanceMode::DEFAULT = 0, UT_ScaleInheritanceMode::OFFSET_ONLY, UT_ScaleInheritanceMode::OFFSET_AND_SCALE, UT_ScaleInheritanceMode::SCALE_ONLY, UT_ScaleInheritanceMode::IGNORE_PARENT_LOCAL } |
Scale inheritance modes. More... | |
enum | UT_ParameterTransformMode { UT_ParameterTransformMode::MODE_PRE = 0, UT_ParameterTransformMode::MODE_POST, UT_ParameterTransformMode::MODE_OVERRIDE } |
enum | UT_SLERP_METHOD { UT_SLERP_METHOD::NLERP, UT_SLERP_METHOD::ACCURATE } |
Method of slerp for blending. More... | |
enum | UT_SLERP_FLIP_METHOD { UT_SLERP_FLIP_METHOD::FIRST, UT_SLERP_FLIP_METHOD::SUCCESSIVE } |
Flip method for slerp to ensure consistency during blending. More... | |
Functions | |
template<typename PREC > | |
SYS_FORCE_INLINE UT_Matrix4T < PREC > | UTtransformCombineLocal (const UT_Matrix4T< PREC > &L, const UT_Matrix4T< PREC > &pW, const UT_Matrix4T< PREC > &pL, UT_ScaleInheritanceMode mode=UT_ScaleInheritanceMode::DEFAULT, UT_Matrix4T< PREC > *effective_local=nullptr, UT_Matrix3T< PREC > *pLS_ptr=nullptr, UT_Matrix3T< PREC > *pLS_inv_ptr=nullptr, bool *pLS_init_ptr=nullptr) |
template<typename PREC , UT_ScaleInheritanceMode MODE, bool HAS_PLS> | |
SYS_FORCE_INLINE UT_Matrix4T < PREC > | UTtransformCombineLocalT (const UT_Matrix4T< PREC > &L, const UT_Matrix4T< PREC > &pW, const UT_Matrix4T< PREC > &pL, UT_Matrix4T< PREC > *effective_local=nullptr, UT_Matrix3T< PREC > *pLS_ptr=nullptr, UT_Matrix3T< PREC > *pLS_inv_ptr=nullptr, bool *pLS_init_ptr=nullptr) |
template<typename PREC > | |
UT_Matrix4T< PREC > | UTtransformExtractLocal (const UT_Matrix4T< PREC > &W, const UT_Matrix4T< PREC > &pW, const UT_Matrix4T< PREC > &pL, UT_ScaleInheritanceMode mode=UT_ScaleInheritanceMode::DEFAULT, UT_Matrix4T< PREC > *effective_local=nullptr) |
Extract relative transform with scale inheritance. More... | |
template<typename PREC > | |
void | UTtransformExtractLocal (UT_Matrix4T< PREC > &L, const UT_Matrix4T< PREC > &W, const UT_Matrix4T< PREC > &pW, const UT_Matrix4T< PREC > &pW_inv, const UT_Matrix4T< PREC > &pL, UT_ScaleInheritanceMode mode, UT_Matrix4T< PREC > *effective_local) |
Extract relative transform with scale inheritance. More... | |
template<typename PREC , UT_ScaleInheritanceMode MODE = UT_ScaleInheritanceMode::DEFAULT, bool HAS_EFFECTIVE_LOCAL = false> | |
SYS_FORCE_INLINE void | UTtransformExtractLocalT (UT_Matrix4T< PREC > &L, const UT_Matrix4T< PREC > &W, const UT_Matrix4T< PREC > &pW, const UT_Matrix4T< PREC > &pW_inv, const UT_Matrix4T< PREC > &pL, UT_Matrix4T< PREC > *effective_local) |
Extract relative transform with scale inheritance. More... | |
template<typename PREC , bool NORMALIZE_WEIGHTS = true, UT_SLERP_METHOD METHOD = UT_SLERP_METHOD::ACCURATE, UT_SLERP_FLIP_METHOD FLIP_METHOD = UT_SLERP_FLIP_METHOD::SUCCESSIVE> | |
UT_Matrix4T< PREC > | UTslerp (const UT_Array< UT_Matrix4T< PREC >> &xforms, const UT_Array< PREC > &input_weights) |
Spherically blend transforms by decomposing into separate quaternions. More... | |
template<typename PREC , UT_SLERP_METHOD METHOD = UT_SLERP_METHOD::ACCURATE, UT_SLERP_FLIP_METHOD FLIP_METHOD = UT_SLERP_FLIP_METHOD::SUCCESSIVE> | |
SYS_FORCE_INLINE UT_Matrix4T < PREC > | UTslerp (const UT_Matrix4T< PREC > &xform0, const UT_Matrix4T< PREC > &xform1, const PREC input_weight) |
Spherically blend 2 transforms by decomposing into separate quaternions. More... | |
template<typename PREC , bool NORMALIZE_WEIGHTS = true> | |
UT_QuaternionT< PREC > | UTslerp (const UT_Array< UT_QuaternionT< PREC >> &quats, const UT_Array< PREC > &weights) |
Spherically blend multiple quaternions, provided for interface consistency. More... | |
template<typename PREC , UT_SLERP_METHOD METHOD = UT_SLERP_METHOD::ACCURATE, UT_SLERP_FLIP_METHOD FLIP_METHOD = UT_SLERP_FLIP_METHOD::SUCCESSIVE> | |
UT_Matrix4T< PREC > | UTslerp (const UT_Matrix4T< PREC > &xform0, const UT_Matrix4T< PREC > &xform1, const PREC input_weight, UT_SlerpCache< PREC > *makerotcache) |
template<typename PREC > | |
UT_Matrix4T< PREC > | UTtransformCombineLocal (const UT_Matrix4T< PREC > &L, const UT_Matrix4T< PREC > &pW, const UT_Matrix4T< PREC > &pL, UT_ScaleInheritanceMode mode, UT_Matrix4T< PREC > *effective_local, UT_Matrix3T< PREC > *pLS_ptr, UT_Matrix3T< PREC > *pLS_inv_ptr, bool *pLS_init_ptr) |
template<typename PREC > | |
void | UTcombineParameterTransform (UT_Matrix4T< PREC > &local, const UT_Vector3T< PREC > &parent_local_s, const UT_XformOrder &adjust_ord, const UT_Vector3T< PREC > &parm_t, const UT_Vector3T< PREC > &parm_r, const UT_Vector3T< PREC > &parm_s, const UT_Vector3T< PREC > &parm_p, const UT_Vector3T< PREC > &parm_pr, const UT_ScaleInheritanceMode scalecomp, const UT_ParameterTransformMode mode) |
template<typename PREC > | |
void | UTextractParameterTransform (const UT_Matrix4T< PREC > &local, const UT_Matrix4T< PREC > &inputlocal, const UT_XformOrder &parmorder, const UT_ScaleInheritanceMode scalecomp, const UT_ParameterTransformMode mode, const UT_Vector3T< PREC > &parent_local_s, UT_Vector3T< PREC > &parm_t, UT_Vector3T< PREC > &parm_r, UT_Vector3T< PREC > &parm_s) |
Additional utilities for dealing with transforms
Definition in file UT_TransformUtil.h.
#define IF_UT_TRANSFORM_COMBINE | ( | M, | |
A | |||
) |
#define UT_TRANSFORM_COMBINE | ( | M, | |
A | |||
) |
|
strong |
Enumerator | |
---|---|
MODE_PRE | |
MODE_POST | |
MODE_OVERRIDE |
Definition at line 53 of file UT_TransformUtil.h.
|
strong |
Scale inheritance modes.
Definition at line 29 of file UT_TransformUtil.h.
|
strong |
Flip method for slerp to ensure consistency during blending.
Enumerator | |
---|---|
FIRST | |
SUCCESSIVE |
use hemisphere of first quaternion |
Definition at line 138 of file UT_TransformUtil.h.
|
strong |
Method of slerp for blending.
Enumerator | |
---|---|
NLERP | |
ACCURATE |
normalized lerp of quaternion |
Definition at line 131 of file UT_TransformUtil.h.
|
inline |
Definition at line 1051 of file UT_TransformUtil.h.
|
inline |
Definition at line 1156 of file UT_TransformUtil.h.
|
inline |
Spherically blend transforms by decomposing into separate quaternions.
Definition at line 647 of file UT_TransformUtil.h.
SYS_FORCE_INLINE UT_Matrix4T< PREC > UTslerp | ( | const UT_Matrix4T< PREC > & | xform0, |
const UT_Matrix4T< PREC > & | xform1, | ||
const PREC | input_weight | ||
) |
Spherically blend 2 transforms by decomposing into separate quaternions.
Definition at line 766 of file UT_TransformUtil.h.
UT_QuaternionT< PREC > UTslerp | ( | const UT_Array< UT_QuaternionT< PREC >> & | quats, |
const UT_Array< PREC > & | weights | ||
) |
Spherically blend multiple quaternions, provided for interface consistency.
Definition at line 1042 of file UT_TransformUtil.h.
|
inline |
Spherically blend 2 transforms by decomposing into separate quaternions Also makes use of a cache to avoid calling makeRotationMatrix if the input matrices didn't change. 2 cache entries are used per invocation.
Definition at line 873 of file UT_TransformUtil.h.
|
inline |
Combine a local transform on top of another with scale inheritance options L is modified to contain the effective local transform on return for t.
pW | local transform |
pL | parent world transform |
mode | parent local transform |
pLS_inv_ptr | parent local transform stretch |
pLS_init_ptr | parent local transform stretch_inv |
Definition at line 320 of file UT_TransformUtil.h.
|
inline |
Combine a local transform on top of another with scale inheritance options L is modified to contain the effective local transform on return for t.
pW | local transform |
pL | parent world transform |
mode | parent local transform |
pLS_inv_ptr | parent local transform stretch |
pLS_init_ptr | parent local transform stretch_inv |
Definition at line 320 of file UT_TransformUtil.h.
SYS_FORCE_INLINE UT_Matrix4T< PREC > UTtransformCombineLocalT | ( | const UT_Matrix4T< PREC > & | L, |
const UT_Matrix4T< PREC > & | pW, | ||
const UT_Matrix4T< PREC > & | pL, | ||
UT_Matrix4T< PREC > * | effective_local = nullptr , |
||
UT_Matrix3T< PREC > * | pLS_ptr = nullptr , |
||
UT_Matrix3T< PREC > * | pLS_inv_ptr = nullptr , |
||
bool * | pLS_init_ptr = nullptr |
||
) |
Combine a local transform on top of another with scale inheritance options L is modified to contain the effective local transform on return for t. Same as UTtransformCombineLocal, but with mode passed as a template argument and an optimization with HAS_EFFECTIVE_LOCAL.
pW | local transform |
pL | parent world transform |
effective_local | parent local transform |
pLS_inv_ptr | parent local transform stretch |
pLS_init_ptr | parent local transform stretch_inv |
Definition at line 207 of file UT_TransformUtil.h.
|
inline |
Extract relative transform with scale inheritance.
pW | source world transform |
pL | target parent world |
mode | target parent local |
Definition at line 625 of file UT_TransformUtil.h.
|
inline |
Extract relative transform with scale inheritance.
pW | source world transform |
pW_inv | target parent world |
pL | target parent world |
mode | target parent local |
Definition at line 366 of file UT_TransformUtil.h.
SYS_FORCE_INLINE void UTtransformExtractLocalT | ( | UT_Matrix4T< PREC > & | L, |
const UT_Matrix4T< PREC > & | W, | ||
const UT_Matrix4T< PREC > & | pW, | ||
const UT_Matrix4T< PREC > & | pW_inv, | ||
const UT_Matrix4T< PREC > & | pL, | ||
UT_Matrix4T< PREC > * | effective_local = nullptr |
||
) |
Extract relative transform with scale inheritance.
pW | source world transform |
pW_inv | target parent world |
pL | target parent world |
effective_local | target parent local |
Definition at line 496 of file UT_TransformUtil.h.