module Box3D.WheelJoint
( create
, enableSuspension
, isSuspensionEnabled
, setSuspensionHertz
, getSuspensionHertz
, setSuspensionDampingRatio
, getSuspensionDampingRatio
, enableSuspensionLimit
, isSuspensionLimitEnabled
, getLowerSuspensionLimit
, getUpperSuspensionLimit
, setSuspensionLimits
, enableSpinMotor
, isSpinMotorEnabled
, setSpinMotorSpeed
, getSpinMotorSpeed
, setMaxSpinTorque
, getMaxSpinTorque
, getSpinSpeed
, getSpinTorque
, enableSteering
, isSteeringEnabled
, setSteeringHertz
, getSteeringHertz
, setSteeringDampingRatio
, getSteeringDampingRatio
, setMaxSteeringTorque
, getMaxSteeringTorque
, enableSteeringLimit
, isSteeringLimitEnabled
, getLowerSteeringLimit
, getUpperSteeringLimit
, setSteeringLimits
, setTargetSteeringAngle
, getTargetSteeringAngle
, getSteeringAngle
, getSteeringTorque
)
where
import Foreign
import Foreign.C.Types (CBool(..))
import Box3D.Id (JointId(..), WorldId(..))
import Box3D.Types (WheelJointDef)
foreign import ccall unsafe "b3CreateWheelJoint"
c_b3CreateWheelJoint :: WorldId -> Ptr WheelJointDef -> IO JointId
foreign import ccall unsafe "b3WheelJoint_EnableSuspension"
c_b3WheelJoint_EnableSuspension :: JointId -> CBool -> IO ()
foreign import ccall unsafe "b3WheelJoint_IsSuspensionEnabled"
c_b3WheelJoint_IsSuspensionEnabled :: JointId -> IO CBool
foreign import ccall unsafe "b3WheelJoint_SetSuspensionHertz"
c_b3WheelJoint_SetSuspensionHertz :: JointId -> Float -> IO ()
foreign import ccall unsafe "b3WheelJoint_GetSuspensionHertz"
c_b3WheelJoint_GetSuspensionHertz :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_SetSuspensionDampingRatio"
c_b3WheelJoint_SetSuspensionDampingRatio :: JointId -> Float -> IO ()
foreign import ccall unsafe "b3WheelJoint_GetSuspensionDampingRatio"
c_b3WheelJoint_GetSuspensionDampingRatio :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_EnableSuspensionLimit"
c_b3WheelJoint_EnableSuspensionLimit :: JointId -> CBool -> IO ()
foreign import ccall unsafe "b3WheelJoint_IsSuspensionLimitEnabled"
c_b3WheelJoint_IsSuspensionLimitEnabled :: JointId -> IO CBool
foreign import ccall unsafe "b3WheelJoint_GetLowerSuspensionLimit"
c_b3WheelJoint_GetLowerSuspensionLimit :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_GetUpperSuspensionLimit"
c_b3WheelJoint_GetUpperSuspensionLimit :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_SetSuspensionLimits"
c_b3WheelJoint_SetSuspensionLimits :: JointId -> Float -> Float -> IO ()
foreign import ccall unsafe "b3WheelJoint_EnableSpinMotor"
c_b3WheelJoint_EnableSpinMotor :: JointId -> CBool -> IO ()
foreign import ccall unsafe "b3WheelJoint_IsSpinMotorEnabled"
c_b3WheelJoint_IsSpinMotorEnabled :: JointId -> IO CBool
foreign import ccall unsafe "b3WheelJoint_SetSpinMotorSpeed"
c_b3WheelJoint_SetSpinMotorSpeed :: JointId -> Float -> IO ()
foreign import ccall unsafe "b3WheelJoint_GetSpinMotorSpeed"
c_b3WheelJoint_GetSpinMotorSpeed :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_SetMaxSpinTorque"
c_b3WheelJoint_SetMaxSpinTorque :: JointId -> Float -> IO ()
foreign import ccall unsafe "b3WheelJoint_GetMaxSpinTorque"
c_b3WheelJoint_GetMaxSpinTorque :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_GetSpinSpeed"
c_b3WheelJoint_GetSpinSpeed :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_GetSpinTorque"
c_b3WheelJoint_GetSpinTorque :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_EnableSteering"
c_b3WheelJoint_EnableSteering :: JointId -> CBool -> IO ()
foreign import ccall unsafe "b3WheelJoint_IsSteeringEnabled"
c_b3WheelJoint_IsSteeringEnabled :: JointId -> IO CBool
foreign import ccall unsafe "b3WheelJoint_SetSteeringHertz"
c_b3WheelJoint_SetSteeringHertz :: JointId -> Float -> IO ()
foreign import ccall unsafe "b3WheelJoint_GetSteeringHertz"
c_b3WheelJoint_GetSteeringHertz :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_SetSteeringDampingRatio"
c_b3WheelJoint_SetSteeringDampingRatio :: JointId -> Float -> IO ()
foreign import ccall unsafe "b3WheelJoint_GetSteeringDampingRatio"
c_b3WheelJoint_GetSteeringDampingRatio :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_SetMaxSteeringTorque"
c_b3WheelJoint_SetMaxSteeringTorque :: JointId -> Float -> IO ()
foreign import ccall unsafe "b3WheelJoint_GetMaxSteeringTorque"
c_b3WheelJoint_GetMaxSteeringTorque :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_EnableSteeringLimit"
c_b3WheelJoint_EnableSteeringLimit :: JointId -> CBool -> IO ()
foreign import ccall unsafe "b3WheelJoint_IsSteeringLimitEnabled"
c_b3WheelJoint_IsSteeringLimitEnabled :: JointId -> IO CBool
foreign import ccall unsafe "b3WheelJoint_GetLowerSteeringLimit"
c_b3WheelJoint_GetLowerSteeringLimit :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_GetUpperSteeringLimit"
c_b3WheelJoint_GetUpperSteeringLimit :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_SetSteeringLimits"
c_b3WheelJoint_SetSteeringLimits :: JointId -> Float -> Float -> IO ()
foreign import ccall unsafe "b3WheelJoint_SetTargetSteeringAngle"
c_b3WheelJoint_SetTargetSteeringAngle :: JointId -> Float -> IO ()
foreign import ccall unsafe "b3WheelJoint_GetTargetSteeringAngle"
c_b3WheelJoint_GetTargetSteeringAngle :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_GetSteeringAngle"
c_b3WheelJoint_GetSteeringAngle :: JointId -> IO Float
foreign import ccall unsafe "b3WheelJoint_GetSteeringTorque"
c_b3WheelJoint_GetSteeringTorque :: JointId -> IO Float
create
:: WorldId
-> WheelJointDef
-> IO JointId
create :: WorldId -> WheelJointDef -> IO JointId
create WorldId
a0 WheelJointDef
a1 =
WheelJointDef -> (Ptr WheelJointDef -> IO JointId) -> IO JointId
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with WheelJointDef
a1 ((Ptr WheelJointDef -> IO JointId) -> IO JointId)
-> (Ptr WheelJointDef -> IO JointId) -> IO JointId
forall a b. (a -> b) -> a -> b
$ \Ptr WheelJointDef
p1 ->
WorldId -> Ptr WheelJointDef -> IO JointId
c_b3CreateWheelJoint WorldId
a0 Ptr WheelJointDef
p1
enableSuspension
:: JointId
-> Bool
-> IO ()
enableSuspension :: JointId -> Bool -> IO ()
enableSuspension JointId
a0 Bool
a1 =
JointId -> CBool -> IO ()
c_b3WheelJoint_EnableSuspension JointId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
isSuspensionEnabled
:: JointId
-> IO Bool
isSuspensionEnabled :: JointId -> IO Bool
isSuspensionEnabled JointId
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
<$> (JointId -> IO CBool
c_b3WheelJoint_IsSuspensionEnabled JointId
a0)
setSuspensionHertz
:: JointId
-> Float
-> IO ()
setSuspensionHertz :: JointId -> Float -> IO ()
setSuspensionHertz JointId
a0 Float
a1 =
JointId -> Float -> IO ()
c_b3WheelJoint_SetSuspensionHertz JointId
a0 Float
a1
getSuspensionHertz
:: JointId
-> IO Float
getSuspensionHertz :: JointId -> IO Float
getSuspensionHertz JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetSuspensionHertz JointId
a0
setSuspensionDampingRatio
:: JointId
-> Float
-> IO ()
setSuspensionDampingRatio :: JointId -> Float -> IO ()
setSuspensionDampingRatio JointId
a0 Float
a1 =
JointId -> Float -> IO ()
c_b3WheelJoint_SetSuspensionDampingRatio JointId
a0 Float
a1
getSuspensionDampingRatio
:: JointId
-> IO Float
getSuspensionDampingRatio :: JointId -> IO Float
getSuspensionDampingRatio JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetSuspensionDampingRatio JointId
a0
enableSuspensionLimit
:: JointId
-> Bool
-> IO ()
enableSuspensionLimit :: JointId -> Bool -> IO ()
enableSuspensionLimit JointId
a0 Bool
a1 =
JointId -> CBool -> IO ()
c_b3WheelJoint_EnableSuspensionLimit JointId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
isSuspensionLimitEnabled
:: JointId
-> IO Bool
isSuspensionLimitEnabled :: JointId -> IO Bool
isSuspensionLimitEnabled JointId
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
<$> (JointId -> IO CBool
c_b3WheelJoint_IsSuspensionLimitEnabled JointId
a0)
getLowerSuspensionLimit
:: JointId
-> IO Float
getLowerSuspensionLimit :: JointId -> IO Float
getLowerSuspensionLimit JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetLowerSuspensionLimit JointId
a0
getUpperSuspensionLimit
:: JointId
-> IO Float
getUpperSuspensionLimit :: JointId -> IO Float
getUpperSuspensionLimit JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetUpperSuspensionLimit JointId
a0
setSuspensionLimits
:: JointId
-> Float
-> Float
-> IO ()
setSuspensionLimits :: JointId -> Float -> Float -> IO ()
setSuspensionLimits JointId
a0 Float
a1 Float
a2 =
JointId -> Float -> Float -> IO ()
c_b3WheelJoint_SetSuspensionLimits JointId
a0 Float
a1 Float
a2
enableSpinMotor
:: JointId
-> Bool
-> IO ()
enableSpinMotor :: JointId -> Bool -> IO ()
enableSpinMotor JointId
a0 Bool
a1 =
JointId -> CBool -> IO ()
c_b3WheelJoint_EnableSpinMotor JointId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
isSpinMotorEnabled
:: JointId
-> IO Bool
isSpinMotorEnabled :: JointId -> IO Bool
isSpinMotorEnabled JointId
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
<$> (JointId -> IO CBool
c_b3WheelJoint_IsSpinMotorEnabled JointId
a0)
setSpinMotorSpeed
:: JointId
-> Float
-> IO ()
setSpinMotorSpeed :: JointId -> Float -> IO ()
setSpinMotorSpeed JointId
a0 Float
a1 =
JointId -> Float -> IO ()
c_b3WheelJoint_SetSpinMotorSpeed JointId
a0 Float
a1
getSpinMotorSpeed
:: JointId
-> IO Float
getSpinMotorSpeed :: JointId -> IO Float
getSpinMotorSpeed JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetSpinMotorSpeed JointId
a0
setMaxSpinTorque
:: JointId
-> Float
-> IO ()
setMaxSpinTorque :: JointId -> Float -> IO ()
setMaxSpinTorque JointId
a0 Float
a1 =
JointId -> Float -> IO ()
c_b3WheelJoint_SetMaxSpinTorque JointId
a0 Float
a1
getMaxSpinTorque
:: JointId
-> IO Float
getMaxSpinTorque :: JointId -> IO Float
getMaxSpinTorque JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetMaxSpinTorque JointId
a0
getSpinSpeed
:: JointId
-> IO Float
getSpinSpeed :: JointId -> IO Float
getSpinSpeed JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetSpinSpeed JointId
a0
getSpinTorque
:: JointId
-> IO Float
getSpinTorque :: JointId -> IO Float
getSpinTorque JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetSpinTorque JointId
a0
enableSteering
:: JointId
-> Bool
-> IO ()
enableSteering :: JointId -> Bool -> IO ()
enableSteering JointId
a0 Bool
a1 =
JointId -> CBool -> IO ()
c_b3WheelJoint_EnableSteering JointId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
isSteeringEnabled
:: JointId
-> IO Bool
isSteeringEnabled :: JointId -> IO Bool
isSteeringEnabled JointId
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
<$> (JointId -> IO CBool
c_b3WheelJoint_IsSteeringEnabled JointId
a0)
setSteeringHertz
:: JointId
-> Float
-> IO ()
setSteeringHertz :: JointId -> Float -> IO ()
setSteeringHertz JointId
a0 Float
a1 =
JointId -> Float -> IO ()
c_b3WheelJoint_SetSteeringHertz JointId
a0 Float
a1
getSteeringHertz
:: JointId
-> IO Float
getSteeringHertz :: JointId -> IO Float
getSteeringHertz JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetSteeringHertz JointId
a0
setSteeringDampingRatio
:: JointId
-> Float
-> IO ()
setSteeringDampingRatio :: JointId -> Float -> IO ()
setSteeringDampingRatio JointId
a0 Float
a1 =
JointId -> Float -> IO ()
c_b3WheelJoint_SetSteeringDampingRatio JointId
a0 Float
a1
getSteeringDampingRatio
:: JointId
-> IO Float
getSteeringDampingRatio :: JointId -> IO Float
getSteeringDampingRatio JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetSteeringDampingRatio JointId
a0
setMaxSteeringTorque
:: JointId
-> Float
-> IO ()
setMaxSteeringTorque :: JointId -> Float -> IO ()
setMaxSteeringTorque JointId
a0 Float
a1 =
JointId -> Float -> IO ()
c_b3WheelJoint_SetMaxSteeringTorque JointId
a0 Float
a1
getMaxSteeringTorque
:: JointId
-> IO Float
getMaxSteeringTorque :: JointId -> IO Float
getMaxSteeringTorque JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetMaxSteeringTorque JointId
a0
enableSteeringLimit
:: JointId
-> Bool
-> IO ()
enableSteeringLimit :: JointId -> Bool -> IO ()
enableSteeringLimit JointId
a0 Bool
a1 =
JointId -> CBool -> IO ()
c_b3WheelJoint_EnableSteeringLimit JointId
a0 (Bool -> CBool
forall a. Num a => Bool -> a
fromBool Bool
a1)
isSteeringLimitEnabled
:: JointId
-> IO Bool
isSteeringLimitEnabled :: JointId -> IO Bool
isSteeringLimitEnabled JointId
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
<$> (JointId -> IO CBool
c_b3WheelJoint_IsSteeringLimitEnabled JointId
a0)
getLowerSteeringLimit
:: JointId
-> IO Float
getLowerSteeringLimit :: JointId -> IO Float
getLowerSteeringLimit JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetLowerSteeringLimit JointId
a0
getUpperSteeringLimit
:: JointId
-> IO Float
getUpperSteeringLimit :: JointId -> IO Float
getUpperSteeringLimit JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetUpperSteeringLimit JointId
a0
setSteeringLimits
:: JointId
-> Float
-> Float
-> IO ()
setSteeringLimits :: JointId -> Float -> Float -> IO ()
setSteeringLimits JointId
a0 Float
a1 Float
a2 =
JointId -> Float -> Float -> IO ()
c_b3WheelJoint_SetSteeringLimits JointId
a0 Float
a1 Float
a2
setTargetSteeringAngle
:: JointId
-> Float
-> IO ()
setTargetSteeringAngle :: JointId -> Float -> IO ()
setTargetSteeringAngle JointId
a0 Float
a1 =
JointId -> Float -> IO ()
c_b3WheelJoint_SetTargetSteeringAngle JointId
a0 Float
a1
getTargetSteeringAngle
:: JointId
-> IO Float
getTargetSteeringAngle :: JointId -> IO Float
getTargetSteeringAngle JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetTargetSteeringAngle JointId
a0
getSteeringAngle
:: JointId
-> IO Float
getSteeringAngle :: JointId -> IO Float
getSteeringAngle JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetSteeringAngle JointId
a0
getSteeringTorque
:: JointId
-> IO Float
getSteeringTorque :: JointId -> IO Float
getSteeringTorque JointId
a0 =
JointId -> IO Float
c_b3WheelJoint_GetSteeringTorque JointId
a0