move velocity into Mass typeclass

This commit is contained in:
nek0 2020-12-27 05:25:54 +01:00
parent 454405b564
commit 7b174248ec
2 changed files with 3 additions and 3 deletions

View File

@ -12,9 +12,6 @@ class Mass c => Collidible c where
-> ( V2 Double -- Top left corner of AABB relative to position
, V2 Double -- Bottom right corner of AABB relative to position
)
velocity :: c -> V2 Double
-- | This Function is called for every collision for both colliding objects.
collide
-> c -- ^ Original object

View File

@ -7,5 +7,8 @@ class Mass m where
-- | The mass of the object
mass :: m -> Double
-- | velocity of the object
velocity :: m -> V2 Double
-- | The scaling factor for how much this object is affected by gravity.
gravScale :: m -> Double