{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Physics.Contact.Types where
import Control.Lens
import Data.Vector.Unboxed.Deriving
import Physics.Linear
data ContactBehavior =
ContactBehavior { contactBaumgarte :: !Double
, contactPenetrationSlop :: !Double
} deriving Show
data Contact' =
Contact' { _contactEdgeNormal' :: !V2
, _contactPenetrator' :: !P2
, _contactDepth' :: !Double
} deriving Show
makeLenses ''Contact'
derivingUnbox "Contact'"
[t| Contact' -> (V2, P2, Double) |]
[| \Contact'{..} -> (_contactEdgeNormal', _contactPenetrator', _contactDepth') |]
[| \(n, p, d) -> Contact' n p d |]