module Box2D.World
( create
, destroy
, isValid
, step
, draw
, getBounds
, getBoundsInto
, getBodyEvents
, getBodyEventsInto
, getSensorEvents
, getSensorEventsInto
, getContactEvents
, getContactEventsInto
, getJointEvents
, getJointEventsInto
, overlapAABB
, overlapShape
, castRay
, castRayClosest
, castShape
, castMover
, collideMover
, enableSleeping
, isSleepingEnabled
, enableContinuous
, isContinuousEnabled
, setRestitutionThreshold
, getRestitutionThreshold
, setHitEventThreshold
, getHitEventThreshold
, setCustomFilterCallback
, setPreSolveCallback
, setGravity
, getGravity
, getGravityInto
, explode
, setContactTuning
, setContactRecycleDistance
, getContactRecycleDistance
, setMaximumLinearSpeed
, getMaximumLinearSpeed
, enableWarmStarting
, isWarmStartingEnabled
, getAwakeBodyCount
, getProfile
, getCounters
, getMaxCapacity
, getMaxCapacityInto
, setUserData
, getUserData
, setFrictionCallback
, setRestitutionCallback
, setWorkerCount
, getWorkerCount
, dumpMemoryStats
, rebuildStaticTree
, enableSpeculative
, startRecording
, stopRecording
, snapshot
, restore
, createFromSnapshot
)
where
import Foreign
import Foreign.C.Types (CBool(..), CInt(..))
import Box2D.Id (WorldId(..))
import Box2D.MathTypes (AABB, Pos, Vec2)
import Box2D.Tags (CastResultFcn, Counters, CustomFilterFcn, DebugDraw, FrictionCallback, OverlapResultFcn, PlaneResultFcn, PreSolveFcn, Profile, Recording, RestitutionCallback, ShapeProxy)
import Box2D.Types (BodyEvents, Capacity, Capsule, ContactEvents, ExplosionDef, JointEvents, QueryFilter, RayResult, SensorEvents, TreeStats, WorldDef)
foreign import ccall unsafe "b2CreateWorld"
c_b2CreateWorld :: Ptr WorldDef -> IO WorldId
foreign import ccall unsafe "b2DestroyWorld"
c_b2DestroyWorld :: WorldId -> IO ()
foreign import ccall unsafe "b2World_IsValid"
c_b2World_IsValid :: WorldId -> IO CBool
foreign import ccall safe "b2World_Step"
c_b2World_Step :: WorldId -> Float -> CInt -> IO ()
foreign import ccall unsafe "b2World_Draw"
c_b2World_Draw :: WorldId -> Ptr DebugDraw -> IO ()
foreign import ccall unsafe "hsg_b2World_GetBounds"
c_b2World_GetBounds :: WorldId -> Ptr AABB -> IO ()
foreign import ccall unsafe "hsg_b2World_GetBodyEvents"
c_b2World_GetBodyEvents :: WorldId -> Ptr BodyEvents -> IO ()
foreign import ccall unsafe "hsg_b2World_GetSensorEvents"
c_b2World_GetSensorEvents :: WorldId -> Ptr SensorEvents -> IO ()
foreign import ccall unsafe "hsg_b2World_GetContactEvents"
c_b2World_GetContactEvents :: WorldId -> Ptr ContactEvents -> IO ()
foreign import ccall unsafe "hsg_b2World_GetJointEvents"
c_b2World_GetJointEvents :: WorldId -> Ptr JointEvents -> IO ()
foreign import ccall safe "hsg_b2World_OverlapAABB"
c_b2World_OverlapAABB :: WorldId -> Ptr Pos -> Ptr AABB -> Ptr QueryFilter -> FunPtr OverlapResultFcn -> Ptr () -> Ptr TreeStats -> IO ()
foreign import ccall safe "hsg_b2World_OverlapShape"
c_b2World_OverlapShape :: WorldId -> Ptr Pos -> Ptr ShapeProxy -> Ptr QueryFilter -> FunPtr OverlapResultFcn -> Ptr () -> Ptr TreeStats -> IO ()
foreign import ccall safe "hsg_b2World_CastRay"
c_b2World_CastRay :: WorldId -> Ptr Pos -> Ptr Vec2 -> Ptr QueryFilter -> FunPtr CastResultFcn -> Ptr () -> Ptr TreeStats -> IO ()
foreign import ccall unsafe "hsg_b2World_CastRayClosest"
c_b2World_CastRayClosest :: WorldId -> Ptr Pos -> Ptr Vec2 -> Ptr QueryFilter -> Ptr RayResult -> IO ()
foreign import ccall safe "hsg_b2World_CastShape"
c_b2World_CastShape :: WorldId -> Ptr Pos -> Ptr ShapeProxy -> Ptr Vec2 -> Ptr QueryFilter -> FunPtr CastResultFcn -> Ptr () -> Ptr TreeStats -> IO ()
foreign import ccall unsafe "hsg_b2World_CastMover"
c_b2World_CastMover :: WorldId -> Ptr Pos -> Ptr Capsule -> Ptr Vec2 -> Ptr QueryFilter -> IO Float
foreign import ccall safe "hsg_b2World_CollideMover"
c_b2World_CollideMover :: WorldId -> Ptr Pos -> Ptr Capsule -> Ptr QueryFilter -> FunPtr PlaneResultFcn -> Ptr () -> IO ()
foreign import ccall unsafe "b2World_EnableSleeping"
c_b2World_EnableSleeping :: WorldId -> CBool -> IO ()
foreign import ccall unsafe "b2World_IsSleepingEnabled"
c_b2World_IsSleepingEnabled :: WorldId -> IO CBool
foreign import ccall unsafe "b2World_EnableContinuous"
c_b2World_EnableContinuous :: WorldId -> CBool -> IO ()
foreign import ccall unsafe "b2World_IsContinuousEnabled"
c_b2World_IsContinuousEnabled :: WorldId -> IO CBool
foreign import ccall unsafe "b2World_SetRestitutionThreshold"
c_b2World_SetRestitutionThreshold :: WorldId -> Float -> IO ()
foreign import ccall unsafe "b2World_GetRestitutionThreshold"
c_b2World_GetRestitutionThreshold :: WorldId -> IO Float
foreign import ccall unsafe "b2World_SetHitEventThreshold"
c_b2World_SetHitEventThreshold :: WorldId -> Float -> IO ()
foreign import ccall unsafe "b2World_GetHitEventThreshold"
c_b2World_GetHitEventThreshold :: WorldId -> IO Float
foreign import ccall safe "b2World_SetCustomFilterCallback"
c_b2World_SetCustomFilterCallback :: WorldId -> FunPtr CustomFilterFcn -> Ptr () -> IO ()
foreign import ccall safe "b2World_SetPreSolveCallback"
c_b2World_SetPreSolveCallback :: WorldId -> FunPtr PreSolveFcn -> Ptr () -> IO ()
foreign import ccall unsafe "hsg_b2World_SetGravity"
c_b2World_SetGravity :: WorldId -> Ptr Vec2 -> IO ()
foreign import ccall unsafe "hsg_b2World_GetGravity"
c_b2World_GetGravity :: WorldId -> Ptr Vec2 -> IO ()
foreign import ccall unsafe "b2World_Explode"
c_b2World_Explode :: WorldId -> Ptr ExplosionDef -> IO ()
foreign import ccall unsafe "b2World_SetContactTuning"
c_b2World_SetContactTuning :: WorldId -> Float -> Float -> Float -> IO ()
foreign import ccall unsafe "b2World_SetContactRecycleDistance"
c_b2World_SetContactRecycleDistance :: WorldId -> Float -> IO ()
foreign import ccall unsafe "b2World_GetContactRecycleDistance"
c_b2World_GetContactRecycleDistance :: WorldId -> IO Float
foreign import ccall unsafe "b2World_SetMaximumLinearSpeed"
c_b2World_SetMaximumLinearSpeed :: WorldId -> Float -> IO ()
foreign import ccall unsafe "b2World_GetMaximumLinearSpeed"
c_b2World_GetMaximumLinearSpeed :: WorldId -> IO Float
foreign import ccall unsafe "b2World_EnableWarmStarting"
c_b2World_EnableWarmStarting :: WorldId -> CBool -> IO ()
foreign import ccall unsafe "b2World_IsWarmStartingEnabled"
c_b2World_IsWarmStartingEnabled :: WorldId -> IO CBool
foreign import ccall unsafe "b2World_GetAwakeBodyCount"
c_b2World_GetAwakeBodyCount :: WorldId -> IO CInt
foreign import ccall unsafe "hsg_b2World_GetProfile"
c_b2World_GetProfile :: WorldId -> Ptr Profile -> IO ()
foreign import ccall unsafe "hsg_b2World_GetCounters"
c_b2World_GetCounters :: WorldId -> Ptr Counters -> IO ()
foreign import ccall unsafe "hsg_b2World_GetMaxCapacity"
c_b2World_GetMaxCapacity :: WorldId -> Ptr Capacity -> IO ()
foreign import ccall unsafe "b2World_SetUserData"
c_b2World_SetUserData :: WorldId -> Ptr () -> IO ()
foreign import ccall unsafe "b2World_GetUserData"
c_b2World_GetUserData :: WorldId -> IO (Ptr ())
foreign import ccall safe "b2World_SetFrictionCallback"
c_b2World_SetFrictionCallback :: WorldId -> FunPtr FrictionCallback -> IO ()
foreign import ccall safe "b2World_SetRestitutionCallback"
c_b2World_SetRestitutionCallback :: WorldId -> FunPtr RestitutionCallback -> IO ()
foreign import ccall unsafe "b2World_SetWorkerCount"
c_b2World_SetWorkerCount :: WorldId -> CInt -> IO ()
foreign import ccall unsafe "b2World_GetWorkerCount"
c_b2World_GetWorkerCount :: WorldId -> IO CInt
foreign import ccall unsafe "b2World_DumpMemoryStats"
c_b2World_DumpMemoryStats :: WorldId -> IO ()
foreign import ccall unsafe "b2World_RebuildStaticTree"
c_b2World_RebuildStaticTree :: WorldId -> IO ()
foreign import ccall unsafe "b2World_EnableSpeculative"
c_b2World_EnableSpeculative :: WorldId -> CBool -> IO ()
foreign import ccall unsafe "b2World_StartRecording"
c_b2World_StartRecording :: WorldId -> Ptr Recording -> IO ()
foreign import ccall unsafe "b2World_StopRecording"
c_b2World_StopRecording :: WorldId -> IO ()
foreign import ccall unsafe "b2World_Snapshot"
c_b2World_Snapshot :: WorldId -> Ptr Word8 -> CInt -> IO CInt
foreign import ccall unsafe "b2World_Restore"
c_b2World_Restore :: WorldId -> Ptr Word8 -> CInt -> IO CBool
foreign import ccall unsafe "b2CreateWorldFromSnapshot"
c_b2CreateWorldFromSnapshot :: Ptr Word8 -> CInt -> CInt -> IO WorldId
create
:: WorldDef
-> IO WorldId
create :: WorldDef -> IO WorldId
create WorldDef
a0 =
WorldDef -> (Ptr WorldDef -> IO WorldId) -> IO WorldId
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with WorldDef
a0 ((Ptr WorldDef -> IO WorldId) -> IO WorldId)
-> (Ptr WorldDef -> IO WorldId) -> IO WorldId
forall a b. (a -> b) -> a -> b
$ \Ptr WorldDef
p0 ->
Ptr WorldDef -> IO WorldId
c_b2CreateWorld Ptr WorldDef
p0
destroy
:: WorldId
-> IO ()
destroy :: WorldId -> IO ()
destroy WorldId
a0 =
WorldId -> IO ()
c_b2DestroyWorld WorldId
a0
isValid
:: WorldId
-> IO Bool
isValid :: WorldId -> IO Bool
isValid WorldId
a0 =
CBool -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (CBool -> Bool) -> IO CBool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (WorldId -> IO CBool
c_b2World_IsValid WorldId
a0)
step
:: WorldId
-> Float
-> Int
-> IO ()
step :: WorldId -> Float -> Int -> IO ()
step WorldId
a0 Float
a1 Int
a2 =
WorldId -> Float -> CInt -> IO ()
c_b2World_Step WorldId
a0 Float
a1 (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2)
draw
:: WorldId
-> Ptr DebugDraw
-> IO ()
draw :: WorldId -> Ptr DebugDraw -> IO ()
draw WorldId
a0 Ptr DebugDraw
a1 =
WorldId -> Ptr DebugDraw -> IO ()
c_b2World_Draw WorldId
a0 Ptr DebugDraw
a1
getBounds
:: WorldId
-> IO AABB
getBounds :: WorldId -> IO AABB
getBounds WorldId
a0 =
(Ptr AABB -> IO AABB) -> IO AABB
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr AABB -> IO AABB) -> IO AABB)
-> (Ptr AABB -> IO AABB) -> IO AABB
forall a b. (a -> b) -> a -> b
$ \Ptr AABB
pOut -> WorldId -> Ptr AABB -> IO ()
c_b2World_GetBounds WorldId
a0 Ptr AABB
pOut IO () -> IO AABB -> IO AABB
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr AABB -> IO AABB
forall a. Storable a => Ptr a -> IO a
peek Ptr AABB
pOut
getBoundsInto
:: WorldId
-> Ptr AABB
-> IO ()
getBoundsInto :: WorldId -> Ptr AABB -> IO ()
getBoundsInto WorldId
a0 Ptr AABB
out =
WorldId -> Ptr AABB -> IO ()
c_b2World_GetBounds WorldId
a0 Ptr AABB
out
getBodyEvents
:: WorldId
-> IO BodyEvents
getBodyEvents :: WorldId -> IO BodyEvents
getBodyEvents WorldId
a0 =
(Ptr BodyEvents -> IO BodyEvents) -> IO BodyEvents
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr BodyEvents -> IO BodyEvents) -> IO BodyEvents)
-> (Ptr BodyEvents -> IO BodyEvents) -> IO BodyEvents
forall a b. (a -> b) -> a -> b
$ \Ptr BodyEvents
pOut -> WorldId -> Ptr BodyEvents -> IO ()
c_b2World_GetBodyEvents WorldId
a0 Ptr BodyEvents
pOut IO () -> IO BodyEvents -> IO BodyEvents
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr BodyEvents -> IO BodyEvents
forall a. Storable a => Ptr a -> IO a
peek Ptr BodyEvents
pOut
getBodyEventsInto
:: WorldId
-> Ptr BodyEvents
-> IO ()
getBodyEventsInto :: WorldId -> Ptr BodyEvents -> IO ()
getBodyEventsInto WorldId
a0 Ptr BodyEvents
out =
WorldId -> Ptr BodyEvents -> IO ()
c_b2World_GetBodyEvents WorldId
a0 Ptr BodyEvents
out
getSensorEvents
:: WorldId
-> IO SensorEvents
getSensorEvents :: WorldId -> IO SensorEvents
getSensorEvents WorldId
a0 =
(Ptr SensorEvents -> IO SensorEvents) -> IO SensorEvents
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr SensorEvents -> IO SensorEvents) -> IO SensorEvents)
-> (Ptr SensorEvents -> IO SensorEvents) -> IO SensorEvents
forall a b. (a -> b) -> a -> b
$ \Ptr SensorEvents
pOut -> WorldId -> Ptr SensorEvents -> IO ()
c_b2World_GetSensorEvents WorldId
a0 Ptr SensorEvents
pOut IO () -> IO SensorEvents -> IO SensorEvents
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr SensorEvents -> IO SensorEvents
forall a. Storable a => Ptr a -> IO a
peek Ptr SensorEvents
pOut
getSensorEventsInto
:: WorldId
-> Ptr SensorEvents
-> IO ()
getSensorEventsInto :: WorldId -> Ptr SensorEvents -> IO ()
getSensorEventsInto WorldId
a0 Ptr SensorEvents
out =
WorldId -> Ptr SensorEvents -> IO ()
c_b2World_GetSensorEvents WorldId
a0 Ptr SensorEvents
out
getContactEvents
:: WorldId
-> IO ContactEvents
getContactEvents :: WorldId -> IO ContactEvents
getContactEvents WorldId
a0 =
(Ptr ContactEvents -> IO ContactEvents) -> IO ContactEvents
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr ContactEvents -> IO ContactEvents) -> IO ContactEvents)
-> (Ptr ContactEvents -> IO ContactEvents) -> IO ContactEvents
forall a b. (a -> b) -> a -> b
$ \Ptr ContactEvents
pOut -> WorldId -> Ptr ContactEvents -> IO ()
c_b2World_GetContactEvents WorldId
a0 Ptr ContactEvents
pOut IO () -> IO ContactEvents -> IO ContactEvents
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr ContactEvents -> IO ContactEvents
forall a. Storable a => Ptr a -> IO a
peek Ptr ContactEvents
pOut
getContactEventsInto
:: WorldId
-> Ptr ContactEvents
-> IO ()
getContactEventsInto :: WorldId -> Ptr ContactEvents -> IO ()
getContactEventsInto WorldId
a0 Ptr ContactEvents
out =
WorldId -> Ptr ContactEvents -> IO ()
c_b2World_GetContactEvents WorldId
a0 Ptr ContactEvents
out
getJointEvents
:: WorldId
-> IO JointEvents
getJointEvents :: WorldId -> IO JointEvents
getJointEvents WorldId
a0 =
(Ptr JointEvents -> IO JointEvents) -> IO JointEvents
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr JointEvents -> IO JointEvents) -> IO JointEvents)
-> (Ptr JointEvents -> IO JointEvents) -> IO JointEvents
forall a b. (a -> b) -> a -> b
$ \Ptr JointEvents
pOut -> WorldId -> Ptr JointEvents -> IO ()
c_b2World_GetJointEvents WorldId
a0 Ptr JointEvents
pOut IO () -> IO JointEvents -> IO JointEvents
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr JointEvents -> IO JointEvents
forall a. Storable a => Ptr a -> IO a
peek Ptr JointEvents
pOut
getJointEventsInto
:: WorldId
-> Ptr JointEvents
-> IO ()
getJointEventsInto :: WorldId -> Ptr JointEvents -> IO ()
getJointEventsInto WorldId
a0 Ptr JointEvents
out =
WorldId -> Ptr JointEvents -> IO ()
c_b2World_GetJointEvents WorldId
a0 Ptr JointEvents
out
overlapAABB
:: WorldId
-> Pos
-> AABB
-> QueryFilter
-> FunPtr OverlapResultFcn
-> Ptr ()
-> IO TreeStats
overlapAABB :: WorldId
-> Vec2
-> AABB
-> QueryFilter
-> FunPtr OverlapResultFcn
-> Ptr ()
-> IO TreeStats
overlapAABB WorldId
a0 Vec2
a1 AABB
a2 QueryFilter
a3 FunPtr OverlapResultFcn
a4 Ptr ()
a5 =
Vec2 -> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a1 ((Ptr Vec2 -> IO TreeStats) -> IO TreeStats)
-> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p1 ->
AABB -> (Ptr AABB -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with AABB
a2 ((Ptr AABB -> IO TreeStats) -> IO TreeStats)
-> (Ptr AABB -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr AABB
p2 ->
QueryFilter -> (Ptr QueryFilter -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with QueryFilter
a3 ((Ptr QueryFilter -> IO TreeStats) -> IO TreeStats)
-> (Ptr QueryFilter -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr QueryFilter
p3 ->
(Ptr TreeStats -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr TreeStats -> IO TreeStats) -> IO TreeStats)
-> (Ptr TreeStats -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr TreeStats
pOut -> WorldId
-> Ptr Vec2
-> Ptr AABB
-> Ptr QueryFilter
-> FunPtr OverlapResultFcn
-> Ptr ()
-> Ptr TreeStats
-> IO ()
c_b2World_OverlapAABB WorldId
a0 Ptr Vec2
p1 Ptr AABB
p2 Ptr QueryFilter
p3 FunPtr OverlapResultFcn
a4 Ptr ()
a5 Ptr TreeStats
pOut IO () -> IO TreeStats -> IO TreeStats
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr TreeStats -> IO TreeStats
forall a. Storable a => Ptr a -> IO a
peek Ptr TreeStats
pOut
overlapShape
:: WorldId
-> Pos
-> Ptr ShapeProxy
-> QueryFilter
-> FunPtr OverlapResultFcn
-> Ptr ()
-> IO TreeStats
overlapShape :: WorldId
-> Vec2
-> Ptr ShapeProxy
-> QueryFilter
-> FunPtr OverlapResultFcn
-> Ptr ()
-> IO TreeStats
overlapShape WorldId
a0 Vec2
a1 Ptr ShapeProxy
a2 QueryFilter
a3 FunPtr OverlapResultFcn
a4 Ptr ()
a5 =
Vec2 -> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a1 ((Ptr Vec2 -> IO TreeStats) -> IO TreeStats)
-> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p1 ->
QueryFilter -> (Ptr QueryFilter -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with QueryFilter
a3 ((Ptr QueryFilter -> IO TreeStats) -> IO TreeStats)
-> (Ptr QueryFilter -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr QueryFilter
p3 ->
(Ptr TreeStats -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr TreeStats -> IO TreeStats) -> IO TreeStats)
-> (Ptr TreeStats -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr TreeStats
pOut -> WorldId
-> Ptr Vec2
-> Ptr ShapeProxy
-> Ptr QueryFilter
-> FunPtr OverlapResultFcn
-> Ptr ()
-> Ptr TreeStats
-> IO ()
c_b2World_OverlapShape WorldId
a0 Ptr Vec2
p1 Ptr ShapeProxy
a2 Ptr QueryFilter
p3 FunPtr OverlapResultFcn
a4 Ptr ()
a5 Ptr TreeStats
pOut IO () -> IO TreeStats -> IO TreeStats
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr TreeStats -> IO TreeStats
forall a. Storable a => Ptr a -> IO a
peek Ptr TreeStats
pOut
castRay
:: WorldId
-> Pos
-> Vec2
-> QueryFilter
-> FunPtr CastResultFcn
-> Ptr ()
-> IO TreeStats
castRay :: WorldId
-> Vec2
-> Vec2
-> QueryFilter
-> FunPtr CastResultFcn
-> Ptr ()
-> IO TreeStats
castRay WorldId
a0 Vec2
a1 Vec2
a2 QueryFilter
a3 FunPtr CastResultFcn
a4 Ptr ()
a5 =
Vec2 -> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a1 ((Ptr Vec2 -> IO TreeStats) -> IO TreeStats)
-> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p1 ->
Vec2 -> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a2 ((Ptr Vec2 -> IO TreeStats) -> IO TreeStats)
-> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p2 ->
QueryFilter -> (Ptr QueryFilter -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with QueryFilter
a3 ((Ptr QueryFilter -> IO TreeStats) -> IO TreeStats)
-> (Ptr QueryFilter -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr QueryFilter
p3 ->
(Ptr TreeStats -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr TreeStats -> IO TreeStats) -> IO TreeStats)
-> (Ptr TreeStats -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr TreeStats
pOut -> WorldId
-> Ptr Vec2
-> Ptr Vec2
-> Ptr QueryFilter
-> FunPtr CastResultFcn
-> Ptr ()
-> Ptr TreeStats
-> IO ()
c_b2World_CastRay WorldId
a0 Ptr Vec2
p1 Ptr Vec2
p2 Ptr QueryFilter
p3 FunPtr CastResultFcn
a4 Ptr ()
a5 Ptr TreeStats
pOut IO () -> IO TreeStats -> IO TreeStats
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr TreeStats -> IO TreeStats
forall a. Storable a => Ptr a -> IO a
peek Ptr TreeStats
pOut
castRayClosest
:: WorldId
-> Pos
-> Vec2
-> QueryFilter
-> IO RayResult
castRayClosest :: WorldId -> Vec2 -> Vec2 -> QueryFilter -> IO RayResult
castRayClosest WorldId
a0 Vec2
a1 Vec2
a2 QueryFilter
a3 =
Vec2 -> (Ptr Vec2 -> IO RayResult) -> IO RayResult
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a1 ((Ptr Vec2 -> IO RayResult) -> IO RayResult)
-> (Ptr Vec2 -> IO RayResult) -> IO RayResult
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p1 ->
Vec2 -> (Ptr Vec2 -> IO RayResult) -> IO RayResult
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a2 ((Ptr Vec2 -> IO RayResult) -> IO RayResult)
-> (Ptr Vec2 -> IO RayResult) -> IO RayResult
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p2 ->
QueryFilter -> (Ptr QueryFilter -> IO RayResult) -> IO RayResult
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with QueryFilter
a3 ((Ptr QueryFilter -> IO RayResult) -> IO RayResult)
-> (Ptr QueryFilter -> IO RayResult) -> IO RayResult
forall a b. (a -> b) -> a -> b
$ \Ptr QueryFilter
p3 ->
(Ptr RayResult -> IO RayResult) -> IO RayResult
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr RayResult -> IO RayResult) -> IO RayResult)
-> (Ptr RayResult -> IO RayResult) -> IO RayResult
forall a b. (a -> b) -> a -> b
$ \Ptr RayResult
pOut -> WorldId
-> Ptr Vec2
-> Ptr Vec2
-> Ptr QueryFilter
-> Ptr RayResult
-> IO ()
c_b2World_CastRayClosest WorldId
a0 Ptr Vec2
p1 Ptr Vec2
p2 Ptr QueryFilter
p3 Ptr RayResult
pOut IO () -> IO RayResult -> IO RayResult
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr RayResult -> IO RayResult
forall a. Storable a => Ptr a -> IO a
peek Ptr RayResult
pOut
castShape
:: WorldId
-> Pos
-> Ptr ShapeProxy
-> Vec2
-> QueryFilter
-> FunPtr CastResultFcn
-> Ptr ()
-> IO TreeStats
castShape :: WorldId
-> Vec2
-> Ptr ShapeProxy
-> Vec2
-> QueryFilter
-> FunPtr CastResultFcn
-> Ptr ()
-> IO TreeStats
castShape WorldId
a0 Vec2
a1 Ptr ShapeProxy
a2 Vec2
a3 QueryFilter
a4 FunPtr CastResultFcn
a5 Ptr ()
a6 =
Vec2 -> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a1 ((Ptr Vec2 -> IO TreeStats) -> IO TreeStats)
-> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p1 ->
Vec2 -> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a3 ((Ptr Vec2 -> IO TreeStats) -> IO TreeStats)
-> (Ptr Vec2 -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p3 ->
QueryFilter -> (Ptr QueryFilter -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with QueryFilter
a4 ((Ptr QueryFilter -> IO TreeStats) -> IO TreeStats)
-> (Ptr QueryFilter -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr QueryFilter
p4 ->
(Ptr TreeStats -> IO TreeStats) -> IO TreeStats
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr TreeStats -> IO TreeStats) -> IO TreeStats)
-> (Ptr TreeStats -> IO TreeStats) -> IO TreeStats
forall a b. (a -> b) -> a -> b
$ \Ptr TreeStats
pOut -> WorldId
-> Ptr Vec2
-> Ptr ShapeProxy
-> Ptr Vec2
-> Ptr QueryFilter
-> FunPtr CastResultFcn
-> Ptr ()
-> Ptr TreeStats
-> IO ()
c_b2World_CastShape WorldId
a0 Ptr Vec2
p1 Ptr ShapeProxy
a2 Ptr Vec2
p3 Ptr QueryFilter
p4 FunPtr CastResultFcn
a5 Ptr ()
a6 Ptr TreeStats
pOut IO () -> IO TreeStats -> IO TreeStats
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr TreeStats -> IO TreeStats
forall a. Storable a => Ptr a -> IO a
peek Ptr TreeStats
pOut
castMover
:: WorldId
-> Pos
-> Capsule
-> Vec2
-> QueryFilter
-> IO Float
castMover :: WorldId -> Vec2 -> Capsule -> Vec2 -> QueryFilter -> IO Float
castMover WorldId
a0 Vec2
a1 Capsule
a2 Vec2
a3 QueryFilter
a4 =
Vec2 -> (Ptr Vec2 -> IO Float) -> IO Float
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a1 ((Ptr Vec2 -> IO Float) -> IO Float)
-> (Ptr Vec2 -> IO Float) -> IO Float
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p1 ->
Capsule -> (Ptr Capsule -> IO Float) -> IO Float
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Capsule
a2 ((Ptr Capsule -> IO Float) -> IO Float)
-> (Ptr Capsule -> IO Float) -> IO Float
forall a b. (a -> b) -> a -> b
$ \Ptr Capsule
p2 ->
Vec2 -> (Ptr Vec2 -> IO Float) -> IO Float
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a3 ((Ptr Vec2 -> IO Float) -> IO Float)
-> (Ptr Vec2 -> IO Float) -> IO Float
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p3 ->
QueryFilter -> (Ptr QueryFilter -> IO Float) -> IO Float
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with QueryFilter
a4 ((Ptr QueryFilter -> IO Float) -> IO Float)
-> (Ptr QueryFilter -> IO Float) -> IO Float
forall a b. (a -> b) -> a -> b
$ \Ptr QueryFilter
p4 ->
WorldId
-> Ptr Vec2
-> Ptr Capsule
-> Ptr Vec2
-> Ptr QueryFilter
-> IO Float
c_b2World_CastMover WorldId
a0 Ptr Vec2
p1 Ptr Capsule
p2 Ptr Vec2
p3 Ptr QueryFilter
p4
collideMover
:: WorldId
-> Pos
-> Capsule
-> QueryFilter
-> FunPtr PlaneResultFcn
-> Ptr ()
-> IO ()
collideMover :: WorldId
-> Vec2
-> Capsule
-> QueryFilter
-> FunPtr PlaneResultFcn
-> Ptr ()
-> IO ()
collideMover WorldId
a0 Vec2
a1 Capsule
a2 QueryFilter
a3 FunPtr PlaneResultFcn
a4 Ptr ()
a5 =
Vec2 -> (Ptr Vec2 -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a1 ((Ptr Vec2 -> IO ()) -> IO ()) -> (Ptr Vec2 -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p1 ->
Capsule -> (Ptr Capsule -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Capsule
a2 ((Ptr Capsule -> IO ()) -> IO ())
-> (Ptr Capsule -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Capsule
p2 ->
QueryFilter -> (Ptr QueryFilter -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with QueryFilter
a3 ((Ptr QueryFilter -> IO ()) -> IO ())
-> (Ptr QueryFilter -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr QueryFilter
p3 ->
WorldId
-> Ptr Vec2
-> Ptr Capsule
-> Ptr QueryFilter
-> FunPtr PlaneResultFcn
-> Ptr ()
-> IO ()
c_b2World_CollideMover WorldId
a0 Ptr Vec2
p1 Ptr Capsule
p2 Ptr QueryFilter
p3 FunPtr PlaneResultFcn
a4 Ptr ()
a5
enableSleeping
:: WorldId
-> Bool
-> IO ()
enableSleeping :: WorldId -> Bool -> IO ()
enableSleeping WorldId
a0 Bool
a1 =
WorldId -> CBool -> IO ()
c_b2World_EnableSleeping WorldId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
isSleepingEnabled
:: WorldId
-> IO Bool
isSleepingEnabled :: WorldId -> IO Bool
isSleepingEnabled WorldId
a0 =
CBool -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (CBool -> Bool) -> IO CBool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (WorldId -> IO CBool
c_b2World_IsSleepingEnabled WorldId
a0)
enableContinuous
:: WorldId
-> Bool
-> IO ()
enableContinuous :: WorldId -> Bool -> IO ()
enableContinuous WorldId
a0 Bool
a1 =
WorldId -> CBool -> IO ()
c_b2World_EnableContinuous WorldId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
isContinuousEnabled
:: WorldId
-> IO Bool
isContinuousEnabled :: WorldId -> IO Bool
isContinuousEnabled WorldId
a0 =
CBool -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (CBool -> Bool) -> IO CBool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (WorldId -> IO CBool
c_b2World_IsContinuousEnabled WorldId
a0)
setRestitutionThreshold
:: WorldId
-> Float
-> IO ()
setRestitutionThreshold :: WorldId -> Float -> IO ()
setRestitutionThreshold WorldId
a0 Float
a1 =
WorldId -> Float -> IO ()
c_b2World_SetRestitutionThreshold WorldId
a0 Float
a1
getRestitutionThreshold
:: WorldId
-> IO Float
getRestitutionThreshold :: WorldId -> IO Float
getRestitutionThreshold WorldId
a0 =
WorldId -> IO Float
c_b2World_GetRestitutionThreshold WorldId
a0
setHitEventThreshold
:: WorldId
-> Float
-> IO ()
setHitEventThreshold :: WorldId -> Float -> IO ()
setHitEventThreshold WorldId
a0 Float
a1 =
WorldId -> Float -> IO ()
c_b2World_SetHitEventThreshold WorldId
a0 Float
a1
getHitEventThreshold
:: WorldId
-> IO Float
getHitEventThreshold :: WorldId -> IO Float
getHitEventThreshold WorldId
a0 =
WorldId -> IO Float
c_b2World_GetHitEventThreshold WorldId
a0
setCustomFilterCallback
:: WorldId
-> FunPtr CustomFilterFcn
-> Ptr ()
-> IO ()
setCustomFilterCallback :: WorldId -> FunPtr CustomFilterFcn -> Ptr () -> IO ()
setCustomFilterCallback WorldId
a0 FunPtr CustomFilterFcn
a1 Ptr ()
a2 =
WorldId -> FunPtr CustomFilterFcn -> Ptr () -> IO ()
c_b2World_SetCustomFilterCallback WorldId
a0 FunPtr CustomFilterFcn
a1 Ptr ()
a2
setPreSolveCallback
:: WorldId
-> FunPtr PreSolveFcn
-> Ptr ()
-> IO ()
setPreSolveCallback :: WorldId -> FunPtr PreSolveFcn -> Ptr () -> IO ()
setPreSolveCallback WorldId
a0 FunPtr PreSolveFcn
a1 Ptr ()
a2 =
WorldId -> FunPtr PreSolveFcn -> Ptr () -> IO ()
c_b2World_SetPreSolveCallback WorldId
a0 FunPtr PreSolveFcn
a1 Ptr ()
a2
setGravity
:: WorldId
-> Vec2
-> IO ()
setGravity :: WorldId -> Vec2 -> IO ()
setGravity WorldId
a0 Vec2
a1 =
Vec2 -> (Ptr Vec2 -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Vec2
a1 ((Ptr Vec2 -> IO ()) -> IO ()) -> (Ptr Vec2 -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
p1 ->
WorldId -> Ptr Vec2 -> IO ()
c_b2World_SetGravity WorldId
a0 Ptr Vec2
p1
getGravity
:: WorldId
-> IO Vec2
getGravity :: WorldId -> IO Vec2
getGravity WorldId
a0 =
(Ptr Vec2 -> IO Vec2) -> IO Vec2
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Vec2 -> IO Vec2) -> IO Vec2)
-> (Ptr Vec2 -> IO Vec2) -> IO Vec2
forall a b. (a -> b) -> a -> b
$ \Ptr Vec2
pOut -> WorldId -> Ptr Vec2 -> IO ()
c_b2World_GetGravity WorldId
a0 Ptr Vec2
pOut IO () -> IO Vec2 -> IO Vec2
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Vec2 -> IO Vec2
forall a. Storable a => Ptr a -> IO a
peek Ptr Vec2
pOut
getGravityInto
:: WorldId
-> Ptr Vec2
-> IO ()
getGravityInto :: WorldId -> Ptr Vec2 -> IO ()
getGravityInto WorldId
a0 Ptr Vec2
out =
WorldId -> Ptr Vec2 -> IO ()
c_b2World_GetGravity WorldId
a0 Ptr Vec2
out
explode
:: WorldId
-> ExplosionDef
-> IO ()
explode :: WorldId -> ExplosionDef -> IO ()
explode WorldId
a0 ExplosionDef
a1 =
ExplosionDef -> (Ptr ExplosionDef -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with ExplosionDef
a1 ((Ptr ExplosionDef -> IO ()) -> IO ())
-> (Ptr ExplosionDef -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr ExplosionDef
p1 ->
WorldId -> Ptr ExplosionDef -> IO ()
c_b2World_Explode WorldId
a0 Ptr ExplosionDef
p1
setContactTuning
:: WorldId
-> Float
-> Float
-> Float
-> IO ()
setContactTuning :: WorldId -> Float -> Float -> Float -> IO ()
setContactTuning WorldId
a0 Float
a1 Float
a2 Float
a3 =
WorldId -> Float -> Float -> Float -> IO ()
c_b2World_SetContactTuning WorldId
a0 Float
a1 Float
a2 Float
a3
setContactRecycleDistance
:: WorldId
-> Float
-> IO ()
setContactRecycleDistance :: WorldId -> Float -> IO ()
setContactRecycleDistance WorldId
a0 Float
a1 =
WorldId -> Float -> IO ()
c_b2World_SetContactRecycleDistance WorldId
a0 Float
a1
getContactRecycleDistance
:: WorldId
-> IO Float
getContactRecycleDistance :: WorldId -> IO Float
getContactRecycleDistance WorldId
a0 =
WorldId -> IO Float
c_b2World_GetContactRecycleDistance WorldId
a0
setMaximumLinearSpeed
:: WorldId
-> Float
-> IO ()
setMaximumLinearSpeed :: WorldId -> Float -> IO ()
setMaximumLinearSpeed WorldId
a0 Float
a1 =
WorldId -> Float -> IO ()
c_b2World_SetMaximumLinearSpeed WorldId
a0 Float
a1
getMaximumLinearSpeed
:: WorldId
-> IO Float
getMaximumLinearSpeed :: WorldId -> IO Float
getMaximumLinearSpeed WorldId
a0 =
WorldId -> IO Float
c_b2World_GetMaximumLinearSpeed WorldId
a0
enableWarmStarting
:: WorldId
-> Bool
-> IO ()
enableWarmStarting :: WorldId -> Bool -> IO ()
enableWarmStarting WorldId
a0 Bool
a1 =
WorldId -> CBool -> IO ()
c_b2World_EnableWarmStarting WorldId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
isWarmStartingEnabled
:: WorldId
-> IO Bool
isWarmStartingEnabled :: WorldId -> IO Bool
isWarmStartingEnabled WorldId
a0 =
CBool -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (CBool -> Bool) -> IO CBool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (WorldId -> IO CBool
c_b2World_IsWarmStartingEnabled WorldId
a0)
getAwakeBodyCount
:: WorldId
-> IO Int
getAwakeBodyCount :: WorldId -> IO Int
getAwakeBodyCount WorldId
a0 =
CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (WorldId -> IO CInt
c_b2World_GetAwakeBodyCount WorldId
a0)
getProfile
:: WorldId
-> Ptr Profile
-> IO ()
getProfile :: WorldId -> Ptr Profile -> IO ()
getProfile WorldId
a0 Ptr Profile
out =
WorldId -> Ptr Profile -> IO ()
c_b2World_GetProfile WorldId
a0 Ptr Profile
out
getCounters
:: WorldId
-> Ptr Counters
-> IO ()
getCounters :: WorldId -> Ptr Counters -> IO ()
getCounters WorldId
a0 Ptr Counters
out =
WorldId -> Ptr Counters -> IO ()
c_b2World_GetCounters WorldId
a0 Ptr Counters
out
getMaxCapacity
:: WorldId
-> IO Capacity
getMaxCapacity :: WorldId -> IO Capacity
getMaxCapacity WorldId
a0 =
(Ptr Capacity -> IO Capacity) -> IO Capacity
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Capacity -> IO Capacity) -> IO Capacity)
-> (Ptr Capacity -> IO Capacity) -> IO Capacity
forall a b. (a -> b) -> a -> b
$ \Ptr Capacity
pOut -> WorldId -> Ptr Capacity -> IO ()
c_b2World_GetMaxCapacity WorldId
a0 Ptr Capacity
pOut IO () -> IO Capacity -> IO Capacity
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Capacity -> IO Capacity
forall a. Storable a => Ptr a -> IO a
peek Ptr Capacity
pOut
getMaxCapacityInto
:: WorldId
-> Ptr Capacity
-> IO ()
getMaxCapacityInto :: WorldId -> Ptr Capacity -> IO ()
getMaxCapacityInto WorldId
a0 Ptr Capacity
out =
WorldId -> Ptr Capacity -> IO ()
c_b2World_GetMaxCapacity WorldId
a0 Ptr Capacity
out
setUserData
:: WorldId
-> Ptr ()
-> IO ()
setUserData :: WorldId -> Ptr () -> IO ()
setUserData WorldId
a0 Ptr ()
a1 =
WorldId -> Ptr () -> IO ()
c_b2World_SetUserData WorldId
a0 Ptr ()
a1
getUserData
:: WorldId
-> IO (Ptr ())
getUserData :: WorldId -> IO (Ptr ())
getUserData WorldId
a0 =
WorldId -> IO (Ptr ())
c_b2World_GetUserData WorldId
a0
setFrictionCallback
:: WorldId
-> FunPtr FrictionCallback
-> IO ()
setFrictionCallback :: WorldId -> FunPtr FrictionCallback -> IO ()
setFrictionCallback WorldId
a0 FunPtr FrictionCallback
a1 =
WorldId -> FunPtr FrictionCallback -> IO ()
c_b2World_SetFrictionCallback WorldId
a0 FunPtr FrictionCallback
a1
setRestitutionCallback
:: WorldId
-> FunPtr RestitutionCallback
-> IO ()
setRestitutionCallback :: WorldId -> FunPtr RestitutionCallback -> IO ()
setRestitutionCallback WorldId
a0 FunPtr RestitutionCallback
a1 =
WorldId -> FunPtr RestitutionCallback -> IO ()
c_b2World_SetRestitutionCallback WorldId
a0 FunPtr RestitutionCallback
a1
setWorkerCount
:: WorldId
-> Int
-> IO ()
setWorkerCount :: WorldId -> Int -> IO ()
setWorkerCount WorldId
a0 Int
a1 =
WorldId -> CInt -> IO ()
c_b2World_SetWorkerCount WorldId
a0 (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a1)
getWorkerCount
:: WorldId
-> IO Int
getWorkerCount :: WorldId -> IO Int
getWorkerCount WorldId
a0 =
CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (WorldId -> IO CInt
c_b2World_GetWorkerCount WorldId
a0)
dumpMemoryStats
:: WorldId
-> IO ()
dumpMemoryStats :: WorldId -> IO ()
dumpMemoryStats WorldId
a0 =
WorldId -> IO ()
c_b2World_DumpMemoryStats WorldId
a0
rebuildStaticTree
:: WorldId
-> IO ()
rebuildStaticTree :: WorldId -> IO ()
rebuildStaticTree WorldId
a0 =
WorldId -> IO ()
c_b2World_RebuildStaticTree WorldId
a0
enableSpeculative
:: WorldId
-> Bool
-> IO ()
enableSpeculative :: WorldId -> Bool -> IO ()
enableSpeculative WorldId
a0 Bool
a1 =
WorldId -> CBool -> IO ()
c_b2World_EnableSpeculative WorldId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
startRecording
:: WorldId
-> Ptr Recording
-> IO ()
startRecording :: WorldId -> Ptr Recording -> IO ()
startRecording WorldId
a0 Ptr Recording
a1 =
WorldId -> Ptr Recording -> IO ()
c_b2World_StartRecording WorldId
a0 Ptr Recording
a1
stopRecording
:: WorldId
-> IO ()
stopRecording :: WorldId -> IO ()
stopRecording WorldId
a0 =
WorldId -> IO ()
c_b2World_StopRecording WorldId
a0
snapshot
:: WorldId
-> Ptr Word8
-> Int
-> IO Int
snapshot :: WorldId -> Ptr Word8 -> Int -> IO Int
snapshot WorldId
a0 Ptr Word8
a1 Int
a2 =
CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (CInt -> Int) -> IO CInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (WorldId -> Ptr Word8 -> CInt -> IO CInt
c_b2World_Snapshot WorldId
a0 Ptr Word8
a1 (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2))
restore
:: WorldId
-> Ptr Word8
-> Int
-> IO Bool
restore :: WorldId -> Ptr Word8 -> Int -> IO Bool
restore WorldId
a0 Ptr Word8
a1 Int
a2 =
CBool -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (CBool -> Bool) -> IO CBool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (WorldId -> Ptr Word8 -> CInt -> IO CBool
c_b2World_Restore WorldId
a0 Ptr Word8
a1 (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2))
createFromSnapshot
:: Ptr Word8
-> Int
-> Int
-> IO WorldId
createFromSnapshot :: Ptr Word8 -> Int -> Int -> IO WorldId
createFromSnapshot Ptr Word8
a0 Int
a1 Int
a2 =
Ptr Word8 -> CInt -> CInt -> IO WorldId
c_b2CreateWorldFromSnapshot Ptr Word8
a0 (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a1) (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2)