7 #ifndef __GU_AgentXform__
8 #define __GU_AgentXform__
30 , myRotate(0, 0, 0, 0)
31 , myTranslate(0, 0, 0)
51 myRotate.assign(0, 0, 0, 0);
52 myTranslate.assign(0, 0, 0);
58 myTranslate.assign(0, 0, 0);
69 myStretch.setScale(sx, sy, sz);
71 myTranslate.assign(tx, ty, tz);
80 myStretch.setScale(s);
89 S& sx,
S& sy,
S& sz)
const
101 sx = myStretch(0, 0);
102 sy = myStretch(1, 1);
103 sz = myStretch(2, 2);
110 myStretch.lerp(a.myStretch, b.myStretch, t);
112 if (
dot(a.myRotate, b.myRotate) >= 0)
113 myRotate.lerp(a.myRotate, b.myRotate, t);
115 myRotate.lerp(a.myRotate, -b.myRotate, t);
119 myTranslate =
SYSlerp(a.myTranslate, b.myTranslate, t);
126 myStretch.lerp(a.myStretch, b.myStretch, t);
127 myRotate.lerp(a.myRotate, b.myRotate, t);
128 myTranslate =
SYSlerp(a.myTranslate, b.myTranslate, t);
133 myStretch += xform.myStretch *
s;
134 if (
dot(myRotate, xform.myRotate) >= 0)
135 myRotate += xform.myRotate *
s;
137 myRotate += xform.myRotate * -
s;
138 myTranslate += xform.myTranslate *
s;
144 myRotate.normalize();
146 myTranslate += myRotate.rotate(xform.myTranslate * t);
152 if (
dot(myRotate, new_r) < 0)
155 myRotate.lerp(myRotate, new_r, t);
162 if (!myStretch.isIdentity())
165 myRotate.getRotationMatrix(sr);
170 myRotate.getTransformMatrix(m);
194 t.
x(), t.
y(), t.
z(), r.
x(), r.
y(), r.
z(),
195 s.
x(), s.
y(), s.
z());
208 if (
dot(ref, myRotate) <= 0)
210 myRotate = -myRotate;
void leftMult(const UT_SymMatrix3T< S > &m)
Multiply given symmetric matrix on the left.
UT_SymMatrix3T< T > averagedSymMatrix3() const
Convert this to a symmetric matrix, using averaged components.
bool makeRigidMatrix(UT_Matrix3T< T > *stretch=nullptr, bool reverse=true, const int max_iter=64, const T rel_tol=FLT_EPSILON)
constexpr SYS_FORCE_INLINE T & z() noexcept
GLboolean GLboolean GLboolean GLboolean a
Generic symmetric 3x3 matrix.
UT_Matrix2T< T > SYSlerp(const UT_Matrix2T< T > &v1, const UT_Matrix2T< T > &v2, S t)
#define UT_ASSERT_MSG(ZZ,...)
GA_API const UT_StringHolder scale
fpreal64 dot(const CE_VectorT< T > &a, const CE_VectorT< T > &b)
int explode(const UT_XformOrder &order, UT_Vector3F &r, UT_Vector3F &s, UT_Vector3F &t, UT_Vector3F *shears=0) const
#define SYS_DECLARE_IS_POD(T)
Declare a type as POD.
GLboolean GLboolean GLboolean b
void setTranslates(const UT_Vector3T< S > &translates)
constexpr SYS_FORCE_INLINE T & y() noexcept
void getTranslates(UT_Vector3T< S > &translates) const
constexpr SYS_FORCE_INLINE T & x() noexcept