mirror of https://github.com/AxioDL/zeus.git
Add CQuaternion::slerpShort
This commit is contained in:
parent
83ef557a02
commit
21b0eb15c8
|
@ -256,6 +256,7 @@ public:
|
|||
|
||||
static CQuaternion lerp(const CQuaternion& a, const CQuaternion& b, double t);
|
||||
static CQuaternion slerp(const CQuaternion& a, const CQuaternion& b, double t);
|
||||
static CQuaternion slerpShort(const CQuaternion& a, const CQuaternion& b, double t);
|
||||
static CQuaternion nlerp(const CQuaternion& a, const CQuaternion& b, double t);
|
||||
|
||||
inline float roll() const { return std::atan2(2.f * (x * y + w * z), w * w + x * x - y * y - z * z); }
|
||||
|
|
|
@ -206,6 +206,11 @@ CQuaternion CQuaternion::slerp(const CQuaternion& a, const CQuaternion& b, doubl
|
|||
return a;
|
||||
}
|
||||
|
||||
CQuaternion CQuaternion::slerpShort(const CQuaternion& a, const CQuaternion& b, double t)
|
||||
{
|
||||
return zeus::CQuaternion::slerp((b.dot(a) >= 0.f) ? a : a.buildEquivalent(), b, t);
|
||||
}
|
||||
|
||||
CQuaternion operator+(float lhs, const CQuaternion& rhs)
|
||||
{
|
||||
return CQuaternion(lhs + rhs.w, lhs * rhs.x, lhs * rhs.y, lhs * rhs.z);
|
||||
|
|
Loading…
Reference in New Issue