{-# LINE 1 "src/Chiphunk/Low/Arbiter.chs" #-}
module Chiphunk.Low.Arbiter
( Arbiter
, arbiterRestitution
, arbiterFriction
, arbiterSurfaceVelocity
, arbiterUserData
, arbiterCount
, arbiterNormal
, arbiterPointA
, arbiterPointB
, arbiterDepth
, arbiterIsFirstContact
, arbiterIsRemoval
, arbiterShapes
, arbiterBodies
, arbiterCallWildcardBeginA
, arbiterCallWildcardBeginB
, arbiterCallWildcardPreSolveA
, arbiterCallWildcardPreSolveB
, arbiterCallWildcardPostSolveA
, arbiterCallWildcardPostSolveB
, arbiterCallWildcardSeparateA
, arbiterCallWildcardSeparateB
) where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Marshal.Utils as C2HSImp
import qualified Foreign.Ptr as C2HSImp
import Data.StateVar
import Foreign
import Chiphunk.Low.Types
{-# LINE 29 "src/Chiphunk/Low/Arbiter.chs" #-}
cpArbiterGetRestitution :: (Arbiter) -> IO ((Double))
cpArbiterGetRestitution a1 =
let {a1' = id a1} in
cpArbiterGetRestitution'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 34 "src/Chiphunk/Low/Arbiter.chs" #-}
cpArbiterSetRestitution :: (Arbiter) -> (Double) -> IO ()
cpArbiterSetRestitution a1 a2 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
cpArbiterSetRestitution'_ a1' a2' >>
return ()
{-# LINE 36 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterRestitution :: Arbiter -> StateVar Double
arbiterRestitution = mkStateVar cpArbiterGetRestitution cpArbiterSetRestitution
cpArbiterGetFriction :: (Arbiter) -> IO ((Double))
cpArbiterGetFriction a1 =
let {a1' = id a1} in
cpArbiterGetFriction'_ a1' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 44 "src/Chiphunk/Low/Arbiter.chs" #-}
cpArbiterSetFriction :: (Arbiter) -> (Double) -> IO ()
cpArbiterSetFriction a1 a2 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
cpArbiterSetFriction'_ a1' a2' >>
return ()
{-# LINE 46 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterFriction :: Arbiter -> StateVar Double
arbiterFriction = mkStateVar cpArbiterGetFriction cpArbiterSetFriction
w_cpArbiterGetSurfaceVelocity :: (Arbiter) -> IO ((Vect))
w_cpArbiterGetSurfaceVelocity a1 =
let {a1' = id a1} in
alloca $ \a2' ->
w_cpArbiterGetSurfaceVelocity'_ a1' a2' >>
peek a2'>>= \a2'' ->
return (a2'')
{-# LINE 54 "src/Chiphunk/Low/Arbiter.chs" #-}
cpArbiterSetSurfaceVelocity :: (Arbiter) -> (Vect) -> IO ()
cpArbiterSetSurfaceVelocity a1 a2 =
let {a1' = id a1} in
with a2 $ \a2' ->
cpArbiterSetSurfaceVelocity'_ a1' a2' >>
return ()
{-# LINE 56 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterSurfaceVelocity :: Arbiter -> StateVar Vect
arbiterSurfaceVelocity = mkStateVar w_cpArbiterGetSurfaceVelocity cpArbiterSetSurfaceVelocity
cpArbiterGetUserData :: (Arbiter) -> IO ((DataPtr))
cpArbiterGetUserData a1 =
let {a1' = id a1} in
cpArbiterGetUserData'_ a1' >>= \res ->
let {res' = id res} in
return (res')
{-# LINE 69 "src/Chiphunk/Low/Arbiter.chs" #-}
cpArbiterSetUserData :: (Arbiter) -> (DataPtr) -> IO ()
cpArbiterSetUserData a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
cpArbiterSetUserData'_ a1' a2' >>
return ()
{-# LINE 71 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterUserData :: Arbiter -> StateVar DataPtr
arbiterUserData = mkStateVar cpArbiterGetUserData cpArbiterSetUserData
cpArbiterGetCount :: (Arbiter) -> IO ((Int))
cpArbiterGetCount a1 =
let {a1' = id a1} in
cpArbiterGetCount'_ a1' >>= \res ->
let {res' = fromIntegral res} in
return (res')
{-# LINE 85 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterCount :: Arbiter -> GettableStateVar Int
arbiterCount = makeGettableStateVar . cpArbiterGetCount
w_cpArbiterGetNormal :: (Arbiter) -> IO ((Vect))
w_cpArbiterGetNormal a1 =
let {a1' = id a1} in
alloca $ \a2' ->
w_cpArbiterGetNormal'_ a1' a2' >>
peek a2'>>= \a2'' ->
return (a2'')
{-# LINE 92 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterNormal :: Arbiter -> GettableStateVar Vect
arbiterNormal = makeGettableStateVar . w_cpArbiterGetNormal
w_cpArbiterGetPointA :: (Arbiter) -> (Int) -> IO ((Vect))
w_cpArbiterGetPointA a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
alloca $ \a3' ->
w_cpArbiterGetPointA'_ a1' a2' a3' >>
peek a3'>>= \a3'' ->
return (a3'')
{-# LINE 98 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterPointA :: Arbiter -> Int -> GettableStateVar Vect
arbiterPointA arbiter = makeGettableStateVar . w_cpArbiterGetPointA arbiter
w_cpArbiterGetPointB :: (Arbiter) -> (Int) -> IO ((Vect))
w_cpArbiterGetPointB a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
alloca $ \a3' ->
w_cpArbiterGetPointB'_ a1' a2' a3' >>
peek a3'>>= \a3'' ->
return (a3'')
{-# LINE 104 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterPointB :: Arbiter -> Int -> GettableStateVar Vect
arbiterPointB arbiter = makeGettableStateVar . w_cpArbiterGetPointB arbiter
cpArbiterGetDepth :: (Arbiter) -> (Int) -> IO ((Double))
cpArbiterGetDepth a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
cpArbiterGetDepth'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
return (res')
{-# LINE 110 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterDepth :: Arbiter -> Int -> GettableStateVar Double
arbiterDepth arbiter = makeGettableStateVar . cpArbiterGetDepth arbiter
arbiterIsFirstContact :: (Arbiter) -> IO ((Bool))
arbiterIsFirstContact a1 =
let {a1' = id a1} in
arbiterIsFirstContact'_ a1' >>= \res ->
let {res' = C2HSImp.toBool res} in
return (res')
{-# LINE 119 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterIsRemoval :: (Arbiter) -> IO ((Bool))
arbiterIsRemoval a1 =
let {a1' = id a1} in
arbiterIsRemoval'_ a1' >>= \res ->
let {res' = C2HSImp.toBool res} in
return (res')
{-# LINE 122 "src/Chiphunk/Low/Arbiter.chs" #-}
cpArbiterGetShapes :: (Arbiter) -> IO ((Shape), (Shape))
cpArbiterGetShapes a1 =
let {a1' = id a1} in
alloca $ \a2' ->
alloca $ \a3' ->
cpArbiterGetShapes'_ a1' a2' a3' >>
peek a2'>>= \a2'' ->
peek a3'>>= \a3'' ->
return (a2'', a3'')
{-# LINE 128 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterShapes :: Arbiter -> GettableStateVar (Shape, Shape)
arbiterShapes = makeGettableStateVar . cpArbiterGetShapes
cpArbiterGetBodies :: (Arbiter) -> IO ((Body), (Body))
cpArbiterGetBodies a1 =
let {a1' = id a1} in
alloca $ \a2' ->
alloca $ \a3' ->
cpArbiterGetBodies'_ a1' a2' a3' >>
peek a2'>>= \a2'' ->
peek a3'>>= \a3'' ->
return (a2'', a3'')
{-# LINE 141 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterBodies :: Arbiter -> GettableStateVar (Body, Body)
arbiterBodies = makeGettableStateVar . cpArbiterGetBodies
arbiterCallWildcardBeginA :: (Arbiter) -> (Space) -> IO ((Bool))
arbiterCallWildcardBeginA a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
arbiterCallWildcardBeginA'_ a1' a2' >>= \res ->
let {res' = C2HSImp.toBool res} in
return (res')
{-# LINE 151 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterCallWildcardBeginB :: (Arbiter) -> (Space) -> IO ((Bool))
arbiterCallWildcardBeginB a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
arbiterCallWildcardBeginB'_ a1' a2' >>= \res ->
let {res' = C2HSImp.toBool res} in
return (res')
{-# LINE 154 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterCallWildcardPreSolveA :: (Arbiter) -> (Space) -> IO ((Bool))
arbiterCallWildcardPreSolveA a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
arbiterCallWildcardPreSolveA'_ a1' a2' >>= \res ->
let {res' = C2HSImp.toBool res} in
return (res')
{-# LINE 157 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterCallWildcardPreSolveB :: (Arbiter) -> (Space) -> IO ((Bool))
arbiterCallWildcardPreSolveB a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
arbiterCallWildcardPreSolveB'_ a1' a2' >>= \res ->
let {res' = C2HSImp.toBool res} in
return (res')
{-# LINE 160 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterCallWildcardPostSolveA :: (Arbiter) -> (Space) -> IO ()
arbiterCallWildcardPostSolveA a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
arbiterCallWildcardPostSolveA'_ a1' a2' >>
return ()
{-# LINE 163 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterCallWildcardPostSolveB :: (Arbiter) -> (Space) -> IO ()
arbiterCallWildcardPostSolveB a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
arbiterCallWildcardPostSolveB'_ a1' a2' >>
return ()
{-# LINE 166 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterCallWildcardSeparateA :: (Arbiter) -> (Space) -> IO ()
arbiterCallWildcardSeparateA a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
arbiterCallWildcardSeparateA'_ a1' a2' >>
return ()
{-# LINE 169 "src/Chiphunk/Low/Arbiter.chs" #-}
arbiterCallWildcardSeparateB :: (Arbiter) -> (Space) -> IO ()
arbiterCallWildcardSeparateB a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
arbiterCallWildcardSeparateB'_ a1' a2' >>
return ()
{-# LINE 172 "src/Chiphunk/Low/Arbiter.chs" #-}
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterGetRestitution"
cpArbiterGetRestitution'_ :: ((Arbiter) -> (IO C2HSImp.CDouble))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterSetRestitution"
cpArbiterSetRestitution'_ :: ((Arbiter) -> (C2HSImp.CDouble -> (IO ())))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterGetFriction"
cpArbiterGetFriction'_ :: ((Arbiter) -> (IO C2HSImp.CDouble))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterSetFriction"
cpArbiterSetFriction'_ :: ((Arbiter) -> (C2HSImp.CDouble -> (IO ())))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h w_cpArbiterGetSurfaceVelocity"
w_cpArbiterGetSurfaceVelocity'_ :: ((Arbiter) -> ((VectPtr) -> (IO ())))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h __c2hs_wrapped__cpArbiterSetSurfaceVelocity"
cpArbiterSetSurfaceVelocity'_ :: ((Arbiter) -> ((VectPtr) -> (IO ())))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterGetUserData"
cpArbiterGetUserData'_ :: ((Arbiter) -> (IO (DataPtr)))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterSetUserData"
cpArbiterSetUserData'_ :: ((Arbiter) -> ((DataPtr) -> (IO ())))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterGetCount"
cpArbiterGetCount'_ :: ((Arbiter) -> (IO C2HSImp.CInt))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h w_cpArbiterGetNormal"
w_cpArbiterGetNormal'_ :: ((Arbiter) -> ((VectPtr) -> (IO ())))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h w_cpArbiterGetPointA"
w_cpArbiterGetPointA'_ :: ((Arbiter) -> (C2HSImp.CInt -> ((VectPtr) -> (IO ()))))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h w_cpArbiterGetPointB"
w_cpArbiterGetPointB'_ :: ((Arbiter) -> (C2HSImp.CInt -> ((VectPtr) -> (IO ()))))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterGetDepth"
cpArbiterGetDepth'_ :: ((Arbiter) -> (C2HSImp.CInt -> (IO C2HSImp.CDouble)))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterIsFirstContact"
arbiterIsFirstContact'_ :: ((Arbiter) -> (IO C2HSImp.CUChar))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterIsRemoval"
arbiterIsRemoval'_ :: ((Arbiter) -> (IO C2HSImp.CUChar))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterGetShapes"
cpArbiterGetShapes'_ :: ((Arbiter) -> ((C2HSImp.Ptr (Shape)) -> ((C2HSImp.Ptr (Shape)) -> (IO ()))))
foreign import ccall unsafe "Chiphunk/Low/Arbiter.chs.h cpArbiterGetBodies"
cpArbiterGetBodies'_ :: ((Arbiter) -> ((C2HSImp.Ptr (Body)) -> ((C2HSImp.Ptr (Body)) -> (IO ()))))
foreign import ccall safe "Chiphunk/Low/Arbiter.chs.h cpArbiterCallWildcardBeginA"
arbiterCallWildcardBeginA'_ :: ((Arbiter) -> ((Space) -> (IO C2HSImp.CUChar)))
foreign import ccall safe "Chiphunk/Low/Arbiter.chs.h cpArbiterCallWildcardBeginB"
arbiterCallWildcardBeginB'_ :: ((Arbiter) -> ((Space) -> (IO C2HSImp.CUChar)))
foreign import ccall safe "Chiphunk/Low/Arbiter.chs.h cpArbiterCallWildcardPreSolveA"
arbiterCallWildcardPreSolveA'_ :: ((Arbiter) -> ((Space) -> (IO C2HSImp.CUChar)))
foreign import ccall safe "Chiphunk/Low/Arbiter.chs.h cpArbiterCallWildcardPreSolveB"
arbiterCallWildcardPreSolveB'_ :: ((Arbiter) -> ((Space) -> (IO C2HSImp.CUChar)))
foreign import ccall safe "Chiphunk/Low/Arbiter.chs.h cpArbiterCallWildcardPostSolveA"
arbiterCallWildcardPostSolveA'_ :: ((Arbiter) -> ((Space) -> (IO ())))
foreign import ccall safe "Chiphunk/Low/Arbiter.chs.h cpArbiterCallWildcardPostSolveB"
arbiterCallWildcardPostSolveB'_ :: ((Arbiter) -> ((Space) -> (IO ())))
foreign import ccall safe "Chiphunk/Low/Arbiter.chs.h cpArbiterCallWildcardSeparateA"
arbiterCallWildcardSeparateA'_ :: ((Arbiter) -> ((Space) -> (IO ())))
foreign import ccall safe "Chiphunk/Low/Arbiter.chs.h cpArbiterCallWildcardSeparateB"
arbiterCallWildcardSeparateB'_ :: ((Arbiter) -> ((Space) -> (IO ())))