Browse Source

laying out data

physics3
nek0 2 months ago
parent
commit
c574671244
  1. 9
      src/Physics/Classes/Collidible.hs

9
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

Loading…
Cancel
Save