Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module is a holdover from when I had two (slow and less slow) implementations of the physics engine. I used this class so I could run the same demos on both engines to compare them. There's a good chance I remove this in the future.
Documentation
class Fractional (PENumber e) => PhysicsEngine e where Source #
makePhysicalObj, makeWorldObj, makeWorld, makeContactBehavior, makeConstantAccel, makeHull, makeRectangleHull, makeCircle
type PEWorld e :: * -> * Source #
type PEWorldObj e :: * -> * Source #
type PEExternalObj e Source #
type PEPhysicalObj e Source #
type PEContactBehavior e Source #
:: Proxy e | |
-> (PENumber e, PENumber e) | Velocity |
-> PENumber e | Rotational velocity |
-> (PENumber e, PENumber e) | Position |
-> PENumber e | Rotation |
-> (PENumber e, PENumber e) | Linear mass paired with rotational mass |
-> PEPhysicalObj e |
Create a PEPhysicalObj e
.
:: Proxy e | |
-> PEPhysicalObj e | The physical body of this object. |
-> PENumber e | Coefficient of friction μ (mu). |
-> PEShape e | The shape of the object. |
-> PEExternalObj e | Any userland piece of data from outside the simulation. |
-> PEWorldObj e (PEExternalObj e) |
Create a PEWorldObj e
makeWorld :: Proxy e -> [PEWorldObj e (PEExternalObj e)] -> PEWorld' e Source #
makeContactBehavior :: Proxy e -> PENumber e -> PENumber e -> PEContactBehavior e Source #
makeConstantAccel :: Proxy e -> (PENumber e, PENumber e) -> External Source #
makeHull :: Proxy e -> [(PENumber e, PENumber e)] -> PEShape e Source #
makeRectangleHull :: Proxy e -> PENumber e -> PENumber e -> PEShape e Source #
PhysicsEngine (Engine a) Source # | |
type PEWorldObj' e = PEWorldObj e (PEExternalObj e) Source #
type PEWorld' e = PEWorld e (PEWorldObj' e) Source #