From e2b76464e847e5c656e6adf6d8e07a054756cda0 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Mon, 30 Dec 2024 20:59:27 -0800 Subject: Use bounding volume in other places. --- Demos/Pong/Main.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Demos/Pong/Main.hs') diff --git a/Demos/Pong/Main.hs b/Demos/Pong/Main.hs index df90020..b93325d 100644 --- a/Demos/Pong/Main.hs +++ b/Demos/Pong/Main.hs @@ -9,6 +9,7 @@ import Spear.Math.Matrix4 as Matrix4 hiding (position) import Spear.Math.Spatial import Spear.Math.Spatial2 import Spear.Math.Vector +import Spear.Physics.Collision import Spear.Render.Core.Pipeline import Spear.Render.Core.State import Spear.Render.Immediate @@ -101,11 +102,9 @@ renderBackground = ,vec2 pmin pmax)] renderGO :: GameObject -> Game ImmRenderState () -renderGO go = do - let (AABB2 (Vector2 xmin ymin) (Vector2 xmax ymax)) = aabb go - (Vector2 xcenter ycenter) = position go - immPreservingMatrix $ do - immTranslate (vec3 xcenter ycenter 0) +renderGO go = + let (AABB2Volume (AABB2 (Vector2 xmin ymin) (Vector2 xmax ymax))) = boundingVolume go + in immDrawQuads2d [ (vec2 xmin ymin ,vec2 xmax ymin -- cgit v1.2.3