shapes-0.1.0.0: physics engine and other tools for 2D shapes

Safe HaskellNone
LanguageHaskell2010

Physics.Engine.Class

Description

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 #

Associated Types

type PEWorld e :: * -> * Source #

type PEWorldObj e :: * -> * Source #

type PEExternalObj e Source #

type PEPhysicalObj e Source #

type PEContactBehavior e Source #

type PENumber e Source #

type PEShape e Source #

Methods

makePhysicalObj Source #

Arguments

:: 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.

makeWorldObj Source #

Arguments

:: 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 #

makeCircle :: Proxy e -> PENumber e -> PEShape e Source #