Allow determination of attach item relative positions

This commit is contained in:
2024-10-02 10:24:10 +01:00
parent 7ce5225491
commit bac57a702d
6 changed files with 87 additions and 61 deletions
+8
View File
@@ -11,6 +11,8 @@ The warnings have been disabled.
-}
module Quaternion (
qID,
qToV3,
qToV2,
rotateToZ,
vToQuat,
module Linear.Quaternion,
@@ -43,6 +45,12 @@ vToQuat a b
where
cprod = crossProd a b
qToV3 :: Q.Quaternion Float -> Point3
qToV3 q = Q.rotate q (V3 1 0 0)
qToV2 :: Q.Quaternion Float -> Point2
qToV2 = (\(V3 x y _) -> V2 x y) . qToV3
qID :: Q.Quaternion Float
qID = Q.axisAngle (V3 1 0 0) 0