flaw-physics-0.1.0.0

LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Flaw.Physics

Description

 
Synopsis

Documentation

class World w where Source #

Abstract physics world class.

Associated Types

data Shape w :: * Source #

data Body w :: * Source #

data Ghost w :: * Source #

data Character w :: * Source #

Methods

createBoxShape :: w -> Float3 -> IO (Shape w, IO ()) Source #

createSphereShape :: w -> Float -> IO (Shape w, IO ()) Source #

createConvexHullShape :: Vector v Float3 => w -> v Float3 -> IO (Shape w, IO ()) Source #

createBody Source #

Arguments

:: w 
-> Shape w 
-> Motion 
-> FloatQO

Initial transform.

-> IO (Body w, IO ()) 

Create rigid body.

getBodyTransform :: w -> Body w -> IO FloatQO Source #

createGhost :: w -> Shape w -> FloatQO -> IO (Ghost w, IO ()) Source #

Create ghost object.

setGhostTransform :: w -> Ghost w -> FloatQO -> IO () Source #

Set ghost transform.

createCharacter Source #

Arguments

:: w 
-> Shape w 
-> Float

Max step height.

-> FloatQO

Initial transform.

-> IO (Character w, IO ()) 

Create character object.

walkCharacter :: w -> Character w -> Float3 -> IO () Source #

Move character object.

getCharacterTransform :: w -> Character w -> IO FloatQO Source #

Get character transform.

simulateWorld Source #

Arguments

:: w 
-> Float

Step time.

-> Float

Substep time.

-> IO () 

Advance simulation.

data Motion Source #

Constructors

MotionStatic

Static body.

MotionDynamic Float

Dynamic body with mass.