From a1683c48e198b7391e858ee8cd6f27ae366a8079 Mon Sep 17 00:00:00 2001 From: Marc Sunet Date: Thu, 30 Aug 2012 22:02:46 +0200 Subject: Added goAABBs --- Spear.lkshw | 4 ++-- Spear/Scene/GameObject.hs | 6 ++++++ 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 @@ Version of workspace file format: 1 Time of storage: - "Thu Aug 30 20:57:58 CEST 2012" + "Thu Aug 30 22:00:11 CEST 2012" Name of the workspace: "Spear" File paths of contained packages: ["demos/simple-scene/simple-scene.cabal","Spear.cabal"] Maybe file path of an active package: - Just "Spear.cabal" \ No newline at end of file + 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 , currentAnimation , numCollisioners , goAABB +, goAABBs -- * Manipulation , goUpdate , setAnimation @@ -178,6 +179,11 @@ goAABB' col = case col of (CircleCol circle) -> aabbFromCircle circle +-- | Get the game object's bounding boxes. +goAABBs :: GameObject -> [AABB] +goAABBs = fmap goAABB' . collisioners + + -- | Render the game object. goRender :: StaticProgram -> AnimatedProgram -> Cam.Camera -> GameObject -> IO () goRender sprog aprog cam go = -- cgit v1.2.3