Skip to content

Commit 8acee32

Browse files
committed
Add missing cassert include.
1 parent 6d9b06b commit 8acee32

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/libs/math/math/Quaternion-impl.h

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#pragma once
22

3+
4+
#include <cassert>
5+
6+
37
namespace ad {
48
namespace math {
59

@@ -103,15 +107,15 @@ constexpr T_number Quaternion<T_number>::w() const noexcept(should_noexcept)
103107

104108

105109
template <class T_number>
106-
constexpr Quaternion<T_number> Quaternion<T_number>::operator-()
110+
constexpr Quaternion<T_number> Quaternion<T_number>::operator-()
107111
const noexcept(should_noexcept)
108112
{
109113
return {-mVector, -mW};
110114
}
111115

112116

113117
template <class T_number>
114-
constexpr Quaternion<T_number> & Quaternion<T_number>::operator*=(const Quaternion & aRhs)
118+
constexpr Quaternion<T_number> & Quaternion<T_number>::operator*=(const Quaternion & aRhs)
115119
noexcept(should_noexcept)
116120
{
117121
T_number w = mW * aRhs.mW - mVector.dot(aRhs.mVector);
@@ -132,12 +136,12 @@ template <class T_number>
132136
constexpr Quaternion<T_number> Quaternion<T_number>::inverse() const noexcept(should_noexcept)
133137
{
134138
// IMPORTANT This is true only because we expect Quaternion to be a unit quaternion.
135-
return conjugate();
139+
return conjugate();
136140
}
137141

138142

139143
template <class T_number>
140-
template <class T_derived>
144+
template <class T_derived>
141145
//requires (is_position_v<T_derived> || is_vec_v<T_derived>)
142146
T_derived Quaternion<T_number>::rotate(const Vector<T_derived, 3, T_number> & aVector) const
143147
noexcept(should_noexcept)
@@ -148,7 +152,7 @@ noexcept(should_noexcept)
148152

149153

150154
template <class T_number>
151-
constexpr LinearMatrix<3, 3, T_number> Quaternion<T_number>::toRotationMatrix() const
155+
constexpr LinearMatrix<3, 3, T_number> Quaternion<T_number>::toRotationMatrix() const
152156
noexcept(should_noexcept)
153157
{
154158
return {
@@ -161,17 +165,17 @@ noexcept(should_noexcept)
161165

162166

163167
template <class T_number>
164-
constexpr bool
168+
constexpr bool
165169
Quaternion<T_number>::equalsWithinTolerance(const Quaternion & aRhs, T_number aEpsilon) const
166170
noexcept(should_noexcept)
167171
{
168-
return mVector.equalsWithinTolerance(aRhs.mVector, aEpsilon)
172+
return mVector.equalsWithinTolerance(aRhs.mVector, aEpsilon)
169173
&& std::abs(mW - aRhs.mW) <= aEpsilon;
170174
}
171175

172176

173177
template <class T_number>
174-
constexpr Vec<4, T_number> Quaternion<T_number>::asVec() const
178+
constexpr Vec<4, T_number> Quaternion<T_number>::asVec() const
175179
noexcept(should_noexcept)
176180
{
177181
return {mVector, mW};
@@ -183,7 +187,7 @@ noexcept(should_noexcept)
183187
//
184188
template <class T_number>
185189
constexpr Quaternion<T_number>
186-
operator*(Quaternion<T_number> aLhs, const Quaternion<T_number> & aRhs)
190+
operator*(Quaternion<T_number> aLhs, const Quaternion<T_number> & aRhs)
187191
noexcept(decltype(aLhs)::should_noexcept)
188192
{
189193
return aLhs *= aRhs;
@@ -192,7 +196,7 @@ noexcept(decltype(aLhs)::should_noexcept)
192196

193197
template <class T_number>
194198
constexpr Quaternion<T_number>
195-
difference(Quaternion<T_number> aLhs, const Quaternion<T_number> & aRhs)
199+
difference(Quaternion<T_number> aLhs, const Quaternion<T_number> & aRhs)
196200
noexcept(decltype(aLhs)::should_noexcept)
197201
{
198202
return aRhs * aLhs.inverse();
@@ -210,10 +214,10 @@ noexcept(decltype(aLhs)::should_noexcept)
210214
template <class T_number>
211215
std::ostream & operator<<(std::ostream & aOut, const Quaternion<T_number> & aQuaternion)
212216
{
213-
return aOut << "<q>{"
217+
return aOut << "<q>{"
214218
<< aQuaternion.x() << ", "
215219
<< aQuaternion.y() << ", "
216-
<< aQuaternion.z() << ", "
220+
<< aQuaternion.z() << ", "
217221
<< aQuaternion.w()
218222
<< "}"
219223
;
@@ -231,7 +235,7 @@ Quaternion<T_number> toQuaternion(const LinearMatrix<3, 3, T_number> & m)
231235
m.at(2, 2) - m.at(0, 0) - m.at(1, 1),
232236
}};
233237

234-
auto maxElementIt =
238+
auto maxElementIt =
235239
std::max_element(std::begin(fourTimesSquaredMinusOne),
236240
std::end(fourTimesSquaredMinusOne));
237241

0 commit comments

Comments
 (0)