diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index 8a7c4f6c..a68bb804 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -947,6 +947,13 @@ template struct Quat return Quat(w, -x, -y, -z); } + inline Vec3 transform(Vec3 const &v) + { + Quat p = Quat(0, v.x, v.y, v.z); + Quat q = *this * p / *this; + return Vec3(q.x, q.y, q.z); + } + #if !defined __ANDROID__ template friend std::ostream &operator<<(std::ostream &stream, Quat const &v);