diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2021-03-01 16:28:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-01 16:28:58 +0100 |
| commit | 55c0a2ea03369efefa0f795bdc7f81fbd4568a47 (patch) | |
| tree | 069520ecface5af683b236029919af91dceeaf31 /src/core/Quat.cpp | |
| parent | cee79bb7a6989677812a88833fca2ed4156a117f (diff) | |
| parent | cba90d630177ce6c57b5537e74ef3eab4e9c1ea2 (diff) | |
| download | redot-cpp-55c0a2ea03369efefa0f795bdc7f81fbd4568a47.tar.gz | |
Merge pull request #525 from vnen/update-clang-format
Update clang-format to version 11
Diffstat (limited to 'src/core/Quat.cpp')
| -rw-r--r-- | src/core/Quat.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/Quat.cpp b/src/core/Quat.cpp index dc179e2..9e3cfe7 100644 --- a/src/core/Quat.cpp +++ b/src/core/Quat.cpp @@ -100,7 +100,6 @@ Quat Quat::inverse() const { } Quat Quat::slerp(const Quat &q, const real_t &t) const { - Quat to1; real_t omega, cosom, sinom, scale0, scale1; @@ -144,12 +143,12 @@ Quat Quat::slerp(const Quat &q, const real_t &t) const { } Quat Quat::slerpni(const Quat &q, const real_t &t) const { - const Quat &from = *this; real_t dot = from.dot(q); - if (::fabs(dot) > 0.9999) return from; + if (::fabs(dot) > 0.9999) + return from; real_t theta = ::acos(dot), sinT = 1.0 / ::sin(theta), @@ -200,7 +199,6 @@ Quat Quat::operator*(const Vector3 &v) const { } Vector3 Quat::xform(const Vector3 &v) const { - Quat q = *this * v; q *= this->inverse(); return Vector3(q.x, q.y, q.z); @@ -234,7 +232,6 @@ Quat::Quat(const Vector3 &v0, const Vector3 &v1) // shortest arc z = 0; w = 0; } else { - real_t s = ::sqrt((1.0 + d) * 2.0); real_t rs = 1.0 / s; @@ -282,7 +279,6 @@ void Quat::operator*=(const real_t &s) { } void Quat::operator/=(const real_t &s) { - *this *= 1.0 / s; } |
