Allow determination of attach item relative positions
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user