From c57467124491ee6dc67ccb99b037469e286b1a99 Mon Sep 17 00:00:00 2001 From: nek0 Date: Tue, 31 Aug 2021 02:15:33 +0200 Subject: [PATCH] laying out data --- src/Physics/Classes/Collidible.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Physics/Classes/Collidible.hs b/src/Physics/Classes/Collidible.hs index d98547b..1e4918f 100644 --- a/src/Physics/Classes/Collidible.hs +++ b/src/Physics/Classes/Collidible.hs @@ -67,7 +67,14 @@ class (Show c, Mass c) => Collidible c where -> other -- ^ second object -> CollisionResult Double (V2 Int) -- ^ Do the objects collide? collisionCheck m1 m2 = - error "collisionCheck: not yet implemented!" + let p1@(V2 p1x p1y) = position m1 + p2@(V2 p2x p2y) = position m2 + v1@(V2 v1x v1y) = velocity m1 + v2@(V2 v2x v2y) = velocity m2 + (V2 dvx dvy) = v1 - v2 + (V2 dx dy) = p1 - p2 + in + error "collisionCheck: Not yet implemented!" -- | This Function is called for every collision on both colliding objects. collide