aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Spear/Math/Spatial.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Spear/Math/Spatial.hs b/Spear/Math/Spatial.hs
index d925f6f..fe2700f 100644
--- a/Spear/Math/Spatial.hs
+++ b/Spear/Math/Spatial.hs
@@ -49,6 +49,14 @@ class Spatial s where
49 -- | Set the 'Spatial''s transform. 49 -- | Set the 'Spatial''s transform.
50 setTransform :: Matrix4 -> s -> s 50 setTransform :: Matrix4 -> s -> s
51 51
52 -- | Set the 'Spatial''s position.
53 setPos :: Vector3 -> s -> s
54 setPos p s = setTransform t' s
55 where t' = M.transform r u f p
56 r = Spear.Math.Spatial.right s
57 u = Spear.Math.Spatial.up s
58 f = Spear.Math.Spatial.fwd s
59
52 -- | Make the 'Spatial' look at the given point. 60 -- | Make the 'Spatial' look at the given point.
53 lookAt :: Vector3 -> s -> s 61 lookAt :: Vector3 -> s -> s
54 lookAt pt s = 62 lookAt pt s =