aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Sunet <jeannekamikaze@gmail.com>2012-08-30 22:02:46 +0200
committerMarc Sunet <jeannekamikaze@gmail.com>2012-08-30 22:02:46 +0200
commita1683c48e198b7391e858ee8cd6f27ae366a8079 (patch)
treeacdbef2d6ef21740fdd8cc857a355ef3221748d2
parent420a8ced13e3cc16644d3a96260c8fdd3168be67 (diff)
Added goAABBs
-rw-r--r--Spear.lkshw4
-rw-r--r--Spear/Scene/GameObject.hs6
2 files changed, 8 insertions, 2 deletions
diff --git a/Spear.lkshw b/Spear.lkshw
index f062526..2bfefbb 100644
--- a/Spear.lkshw
+++ b/Spear.lkshw
@@ -1,10 +1,10 @@
1Version of workspace file format: 1Version of workspace file format:
2 1 2 1
3Time of storage: 3Time of storage:
4 "Thu Aug 30 20:57:58 CEST 2012" 4 "Thu Aug 30 22:00:11 CEST 2012"
5Name of the workspace: 5Name of the workspace:
6 "Spear" 6 "Spear"
7File paths of contained packages: 7File paths of contained packages:
8 ["demos/simple-scene/simple-scene.cabal","Spear.cabal"] 8 ["demos/simple-scene/simple-scene.cabal","Spear.cabal"]
9Maybe file path of an active package: 9Maybe file path of an active package:
10 Just "Spear.cabal" \ No newline at end of file 10 Just "demos/simple-scene/simple-scene.cabal" \ No newline at end of file
diff --git a/Spear/Scene/GameObject.hs b/Spear/Scene/GameObject.hs
index 9886f35..62bb27e 100644
--- a/Spear/Scene/GameObject.hs
+++ b/Spear/Scene/GameObject.hs
@@ -10,6 +10,7 @@ module Spear.Scene.GameObject
10, currentAnimation 10, currentAnimation
11, numCollisioners 11, numCollisioners
12, goAABB 12, goAABB
13, goAABBs
13 -- * Manipulation 14 -- * Manipulation
14, goUpdate 15, goUpdate
15, setAnimation 16, setAnimation
@@ -178,6 +179,11 @@ goAABB' col = case col of
178 (CircleCol circle) -> aabbFromCircle circle 179 (CircleCol circle) -> aabbFromCircle circle
179 180
180 181
182-- | Get the game object's bounding boxes.
183goAABBs :: GameObject -> [AABB]
184goAABBs = fmap goAABB' . collisioners
185
186
181-- | Render the game object. 187-- | Render the game object.
182goRender :: StaticProgram -> AnimatedProgram -> Cam.Camera -> GameObject -> IO () 188goRender :: StaticProgram -> AnimatedProgram -> Cam.Camera -> GameObject -> IO ()
183goRender sprog aprog cam go = 189goRender sprog aprog cam go =