8 namespace HandTrackingClient
36 template <
typename T2>
70 T
lInfNorm()
const {
return std::max (std::max (std::abs(
x), std::abs(
y)), std::abs(
z)); }
100 template <
typename T>
104 template <
typename T>
105 std::ostream& operator<< (std::ostream& os, const Vector3<T>& rhs);
107 typedef Vector3<float> Vector3f;
108 typedef Vector3<double> Vector3d;
115 template <
typename T>
130 :
v(x_in, y_in, z_in),
w(w_in) {}
140 :
v(v_in),
w(w_in) {}
143 template <
typename T2>
175 template <
typename T>
181 a.
w*b.
w - a.
v.dot(b.
v));
186 template <
typename T>
187 std::ostream& operator<< (std::ostream& os, const Quaternion<T>& rhs);
189 typedef Quaternion<float> Quaternionf;
190 typedef Quaternion<double> Quaterniond;
202 template <
typename T>
225 template <
typename T>
226 Transform<T>
operator* (
const Transform<T>& lhs,
const Transform<T>& rhs)
230 return Transform<T> (lhs.rotation * rhs.rotation,
231 lhs.translation + lhs.rotation.rotate(rhs.translation));
234 template <
typename T>
235 Vector3<T>
operator* (
const Transform<T>& lhs,
const Vector3<T>& rhs)
237 return lhs.translation + lhs.rotation.rotate (rhs);
240 typedef Transform<float> Transformf;
241 typedef Transform<double> Transformd;
248 template <
typename T>
266 const T&
operator() (
unsigned iRow,
unsigned jCol)
const {
return data[jCol * 4 + iRow]; }
272 typedef Matrix4<float> Matrix4f;
273 typedef Matrix4<double> Matrix4d;