module Physics.Hpysics.Types where type FloatType = Double floatEpsilon :: FloatType floatEpsilon = 1e-8 data Vec = Vec !FloatType !FloatType !FloatType deriving (Read, Show, Eq) data Vec4 = Vec4 !FloatType !FloatType !FloatType !FloatType deriving (Read, Show, Eq) type Quaternion = Vec4 data Mat33 = Mat33 !FloatType !FloatType !FloatType !FloatType !FloatType !FloatType !FloatType !FloatType !FloatType deriving (Read, Show, Eq) data Mat43 = Mat43 !FloatType !FloatType !FloatType !FloatType !FloatType !FloatType !FloatType !FloatType !FloatType !FloatType !FloatType !FloatType deriving (Read, Show, Eq) -- | contact point and normal type Contact = (Vec, Vec) -- | normal, shift data Plane = Plane {planeNormal :: !Vec, planeShift :: !FloatType} data Config = Config { gravity :: !Vec } deriving (Read, Show) type Shape = Poly data BoundingVol = BoundingVol !Vec !FloatType -- sphere: center, radius deriving (Read, Show, Eq) data Poly = Poly { vertices_v :: [Vec] , edges_i :: [(Int,Int)] , faces_i :: [[Int]] , boundingVol :: BoundingVol } deriving (Read, Show, Eq)