move velocity into Mass typeclass
This commit is contained in:
parent
454405b564
commit
7b174248ec
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue