module Box3D.Body
( create
, destroy
, isValid
, getType
, setType
, setName
, getName
, setUserData
, getUserData
, getPosition
, getPositionInto
, getRotation
, getRotationInto
, getTransform
, getTransformInto
, setTransform
, getLocalPoint
, getWorldPoint
, getLocalVector
, getWorldVector
, getLinearVelocity
, getLinearVelocityInto
, getAngularVelocity
, getAngularVelocityInto
, setLinearVelocity
, setAngularVelocity
, setTargetTransform
, getLocalPointVelocity
, getWorldPointVelocity
, applyForce
, applyForceToCenter
, applyTorque
, applyLinearImpulse
, applyLinearImpulseToCenter
, applyAngularImpulse
, getMass
, getLocalRotationalInertia
, getLocalRotationalInertiaInto
, getInverseMass
, getWorldInverseRotationalInertia
, getWorldInverseRotationalInertiaInto
, getLocalCenterOfMass
, getLocalCenterOfMassInto
, getWorldCenterOfMass
, getWorldCenterOfMassInto
, setMassData
, getMassData
, getMassDataInto
, applyMassFromShapes
, setLinearDamping
, getLinearDamping
, setAngularDamping
, getAngularDamping
, setGravityScale
, getGravityScale
, isAwake
, setAwake
, enableSleep
, isSleepEnabled
, setSleepThreshold
, getSleepThreshold
, isEnabled
, disable
, enable
, setMotionLocks
, getMotionLocks
, getMotionLocksInto
, setBullet
, isBullet
, enableContactRecycling
, isContactRecyclingEnabled
, enableHitEvents
, getWorld
, getShapeCount
, getShapes
, getJointCount
, getJoints
, getContactCapacity
, getContactData
, computeAABB
, computeAABBInto
, getClosestPoint
, castRay
, castShape
, overlapShape
, collideMover
)
where
import Foreign
import Foreign.C.Types (CBool(..), CInt(..))
import Foreign.C.String (CString)
import Data.Coerce (coerce)
import Box3D.Id (BodyId(..), JointId(..), ShapeId(..), WorldId(..))
import Box3D.MathTypes (AABB, Matrix3, Pos, Quat, Vec3, WorldTransform)
import Box3D.Tags (BodyCastResult, BodyPlaneResult, ContactData, ShapeProxy)
import Box3D.Types (BodyDef, BodyType(..), Capsule, MassData, MotionLocks, QueryFilter)
foreign import ccall unsafe "b3CreateBody"
c_b3CreateBody :: WorldId -> Ptr BodyDef -> IO BodyId
foreign import ccall unsafe "b3DestroyBody"
c_b3DestroyBody :: BodyId -> IO ()
foreign import ccall unsafe "b3Body_IsValid"
c_b3Body_IsValid :: BodyId -> IO CBool
foreign import ccall unsafe "b3Body_GetType"
c_b3Body_GetType :: BodyId -> IO CInt
foreign import ccall unsafe "b3Body_SetType"
c_b3Body_SetType :: BodyId -> CInt -> IO ()
foreign import ccall unsafe "b3Body_SetName"
c_b3Body_SetName :: BodyId -> CString -> IO ()
foreign import ccall unsafe "b3Body_GetName"
c_b3Body_GetName :: BodyId -> IO CString
foreign import ccall unsafe "b3Body_SetUserData"
c_b3Body_SetUserData :: BodyId -> Ptr () -> IO ()
foreign import ccall unsafe "b3Body_GetUserData"
c_b3Body_GetUserData :: BodyId -> IO (Ptr ())
foreign import ccall unsafe "hsg_b3Body_GetPosition"
c_b3Body_GetPosition :: BodyId -> Ptr Pos -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetRotation"
c_b3Body_GetRotation :: BodyId -> Ptr Quat -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetTransform"
c_b3Body_GetTransform :: BodyId -> Ptr WorldTransform -> IO ()
foreign import ccall unsafe "hsg_b3Body_SetTransform"
c_b3Body_SetTransform :: BodyId -> Ptr Pos -> Ptr Quat -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetLocalPoint"
c_b3Body_GetLocalPoint :: BodyId -> Ptr Pos -> Ptr Vec3 -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetWorldPoint"
c_b3Body_GetWorldPoint :: BodyId -> Ptr Vec3 -> Ptr Pos -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetLocalVector"
c_b3Body_GetLocalVector :: BodyId -> Ptr Vec3 -> Ptr Vec3 -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetWorldVector"
c_b3Body_GetWorldVector :: BodyId -> Ptr Vec3 -> Ptr Vec3 -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetLinearVelocity"
c_b3Body_GetLinearVelocity :: BodyId -> Ptr Vec3 -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetAngularVelocity"
c_b3Body_GetAngularVelocity :: BodyId -> Ptr Vec3 -> IO ()
foreign import ccall unsafe "hsg_b3Body_SetLinearVelocity"
c_b3Body_SetLinearVelocity :: BodyId -> Ptr Vec3 -> IO ()
foreign import ccall unsafe "hsg_b3Body_SetAngularVelocity"
c_b3Body_SetAngularVelocity :: BodyId -> Ptr Vec3 -> IO ()
foreign import ccall unsafe "hsg_b3Body_SetTargetTransform"
c_b3Body_SetTargetTransform :: BodyId -> Ptr WorldTransform -> Float -> CBool -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetLocalPointVelocity"
c_b3Body_GetLocalPointVelocity :: BodyId -> Ptr Vec3 -> Ptr Vec3 -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetWorldPointVelocity"
c_b3Body_GetWorldPointVelocity :: BodyId -> Ptr Pos -> Ptr Vec3 -> IO ()
foreign import ccall unsafe "hsg_b3Body_ApplyForce"
c_b3Body_ApplyForce :: BodyId -> Ptr Vec3 -> Ptr Pos -> CBool -> IO ()
foreign import ccall unsafe "hsg_b3Body_ApplyForceToCenter"
c_b3Body_ApplyForceToCenter :: BodyId -> Ptr Vec3 -> CBool -> IO ()
foreign import ccall unsafe "hsg_b3Body_ApplyTorque"
c_b3Body_ApplyTorque :: BodyId -> Ptr Vec3 -> CBool -> IO ()
foreign import ccall unsafe "hsg_b3Body_ApplyLinearImpulse"
c_b3Body_ApplyLinearImpulse :: BodyId -> Ptr Vec3 -> Ptr Pos -> CBool -> IO ()
foreign import ccall unsafe "hsg_b3Body_ApplyLinearImpulseToCenter"
c_b3Body_ApplyLinearImpulseToCenter :: BodyId -> Ptr Vec3 -> CBool -> IO ()
foreign import ccall unsafe "hsg_b3Body_ApplyAngularImpulse"
c_b3Body_ApplyAngularImpulse :: BodyId -> Ptr Vec3 -> CBool -> IO ()
foreign import ccall unsafe "b3Body_GetMass"
c_b3Body_GetMass :: BodyId -> IO Float
foreign import ccall unsafe "hsg_b3Body_GetLocalRotationalInertia"
c_b3Body_GetLocalRotationalInertia :: BodyId -> Ptr Matrix3 -> IO ()
foreign import ccall unsafe "b3Body_GetInverseMass"
c_b3Body_GetInverseMass :: BodyId -> IO Float
foreign import ccall unsafe "hsg_b3Body_GetWorldInverseRotationalInertia"
c_b3Body_GetWorldInverseRotationalInertia :: BodyId -> Ptr Matrix3 -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetLocalCenterOfMass"
c_b3Body_GetLocalCenterOfMass :: BodyId -> Ptr Vec3 -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetWorldCenterOfMass"
c_b3Body_GetWorldCenterOfMass :: BodyId -> Ptr Pos -> IO ()
foreign import ccall unsafe "hsg_b3Body_SetMassData"
c_b3Body_SetMassData :: BodyId -> Ptr MassData -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetMassData"
c_b3Body_GetMassData :: BodyId -> Ptr MassData -> IO ()
foreign import ccall unsafe "b3Body_ApplyMassFromShapes"
c_b3Body_ApplyMassFromShapes :: BodyId -> IO ()
foreign import ccall unsafe "b3Body_SetLinearDamping"
c_b3Body_SetLinearDamping :: BodyId -> Float -> IO ()
foreign import ccall unsafe "b3Body_GetLinearDamping"
c_b3Body_GetLinearDamping :: BodyId -> IO Float
foreign import ccall unsafe "b3Body_SetAngularDamping"
c_b3Body_SetAngularDamping :: BodyId -> Float -> IO ()
foreign import ccall unsafe "b3Body_GetAngularDamping"
c_b3Body_GetAngularDamping :: BodyId -> IO Float
foreign import ccall unsafe "b3Body_SetGravityScale"
c_b3Body_SetGravityScale :: BodyId -> Float -> IO ()
foreign import ccall unsafe "b3Body_GetGravityScale"
c_b3Body_GetGravityScale :: BodyId -> IO Float
foreign import ccall unsafe "b3Body_IsAwake"
c_b3Body_IsAwake :: BodyId -> IO CBool
foreign import ccall unsafe "b3Body_SetAwake"
c_b3Body_SetAwake :: BodyId -> CBool -> IO ()
foreign import ccall unsafe "b3Body_EnableSleep"
c_b3Body_EnableSleep :: BodyId -> CBool -> IO ()
foreign import ccall unsafe "b3Body_IsSleepEnabled"
c_b3Body_IsSleepEnabled :: BodyId -> IO CBool
foreign import ccall unsafe "b3Body_SetSleepThreshold"
c_b3Body_SetSleepThreshold :: BodyId -> Float -> IO ()
foreign import ccall unsafe "b3Body_GetSleepThreshold"
c_b3Body_GetSleepThreshold :: BodyId -> IO Float
foreign import ccall unsafe "b3Body_IsEnabled"
c_b3Body_IsEnabled :: BodyId -> IO CBool
foreign import ccall unsafe "b3Body_Disable"
c_b3Body_Disable :: BodyId -> IO ()
foreign import ccall unsafe "b3Body_Enable"
c_b3Body_Enable :: BodyId -> IO ()
foreign import ccall unsafe "hsg_b3Body_SetMotionLocks"
c_b3Body_SetMotionLocks :: BodyId -> Ptr MotionLocks -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetMotionLocks"
c_b3Body_GetMotionLocks :: BodyId -> Ptr MotionLocks -> IO ()
foreign import ccall unsafe "b3Body_SetBullet"
c_b3Body_SetBullet :: BodyId -> CBool -> IO ()
foreign import ccall unsafe "b3Body_IsBullet"
c_b3Body_IsBullet :: BodyId -> IO CBool
foreign import ccall unsafe "b3Body_EnableContactRecycling"
c_b3Body_EnableContactRecycling :: BodyId -> CBool -> IO ()
foreign import ccall unsafe "b3Body_IsContactRecyclingEnabled"
c_b3Body_IsContactRecyclingEnabled :: BodyId -> IO CBool
foreign import ccall unsafe "b3Body_EnableHitEvents"
c_b3Body_EnableHitEvents :: BodyId -> CBool -> IO ()
foreign import ccall unsafe "b3Body_GetWorld"
c_b3Body_GetWorld :: BodyId -> IO WorldId
foreign import ccall unsafe "b3Body_GetShapeCount"
c_b3Body_GetShapeCount :: BodyId -> IO CInt
foreign import ccall unsafe "b3Body_GetShapes"
c_b3Body_GetShapes :: BodyId -> Ptr ShapeId -> CInt -> IO CInt
foreign import ccall unsafe "b3Body_GetJointCount"
c_b3Body_GetJointCount :: BodyId -> IO CInt
foreign import ccall unsafe "b3Body_GetJoints"
c_b3Body_GetJoints :: BodyId -> Ptr JointId -> CInt -> IO CInt
foreign import ccall unsafe "b3Body_GetContactCapacity"
c_b3Body_GetContactCapacity :: BodyId -> IO CInt
foreign import ccall unsafe "b3Body_GetContactData"
c_b3Body_GetContactData :: BodyId -> Ptr ContactData -> CInt -> IO CInt
foreign import ccall unsafe "hsg_b3Body_ComputeAABB"
c_b3Body_ComputeAABB :: BodyId -> Ptr AABB -> IO ()
foreign import ccall unsafe "hsg_b3Body_GetClosestPoint"
c_b3Body_GetClosestPoint :: BodyId -> Ptr Vec3 -> Ptr Vec3 -> IO Float
foreign import ccall unsafe "hsg_b3Body_CastRay"
c_b3Body_CastRay :: BodyId -> Ptr Pos -> Ptr Vec3 -> Ptr QueryFilter -> Float -> Ptr WorldTransform -> Ptr BodyCastResult -> IO ()
foreign import ccall unsafe "hsg_b3Body_CastShape"
c_b3Body_CastShape :: BodyId -> Ptr Pos -> Ptr ShapeProxy -> Ptr Vec3 -> Ptr QueryFilter -> Float -> CBool -> Ptr WorldTransform -> Ptr BodyCastResult -> IO ()
foreign import ccall unsafe "hsg_b3Body_OverlapShape"
c_b3Body_OverlapShape :: BodyId -> Ptr Pos -> Ptr ShapeProxy -> Ptr QueryFilter -> Ptr WorldTransform -> IO CBool
foreign import ccall unsafe "hsg_b3Body_CollideMover"
c_b3Body_CollideMover :: BodyId -> Ptr BodyPlaneResult -> CInt -> Ptr Pos -> Ptr Capsule -> Ptr QueryFilter -> Ptr WorldTransform -> IO CInt
create
:: WorldId
-> BodyDef
-> IO BodyId
create :: WorldId -> BodyDef -> IO BodyId
create WorldId
a0 BodyDef
a1 =
BodyDef -> (Ptr BodyDef -> IO BodyId) -> IO BodyId
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with BodyDef
a1 ((Ptr BodyDef -> IO BodyId) -> IO BodyId)
-> (Ptr BodyDef -> IO BodyId) -> IO BodyId
forall a b. (a -> b) -> a -> b
$ \Ptr BodyDef
p1 ->
WorldId -> Ptr BodyDef -> IO BodyId
c_b3CreateBody WorldId
a0 Ptr BodyDef
p1
destroy
:: BodyId
-> IO ()
destroy :: BodyId -> IO ()
destroy BodyId
a0 =
BodyId -> IO ()
c_b3DestroyBody BodyId
a0
isValid
:: BodyId
-> IO Bool
isValid :: BodyId -> IO Bool
isValid BodyId
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
<$> (BodyId -> IO CBool
c_b3Body_IsValid BodyId
a0)
getType
:: BodyId
-> IO BodyType
getType :: BodyId -> IO BodyType
getType BodyId
a0 =
CInt -> BodyType
forall a b. Coercible a b => a -> b
coerce (CInt -> BodyType) -> IO CInt -> IO BodyType
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (BodyId -> IO CInt
c_b3Body_GetType BodyId
a0)
setType
:: BodyId
-> BodyType
-> IO ()
setType :: BodyId -> BodyType -> IO ()
setType BodyId
a0 BodyType
a1 =
BodyId -> CInt -> IO ()
c_b3Body_SetType BodyId
a0 (BodyType -> CInt
forall a b. Coercible a b => a -> b
coerce BodyType
a1)
setName
:: BodyId
-> CString
-> IO ()
setName :: BodyId -> CString -> IO ()
setName BodyId
a0 CString
a1 =
BodyId -> CString -> IO ()
c_b3Body_SetName BodyId
a0 CString
a1
getName
:: BodyId
-> IO CString
getName :: BodyId -> IO CString
getName BodyId
a0 =
BodyId -> IO CString
c_b3Body_GetName BodyId
a0
setUserData
:: BodyId
-> Ptr ()
-> IO ()
setUserData :: BodyId -> Ptr () -> IO ()
setUserData BodyId
a0 Ptr ()
a1 =
BodyId -> Ptr () -> IO ()
c_b3Body_SetUserData BodyId
a0 Ptr ()
a1
getUserData
:: BodyId
-> IO (Ptr ())
getUserData :: BodyId -> IO (Ptr ())
getUserData BodyId
a0 =
BodyId -> IO (Ptr ())
c_b3Body_GetUserData BodyId
a0
getPosition
:: BodyId
-> IO Pos
getPosition :: BodyId -> IO Pos
getPosition BodyId
a0 =
(Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
pOut -> BodyId -> Ptr Pos -> IO ()
c_b3Body_GetPosition BodyId
a0 Ptr Pos
pOut IO () -> IO Pos -> IO Pos
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Pos -> IO Pos
forall a. Storable a => Ptr a -> IO a
peek Ptr Pos
pOut
getPositionInto
:: BodyId
-> Ptr Pos
-> IO ()
getPositionInto :: BodyId -> Ptr Pos -> IO ()
getPositionInto BodyId
a0 Ptr Pos
out =
BodyId -> Ptr Pos -> IO ()
c_b3Body_GetPosition BodyId
a0 Ptr Pos
out
getRotation
:: BodyId
-> IO Quat
getRotation :: BodyId -> IO Quat
getRotation BodyId
a0 =
(Ptr Quat -> IO Quat) -> IO Quat
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Quat -> IO Quat) -> IO Quat)
-> (Ptr Quat -> IO Quat) -> IO Quat
forall a b. (a -> b) -> a -> b
$ \Ptr Quat
pOut -> BodyId -> Ptr Quat -> IO ()
c_b3Body_GetRotation BodyId
a0 Ptr Quat
pOut IO () -> IO Quat -> IO Quat
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Quat -> IO Quat
forall a. Storable a => Ptr a -> IO a
peek Ptr Quat
pOut
getRotationInto
:: BodyId
-> Ptr Quat
-> IO ()
getRotationInto :: BodyId -> Ptr Quat -> IO ()
getRotationInto BodyId
a0 Ptr Quat
out =
BodyId -> Ptr Quat -> IO ()
c_b3Body_GetRotation BodyId
a0 Ptr Quat
out
getTransform
:: BodyId
-> IO WorldTransform
getTransform :: BodyId -> IO WorldTransform
getTransform BodyId
a0 =
(Ptr WorldTransform -> IO WorldTransform) -> IO WorldTransform
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr WorldTransform -> IO WorldTransform) -> IO WorldTransform)
-> (Ptr WorldTransform -> IO WorldTransform) -> IO WorldTransform
forall a b. (a -> b) -> a -> b
$ \Ptr WorldTransform
pOut -> BodyId -> Ptr WorldTransform -> IO ()
c_b3Body_GetTransform BodyId
a0 Ptr WorldTransform
pOut IO () -> IO WorldTransform -> IO WorldTransform
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr WorldTransform -> IO WorldTransform
forall a. Storable a => Ptr a -> IO a
peek Ptr WorldTransform
pOut
getTransformInto
:: BodyId
-> Ptr WorldTransform
-> IO ()
getTransformInto :: BodyId -> Ptr WorldTransform -> IO ()
getTransformInto BodyId
a0 Ptr WorldTransform
out =
BodyId -> Ptr WorldTransform -> IO ()
c_b3Body_GetTransform BodyId
a0 Ptr WorldTransform
out
setTransform
:: BodyId
-> Pos
-> Quat
-> IO ()
setTransform :: BodyId -> Pos -> Quat -> IO ()
setTransform BodyId
a0 Pos
a1 Quat
a2 =
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
Quat -> (Ptr Quat -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Quat
a2 ((Ptr Quat -> IO ()) -> IO ()) -> (Ptr Quat -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Quat
p2 ->
BodyId -> Ptr Pos -> Ptr Quat -> IO ()
c_b3Body_SetTransform BodyId
a0 Ptr Pos
p1 Ptr Quat
p2
getLocalPoint
:: BodyId
-> Pos
-> IO Vec3
getLocalPoint :: BodyId -> Pos -> IO Pos
getLocalPoint BodyId
a0 Pos
a1 =
Pos -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
(Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
pOut -> BodyId -> Ptr Pos -> Ptr Pos -> IO ()
c_b3Body_GetLocalPoint BodyId
a0 Ptr Pos
p1 Ptr Pos
pOut IO () -> IO Pos -> IO Pos
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Pos -> IO Pos
forall a. Storable a => Ptr a -> IO a
peek Ptr Pos
pOut
getWorldPoint
:: BodyId
-> Vec3
-> IO Pos
getWorldPoint :: BodyId -> Pos -> IO Pos
getWorldPoint BodyId
a0 Pos
a1 =
Pos -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
(Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
pOut -> BodyId -> Ptr Pos -> Ptr Pos -> IO ()
c_b3Body_GetWorldPoint BodyId
a0 Ptr Pos
p1 Ptr Pos
pOut IO () -> IO Pos -> IO Pos
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Pos -> IO Pos
forall a. Storable a => Ptr a -> IO a
peek Ptr Pos
pOut
getLocalVector
:: BodyId
-> Vec3
-> IO Vec3
getLocalVector :: BodyId -> Pos -> IO Pos
getLocalVector BodyId
a0 Pos
a1 =
Pos -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
(Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
pOut -> BodyId -> Ptr Pos -> Ptr Pos -> IO ()
c_b3Body_GetLocalVector BodyId
a0 Ptr Pos
p1 Ptr Pos
pOut IO () -> IO Pos -> IO Pos
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Pos -> IO Pos
forall a. Storable a => Ptr a -> IO a
peek Ptr Pos
pOut
getWorldVector
:: BodyId
-> Vec3
-> IO Vec3
getWorldVector :: BodyId -> Pos -> IO Pos
getWorldVector BodyId
a0 Pos
a1 =
Pos -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
(Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
pOut -> BodyId -> Ptr Pos -> Ptr Pos -> IO ()
c_b3Body_GetWorldVector BodyId
a0 Ptr Pos
p1 Ptr Pos
pOut IO () -> IO Pos -> IO Pos
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Pos -> IO Pos
forall a. Storable a => Ptr a -> IO a
peek Ptr Pos
pOut
getLinearVelocity
:: BodyId
-> IO Vec3
getLinearVelocity :: BodyId -> IO Pos
getLinearVelocity BodyId
a0 =
(Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
pOut -> BodyId -> Ptr Pos -> IO ()
c_b3Body_GetLinearVelocity BodyId
a0 Ptr Pos
pOut IO () -> IO Pos -> IO Pos
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Pos -> IO Pos
forall a. Storable a => Ptr a -> IO a
peek Ptr Pos
pOut
getLinearVelocityInto
:: BodyId
-> Ptr Vec3
-> IO ()
getLinearVelocityInto :: BodyId -> Ptr Pos -> IO ()
getLinearVelocityInto BodyId
a0 Ptr Pos
out =
BodyId -> Ptr Pos -> IO ()
c_b3Body_GetLinearVelocity BodyId
a0 Ptr Pos
out
getAngularVelocity
:: BodyId
-> IO Vec3
getAngularVelocity :: BodyId -> IO Pos
getAngularVelocity BodyId
a0 =
(Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
pOut -> BodyId -> Ptr Pos -> IO ()
c_b3Body_GetAngularVelocity BodyId
a0 Ptr Pos
pOut IO () -> IO Pos -> IO Pos
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Pos -> IO Pos
forall a. Storable a => Ptr a -> IO a
peek Ptr Pos
pOut
getAngularVelocityInto
:: BodyId
-> Ptr Vec3
-> IO ()
getAngularVelocityInto :: BodyId -> Ptr Pos -> IO ()
getAngularVelocityInto BodyId
a0 Ptr Pos
out =
BodyId -> Ptr Pos -> IO ()
c_b3Body_GetAngularVelocity BodyId
a0 Ptr Pos
out
setLinearVelocity
:: BodyId
-> Vec3
-> IO ()
setLinearVelocity :: BodyId -> Pos -> IO ()
setLinearVelocity BodyId
a0 Pos
a1 =
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
BodyId -> Ptr Pos -> IO ()
c_b3Body_SetLinearVelocity BodyId
a0 Ptr Pos
p1
setAngularVelocity
:: BodyId
-> Vec3
-> IO ()
setAngularVelocity :: BodyId -> Pos -> IO ()
setAngularVelocity BodyId
a0 Pos
a1 =
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
BodyId -> Ptr Pos -> IO ()
c_b3Body_SetAngularVelocity BodyId
a0 Ptr Pos
p1
setTargetTransform
:: BodyId
-> WorldTransform
-> Float
-> Bool
-> IO ()
setTargetTransform :: BodyId -> WorldTransform -> Float -> Bool -> IO ()
setTargetTransform BodyId
a0 WorldTransform
a1 Float
a2 Bool
a3 =
WorldTransform -> (Ptr WorldTransform -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with WorldTransform
a1 ((Ptr WorldTransform -> IO ()) -> IO ())
-> (Ptr WorldTransform -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr WorldTransform
p1 ->
BodyId -> Ptr WorldTransform -> Float -> CBool -> IO ()
c_b3Body_SetTargetTransform BodyId
a0 Ptr WorldTransform
p1 Float
a2 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a3)
getLocalPointVelocity
:: BodyId
-> Vec3
-> IO Vec3
getLocalPointVelocity :: BodyId -> Pos -> IO Pos
getLocalPointVelocity BodyId
a0 Pos
a1 =
Pos -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
(Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
pOut -> BodyId -> Ptr Pos -> Ptr Pos -> IO ()
c_b3Body_GetLocalPointVelocity BodyId
a0 Ptr Pos
p1 Ptr Pos
pOut IO () -> IO Pos -> IO Pos
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Pos -> IO Pos
forall a. Storable a => Ptr a -> IO a
peek Ptr Pos
pOut
getWorldPointVelocity
:: BodyId
-> Pos
-> IO Vec3
getWorldPointVelocity :: BodyId -> Pos -> IO Pos
getWorldPointVelocity BodyId
a0 Pos
a1 =
Pos -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
(Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
pOut -> BodyId -> Ptr Pos -> Ptr Pos -> IO ()
c_b3Body_GetWorldPointVelocity BodyId
a0 Ptr Pos
p1 Ptr Pos
pOut IO () -> IO Pos -> IO Pos
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Pos -> IO Pos
forall a. Storable a => Ptr a -> IO a
peek Ptr Pos
pOut
applyForce
:: BodyId
-> Vec3
-> Pos
-> Bool
-> IO ()
applyForce :: BodyId -> Pos -> Pos -> Bool -> IO ()
applyForce BodyId
a0 Pos
a1 Pos
a2 Bool
a3 =
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a2 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p2 ->
BodyId -> Ptr Pos -> Ptr Pos -> CBool -> IO ()
c_b3Body_ApplyForce BodyId
a0 Ptr Pos
p1 Ptr Pos
p2 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a3)
applyForceToCenter
:: BodyId
-> Vec3
-> Bool
-> IO ()
applyForceToCenter :: BodyId -> Pos -> Bool -> IO ()
applyForceToCenter BodyId
a0 Pos
a1 Bool
a2 =
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
BodyId -> Ptr Pos -> CBool -> IO ()
c_b3Body_ApplyForceToCenter BodyId
a0 Ptr Pos
p1 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a2)
applyTorque
:: BodyId
-> Vec3
-> Bool
-> IO ()
applyTorque :: BodyId -> Pos -> Bool -> IO ()
applyTorque BodyId
a0 Pos
a1 Bool
a2 =
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
BodyId -> Ptr Pos -> CBool -> IO ()
c_b3Body_ApplyTorque BodyId
a0 Ptr Pos
p1 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a2)
applyLinearImpulse
:: BodyId
-> Vec3
-> Pos
-> Bool
-> IO ()
applyLinearImpulse :: BodyId -> Pos -> Pos -> Bool -> IO ()
applyLinearImpulse BodyId
a0 Pos
a1 Pos
a2 Bool
a3 =
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a2 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p2 ->
BodyId -> Ptr Pos -> Ptr Pos -> CBool -> IO ()
c_b3Body_ApplyLinearImpulse BodyId
a0 Ptr Pos
p1 Ptr Pos
p2 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a3)
applyLinearImpulseToCenter
:: BodyId
-> Vec3
-> Bool
-> IO ()
applyLinearImpulseToCenter :: BodyId -> Pos -> Bool -> IO ()
applyLinearImpulseToCenter BodyId
a0 Pos
a1 Bool
a2 =
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
BodyId -> Ptr Pos -> CBool -> IO ()
c_b3Body_ApplyLinearImpulseToCenter BodyId
a0 Ptr Pos
p1 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a2)
applyAngularImpulse
:: BodyId
-> Vec3
-> Bool
-> IO ()
applyAngularImpulse :: BodyId -> Pos -> Bool -> IO ()
applyAngularImpulse BodyId
a0 Pos
a1 Bool
a2 =
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
BodyId -> Ptr Pos -> CBool -> IO ()
c_b3Body_ApplyAngularImpulse BodyId
a0 Ptr Pos
p1 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a2)
getMass
:: BodyId
-> IO Float
getMass :: BodyId -> IO Float
getMass BodyId
a0 =
BodyId -> IO Float
c_b3Body_GetMass BodyId
a0
getLocalRotationalInertia
:: BodyId
-> IO Matrix3
getLocalRotationalInertia :: BodyId -> IO Matrix3
getLocalRotationalInertia BodyId
a0 =
(Ptr Matrix3 -> IO Matrix3) -> IO Matrix3
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Matrix3 -> IO Matrix3) -> IO Matrix3)
-> (Ptr Matrix3 -> IO Matrix3) -> IO Matrix3
forall a b. (a -> b) -> a -> b
$ \Ptr Matrix3
pOut -> BodyId -> Ptr Matrix3 -> IO ()
c_b3Body_GetLocalRotationalInertia BodyId
a0 Ptr Matrix3
pOut IO () -> IO Matrix3 -> IO Matrix3
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Matrix3 -> IO Matrix3
forall a. Storable a => Ptr a -> IO a
peek Ptr Matrix3
pOut
getLocalRotationalInertiaInto
:: BodyId
-> Ptr Matrix3
-> IO ()
getLocalRotationalInertiaInto :: BodyId -> Ptr Matrix3 -> IO ()
getLocalRotationalInertiaInto BodyId
a0 Ptr Matrix3
out =
BodyId -> Ptr Matrix3 -> IO ()
c_b3Body_GetLocalRotationalInertia BodyId
a0 Ptr Matrix3
out
getInverseMass
:: BodyId
-> IO Float
getInverseMass :: BodyId -> IO Float
getInverseMass BodyId
a0 =
BodyId -> IO Float
c_b3Body_GetInverseMass BodyId
a0
getWorldInverseRotationalInertia
:: BodyId
-> IO Matrix3
getWorldInverseRotationalInertia :: BodyId -> IO Matrix3
getWorldInverseRotationalInertia BodyId
a0 =
(Ptr Matrix3 -> IO Matrix3) -> IO Matrix3
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Matrix3 -> IO Matrix3) -> IO Matrix3)
-> (Ptr Matrix3 -> IO Matrix3) -> IO Matrix3
forall a b. (a -> b) -> a -> b
$ \Ptr Matrix3
pOut -> BodyId -> Ptr Matrix3 -> IO ()
c_b3Body_GetWorldInverseRotationalInertia BodyId
a0 Ptr Matrix3
pOut IO () -> IO Matrix3 -> IO Matrix3
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Matrix3 -> IO Matrix3
forall a. Storable a => Ptr a -> IO a
peek Ptr Matrix3
pOut
getWorldInverseRotationalInertiaInto
:: BodyId
-> Ptr Matrix3
-> IO ()
getWorldInverseRotationalInertiaInto :: BodyId -> Ptr Matrix3 -> IO ()
getWorldInverseRotationalInertiaInto BodyId
a0 Ptr Matrix3
out =
BodyId -> Ptr Matrix3 -> IO ()
c_b3Body_GetWorldInverseRotationalInertia BodyId
a0 Ptr Matrix3
out
getLocalCenterOfMass
:: BodyId
-> IO Vec3
getLocalCenterOfMass :: BodyId -> IO Pos
getLocalCenterOfMass BodyId
a0 =
(Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
pOut -> BodyId -> Ptr Pos -> IO ()
c_b3Body_GetLocalCenterOfMass BodyId
a0 Ptr Pos
pOut IO () -> IO Pos -> IO Pos
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Pos -> IO Pos
forall a. Storable a => Ptr a -> IO a
peek Ptr Pos
pOut
getLocalCenterOfMassInto
:: BodyId
-> Ptr Vec3
-> IO ()
getLocalCenterOfMassInto :: BodyId -> Ptr Pos -> IO ()
getLocalCenterOfMassInto BodyId
a0 Ptr Pos
out =
BodyId -> Ptr Pos -> IO ()
c_b3Body_GetLocalCenterOfMass BodyId
a0 Ptr Pos
out
getWorldCenterOfMass
:: BodyId
-> IO Pos
getWorldCenterOfMass :: BodyId -> IO Pos
getWorldCenterOfMass BodyId
a0 =
(Ptr Pos -> IO Pos) -> IO Pos
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Pos -> IO Pos) -> IO Pos) -> (Ptr Pos -> IO Pos) -> IO Pos
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
pOut -> BodyId -> Ptr Pos -> IO ()
c_b3Body_GetWorldCenterOfMass BodyId
a0 Ptr Pos
pOut IO () -> IO Pos -> IO Pos
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr Pos -> IO Pos
forall a. Storable a => Ptr a -> IO a
peek Ptr Pos
pOut
getWorldCenterOfMassInto
:: BodyId
-> Ptr Pos
-> IO ()
getWorldCenterOfMassInto :: BodyId -> Ptr Pos -> IO ()
getWorldCenterOfMassInto BodyId
a0 Ptr Pos
out =
BodyId -> Ptr Pos -> IO ()
c_b3Body_GetWorldCenterOfMass BodyId
a0 Ptr Pos
out
setMassData
:: BodyId
-> MassData
-> IO ()
setMassData :: BodyId -> MassData -> IO ()
setMassData BodyId
a0 MassData
a1 =
MassData -> (Ptr MassData -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with MassData
a1 ((Ptr MassData -> IO ()) -> IO ())
-> (Ptr MassData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MassData
p1 ->
BodyId -> Ptr MassData -> IO ()
c_b3Body_SetMassData BodyId
a0 Ptr MassData
p1
getMassData
:: BodyId
-> IO MassData
getMassData :: BodyId -> IO MassData
getMassData BodyId
a0 =
(Ptr MassData -> IO MassData) -> IO MassData
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr MassData -> IO MassData) -> IO MassData)
-> (Ptr MassData -> IO MassData) -> IO MassData
forall a b. (a -> b) -> a -> b
$ \Ptr MassData
pOut -> BodyId -> Ptr MassData -> IO ()
c_b3Body_GetMassData BodyId
a0 Ptr MassData
pOut IO () -> IO MassData -> IO MassData
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr MassData -> IO MassData
forall a. Storable a => Ptr a -> IO a
peek Ptr MassData
pOut
getMassDataInto
:: BodyId
-> Ptr MassData
-> IO ()
getMassDataInto :: BodyId -> Ptr MassData -> IO ()
getMassDataInto BodyId
a0 Ptr MassData
out =
BodyId -> Ptr MassData -> IO ()
c_b3Body_GetMassData BodyId
a0 Ptr MassData
out
applyMassFromShapes
:: BodyId
-> IO ()
applyMassFromShapes :: BodyId -> IO ()
applyMassFromShapes BodyId
a0 =
BodyId -> IO ()
c_b3Body_ApplyMassFromShapes BodyId
a0
setLinearDamping
:: BodyId
-> Float
-> IO ()
setLinearDamping :: BodyId -> Float -> IO ()
setLinearDamping BodyId
a0 Float
a1 =
BodyId -> Float -> IO ()
c_b3Body_SetLinearDamping BodyId
a0 Float
a1
getLinearDamping
:: BodyId
-> IO Float
getLinearDamping :: BodyId -> IO Float
getLinearDamping BodyId
a0 =
BodyId -> IO Float
c_b3Body_GetLinearDamping BodyId
a0
setAngularDamping
:: BodyId
-> Float
-> IO ()
setAngularDamping :: BodyId -> Float -> IO ()
setAngularDamping BodyId
a0 Float
a1 =
BodyId -> Float -> IO ()
c_b3Body_SetAngularDamping BodyId
a0 Float
a1
getAngularDamping
:: BodyId
-> IO Float
getAngularDamping :: BodyId -> IO Float
getAngularDamping BodyId
a0 =
BodyId -> IO Float
c_b3Body_GetAngularDamping BodyId
a0
setGravityScale
:: BodyId
-> Float
-> IO ()
setGravityScale :: BodyId -> Float -> IO ()
setGravityScale BodyId
a0 Float
a1 =
BodyId -> Float -> IO ()
c_b3Body_SetGravityScale BodyId
a0 Float
a1
getGravityScale
:: BodyId
-> IO Float
getGravityScale :: BodyId -> IO Float
getGravityScale BodyId
a0 =
BodyId -> IO Float
c_b3Body_GetGravityScale BodyId
a0
isAwake
:: BodyId
-> IO Bool
isAwake :: BodyId -> IO Bool
isAwake BodyId
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
<$> (BodyId -> IO CBool
c_b3Body_IsAwake BodyId
a0)
setAwake
:: BodyId
-> Bool
-> IO ()
setAwake :: BodyId -> Bool -> IO ()
setAwake BodyId
a0 Bool
a1 =
BodyId -> CBool -> IO ()
c_b3Body_SetAwake BodyId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
enableSleep
:: BodyId
-> Bool
-> IO ()
enableSleep :: BodyId -> Bool -> IO ()
enableSleep BodyId
a0 Bool
a1 =
BodyId -> CBool -> IO ()
c_b3Body_EnableSleep BodyId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
isSleepEnabled
:: BodyId
-> IO Bool
isSleepEnabled :: BodyId -> IO Bool
isSleepEnabled BodyId
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
<$> (BodyId -> IO CBool
c_b3Body_IsSleepEnabled BodyId
a0)
setSleepThreshold
:: BodyId
-> Float
-> IO ()
setSleepThreshold :: BodyId -> Float -> IO ()
setSleepThreshold BodyId
a0 Float
a1 =
BodyId -> Float -> IO ()
c_b3Body_SetSleepThreshold BodyId
a0 Float
a1
getSleepThreshold
:: BodyId
-> IO Float
getSleepThreshold :: BodyId -> IO Float
getSleepThreshold BodyId
a0 =
BodyId -> IO Float
c_b3Body_GetSleepThreshold BodyId
a0
isEnabled
:: BodyId
-> IO Bool
isEnabled :: BodyId -> IO Bool
isEnabled BodyId
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
<$> (BodyId -> IO CBool
c_b3Body_IsEnabled BodyId
a0)
disable
:: BodyId
-> IO ()
disable :: BodyId -> IO ()
disable BodyId
a0 =
BodyId -> IO ()
c_b3Body_Disable BodyId
a0
enable
:: BodyId
-> IO ()
enable :: BodyId -> IO ()
enable BodyId
a0 =
BodyId -> IO ()
c_b3Body_Enable BodyId
a0
setMotionLocks
:: BodyId
-> MotionLocks
-> IO ()
setMotionLocks :: BodyId -> MotionLocks -> IO ()
setMotionLocks BodyId
a0 MotionLocks
a1 =
MotionLocks -> (Ptr MotionLocks -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with MotionLocks
a1 ((Ptr MotionLocks -> IO ()) -> IO ())
-> (Ptr MotionLocks -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr MotionLocks
p1 ->
BodyId -> Ptr MotionLocks -> IO ()
c_b3Body_SetMotionLocks BodyId
a0 Ptr MotionLocks
p1
getMotionLocks
:: BodyId
-> IO MotionLocks
getMotionLocks :: BodyId -> IO MotionLocks
getMotionLocks BodyId
a0 =
(Ptr MotionLocks -> IO MotionLocks) -> IO MotionLocks
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr MotionLocks -> IO MotionLocks) -> IO MotionLocks)
-> (Ptr MotionLocks -> IO MotionLocks) -> IO MotionLocks
forall a b. (a -> b) -> a -> b
$ \Ptr MotionLocks
pOut -> BodyId -> Ptr MotionLocks -> IO ()
c_b3Body_GetMotionLocks BodyId
a0 Ptr MotionLocks
pOut IO () -> IO MotionLocks -> IO MotionLocks
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr MotionLocks -> IO MotionLocks
forall a. Storable a => Ptr a -> IO a
peek Ptr MotionLocks
pOut
getMotionLocksInto
:: BodyId
-> Ptr MotionLocks
-> IO ()
getMotionLocksInto :: BodyId -> Ptr MotionLocks -> IO ()
getMotionLocksInto BodyId
a0 Ptr MotionLocks
out =
BodyId -> Ptr MotionLocks -> IO ()
c_b3Body_GetMotionLocks BodyId
a0 Ptr MotionLocks
out
setBullet
:: BodyId
-> Bool
-> IO ()
setBullet :: BodyId -> Bool -> IO ()
setBullet BodyId
a0 Bool
a1 =
BodyId -> CBool -> IO ()
c_b3Body_SetBullet BodyId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
isBullet
:: BodyId
-> IO Bool
isBullet :: BodyId -> IO Bool
isBullet BodyId
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
<$> (BodyId -> IO CBool
c_b3Body_IsBullet BodyId
a0)
enableContactRecycling
:: BodyId
-> Bool
-> IO ()
enableContactRecycling :: BodyId -> Bool -> IO ()
enableContactRecycling BodyId
a0 Bool
a1 =
BodyId -> CBool -> IO ()
c_b3Body_EnableContactRecycling BodyId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
isContactRecyclingEnabled
:: BodyId
-> IO Bool
isContactRecyclingEnabled :: BodyId -> IO Bool
isContactRecyclingEnabled BodyId
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
<$> (BodyId -> IO CBool
c_b3Body_IsContactRecyclingEnabled BodyId
a0)
enableHitEvents
:: BodyId
-> Bool
-> IO ()
enableHitEvents :: BodyId -> Bool -> IO ()
enableHitEvents BodyId
a0 Bool
a1 =
BodyId -> CBool -> IO ()
c_b3Body_EnableHitEvents BodyId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
getWorld
:: BodyId
-> IO WorldId
getWorld :: BodyId -> IO WorldId
getWorld BodyId
a0 =
BodyId -> IO WorldId
c_b3Body_GetWorld BodyId
a0
getShapeCount
:: BodyId
-> IO Int
getShapeCount :: BodyId -> IO Int
getShapeCount BodyId
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
<$> (BodyId -> IO CInt
c_b3Body_GetShapeCount BodyId
a0)
getShapes
:: BodyId
-> Ptr ShapeId
-> Int
-> IO Int
getShapes :: BodyId -> Ptr ShapeId -> Int -> IO Int
getShapes BodyId
a0 Ptr ShapeId
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
<$> (BodyId -> Ptr ShapeId -> CInt -> IO CInt
c_b3Body_GetShapes BodyId
a0 Ptr ShapeId
a1 (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2))
getJointCount
:: BodyId
-> IO Int
getJointCount :: BodyId -> IO Int
getJointCount BodyId
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
<$> (BodyId -> IO CInt
c_b3Body_GetJointCount BodyId
a0)
getJoints
:: BodyId
-> Ptr JointId
-> Int
-> IO Int
getJoints :: BodyId -> Ptr JointId -> Int -> IO Int
getJoints BodyId
a0 Ptr JointId
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
<$> (BodyId -> Ptr JointId -> CInt -> IO CInt
c_b3Body_GetJoints BodyId
a0 Ptr JointId
a1 (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2))
getContactCapacity
:: BodyId
-> IO Int
getContactCapacity :: BodyId -> IO Int
getContactCapacity BodyId
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
<$> (BodyId -> IO CInt
c_b3Body_GetContactCapacity BodyId
a0)
getContactData
:: BodyId
-> Ptr ContactData
-> Int
-> IO Int
getContactData :: BodyId -> Ptr ContactData -> Int -> IO Int
getContactData BodyId
a0 Ptr ContactData
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
<$> (BodyId -> Ptr ContactData -> CInt -> IO CInt
c_b3Body_GetContactData BodyId
a0 Ptr ContactData
a1 (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2))
computeAABB
:: BodyId
-> IO AABB
computeAABB :: BodyId -> IO AABB
computeAABB BodyId
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 -> BodyId -> Ptr AABB -> IO ()
c_b3Body_ComputeAABB BodyId
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
computeAABBInto
:: BodyId
-> Ptr AABB
-> IO ()
computeAABBInto :: BodyId -> Ptr AABB -> IO ()
computeAABBInto BodyId
a0 Ptr AABB
out =
BodyId -> Ptr AABB -> IO ()
c_b3Body_ComputeAABB BodyId
a0 Ptr AABB
out
getClosestPoint
:: BodyId
-> Ptr Vec3
-> Vec3
-> IO Float
getClosestPoint :: BodyId -> Ptr Pos -> Pos -> IO Float
getClosestPoint BodyId
a0 Ptr Pos
a1 Pos
a2 =
Pos -> (Ptr Pos -> IO Float) -> IO Float
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a2 ((Ptr Pos -> IO Float) -> IO Float)
-> (Ptr Pos -> IO Float) -> IO Float
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p2 ->
BodyId -> Ptr Pos -> Ptr Pos -> IO Float
c_b3Body_GetClosestPoint BodyId
a0 Ptr Pos
a1 Ptr Pos
p2
castRay
:: BodyId
-> Pos
-> Vec3
-> QueryFilter
-> Float
-> WorldTransform
-> Ptr BodyCastResult
-> IO ()
castRay :: BodyId
-> Pos
-> Pos
-> QueryFilter
-> Float
-> WorldTransform
-> Ptr BodyCastResult
-> IO ()
castRay BodyId
a0 Pos
a1 Pos
a2 QueryFilter
a3 Float
a4 WorldTransform
a5 Ptr BodyCastResult
out =
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a2 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
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 ->
WorldTransform -> (Ptr WorldTransform -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with WorldTransform
a5 ((Ptr WorldTransform -> IO ()) -> IO ())
-> (Ptr WorldTransform -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr WorldTransform
p5 ->
BodyId
-> Ptr Pos
-> Ptr Pos
-> Ptr QueryFilter
-> Float
-> Ptr WorldTransform
-> Ptr BodyCastResult
-> IO ()
c_b3Body_CastRay BodyId
a0 Ptr Pos
p1 Ptr Pos
p2 Ptr QueryFilter
p3 Float
a4 Ptr WorldTransform
p5 Ptr BodyCastResult
out
castShape
:: BodyId
-> Pos
-> Ptr ShapeProxy
-> Vec3
-> QueryFilter
-> Float
-> Bool
-> WorldTransform
-> Ptr BodyCastResult
-> IO ()
castShape :: BodyId
-> Pos
-> Ptr ShapeProxy
-> Pos
-> QueryFilter
-> Float
-> Bool
-> WorldTransform
-> Ptr BodyCastResult
-> IO ()
castShape BodyId
a0 Pos
a1 Ptr ShapeProxy
a2 Pos
a3 QueryFilter
a4 Float
a5 Bool
a6 WorldTransform
a7 Ptr BodyCastResult
out =
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
Pos -> (Ptr Pos -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a3 ((Ptr Pos -> IO ()) -> IO ()) -> (Ptr Pos -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p3 ->
QueryFilter -> (Ptr QueryFilter -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with QueryFilter
a4 ((Ptr QueryFilter -> IO ()) -> IO ())
-> (Ptr QueryFilter -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr QueryFilter
p4 ->
WorldTransform -> (Ptr WorldTransform -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with WorldTransform
a7 ((Ptr WorldTransform -> IO ()) -> IO ())
-> (Ptr WorldTransform -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr WorldTransform
p7 ->
BodyId
-> Ptr Pos
-> Ptr ShapeProxy
-> Ptr Pos
-> Ptr QueryFilter
-> Float
-> CBool
-> Ptr WorldTransform
-> Ptr BodyCastResult
-> IO ()
c_b3Body_CastShape BodyId
a0 Ptr Pos
p1 Ptr ShapeProxy
a2 Ptr Pos
p3 Ptr QueryFilter
p4 Float
a5 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a6) Ptr WorldTransform
p7 Ptr BodyCastResult
out
overlapShape
:: BodyId
-> Pos
-> Ptr ShapeProxy
-> QueryFilter
-> WorldTransform
-> IO Bool
overlapShape :: BodyId
-> Pos
-> Ptr ShapeProxy
-> QueryFilter
-> WorldTransform
-> IO Bool
overlapShape BodyId
a0 Pos
a1 Ptr ShapeProxy
a2 QueryFilter
a3 WorldTransform
a4 =
Pos -> (Ptr Pos -> IO Bool) -> IO Bool
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a1 ((Ptr Pos -> IO Bool) -> IO Bool)
-> (Ptr Pos -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p1 ->
QueryFilter -> (Ptr QueryFilter -> IO Bool) -> IO Bool
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with QueryFilter
a3 ((Ptr QueryFilter -> IO Bool) -> IO Bool)
-> (Ptr QueryFilter -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \Ptr QueryFilter
p3 ->
WorldTransform -> (Ptr WorldTransform -> IO Bool) -> IO Bool
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with WorldTransform
a4 ((Ptr WorldTransform -> IO Bool) -> IO Bool)
-> (Ptr WorldTransform -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \Ptr WorldTransform
p4 ->
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
<$> (BodyId
-> Ptr Pos
-> Ptr ShapeProxy
-> Ptr QueryFilter
-> Ptr WorldTransform
-> IO CBool
c_b3Body_OverlapShape BodyId
a0 Ptr Pos
p1 Ptr ShapeProxy
a2 Ptr QueryFilter
p3 Ptr WorldTransform
p4)
collideMover
:: BodyId
-> Ptr BodyPlaneResult
-> Int
-> Pos
-> Capsule
-> QueryFilter
-> WorldTransform
-> IO Int
collideMover :: BodyId
-> Ptr BodyPlaneResult
-> Int
-> Pos
-> Capsule
-> QueryFilter
-> WorldTransform
-> IO Int
collideMover BodyId
a0 Ptr BodyPlaneResult
a1 Int
a2 Pos
a3 Capsule
a4 QueryFilter
a5 WorldTransform
a6 =
Pos -> (Ptr Pos -> IO Int) -> IO Int
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Pos
a3 ((Ptr Pos -> IO Int) -> IO Int) -> (Ptr Pos -> IO Int) -> IO Int
forall a b. (a -> b) -> a -> b
$ \Ptr Pos
p3 ->
Capsule -> (Ptr Capsule -> IO Int) -> IO Int
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Capsule
a4 ((Ptr Capsule -> IO Int) -> IO Int)
-> (Ptr Capsule -> IO Int) -> IO Int
forall a b. (a -> b) -> a -> b
$ \Ptr Capsule
p4 ->
QueryFilter -> (Ptr QueryFilter -> IO Int) -> IO Int
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with QueryFilter
a5 ((Ptr QueryFilter -> IO Int) -> IO Int)
-> (Ptr QueryFilter -> IO Int) -> IO Int
forall a b. (a -> b) -> a -> b
$ \Ptr QueryFilter
p5 ->
WorldTransform -> (Ptr WorldTransform -> IO Int) -> IO Int
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with WorldTransform
a6 ((Ptr WorldTransform -> IO Int) -> IO Int)
-> (Ptr WorldTransform -> IO Int) -> IO Int
forall a b. (a -> b) -> a -> b
$ \Ptr WorldTransform
p6 ->
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
<$> (BodyId
-> Ptr BodyPlaneResult
-> CInt
-> Ptr Pos
-> Ptr Capsule
-> Ptr QueryFilter
-> Ptr WorldTransform
-> IO CInt
c_b3Body_CollideMover BodyId
a0 Ptr BodyPlaneResult
a1 (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2) Ptr Pos
p3 Ptr Capsule
p4 Ptr QueryFilter
p5 Ptr WorldTransform
p6)