mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-16 16:14:23 +02:00
Added slerp and squad to the Quat scripting interface
This commit is contained in:
parent
d5ea2de4ea
commit
9b629a7326
2 changed files with 12 additions and 0 deletions
|
@ -66,6 +66,16 @@ glm::quat Quat::mix(const glm::quat& q1, const glm::quat& q2, float alpha) {
|
|||
return safeMix(q1, q2, alpha);
|
||||
}
|
||||
|
||||
/// Spherical Linear Interpolation
|
||||
glm::quat Quat::slerp(const glm::quat& q1, const glm::quat& q2, float alpha) {
|
||||
return glm::slerp(q1, q2, alpha);
|
||||
}
|
||||
|
||||
// Spherical Quadratic Interpolation
|
||||
glm::quat Quat::squad(const glm::quat& q1, const glm::quat& q2, const glm::quat& s1, const glm::quat& s2, float h) {
|
||||
return glm::squad(q1, q2, s1, s2, h);
|
||||
}
|
||||
|
||||
void Quat::print(const QString& lable, const glm::quat& q) {
|
||||
qDebug() << qPrintable(lable) << q.x << "," << q.y << "," << q.z << "," << q.w;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,8 @@ public slots:
|
|||
glm::vec3 safeEulerAngles(const glm::quat& orientation); // degrees
|
||||
glm::quat angleAxis(float angle, const glm::vec3& v); // degrees
|
||||
glm::quat mix(const glm::quat& q1, const glm::quat& q2, float alpha);
|
||||
glm::quat slerp(const glm::quat& q1, const glm::quat& q2, float alpha);
|
||||
glm::quat squad(const glm::quat& q1, const glm::quat& q2, const glm::quat& s1, const glm::quat& s2, float h);
|
||||
void print(const QString& lable, const glm::quat& q);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue