2020-12-27 01:31:10 +00:00
|
|
|
module Classes.Physics.Mass where
|
|
|
|
|
2020-12-27 04:30:57 +00:00
|
|
|
import Linear
|
|
|
|
|
2020-12-27 01:31:10 +00:00
|
|
|
-- | This typeclass is a centerpiece of the physics implementation and is used
|
|
|
|
-- to implement the basic mass properties of a (very simplified) physical body.
|
|
|
|
class Mass m where
|
|
|
|
|
|
|
|
-- | The mass of the object
|
|
|
|
mass :: m -> Double
|
|
|
|
|
2020-12-27 04:25:54 +00:00
|
|
|
-- | velocity of the object
|
|
|
|
velocity :: m -> V2 Double
|
|
|
|
|
2020-12-27 01:31:10 +00:00
|
|
|
-- | The scaling factor for how much this object is affected by gravity.
|
|
|
|
gravScale :: m -> Double
|