module Graphics.Animation.Cal3D.Mixer
(newMixer, deleteMixer
, blendCycle, clearCycle, executeAction
)
where
import Foreign
import Foreign.C.Types
import Foreign.C.String
import Graphics.Animation.Cal3D.Types
import Graphics.Animation.Cal3D.Error
foreign import ccall safe "newMixer"
newMixer :: IO Mixer
foreign import ccall safe "deleteMixer"
deleteMixer :: Mixer -> IO ()
blendCycle :: Mixer
-> AnimationId
-> Float
-> Float
-> IO (Either String ())
blendCycle mixer (AnimationId id) weight delay =
checkError (c_blendCycle mixer id
(realToFrac weight)
(realToFrac delay))
0 "blendCycle failed"
foreign import ccall safe "blendCycle"
c_blendCycle :: Mixer -> CInt -> CFloat -> CFloat -> IO CInt
clearCycle :: Mixer
-> AnimationId
-> Float
-> IO (Either String ())
clearCycle mixer (AnimationId id) delay =
checkError (c_clearCycle mixer id (realToFrac delay))
0 "clearCycle failed"
foreign import ccall safe "clearCycle"
c_clearCycle :: Mixer -> CInt -> CFloat -> IO CInt
executeAction :: Mixer
-> AnimationId
-> Float
-> Float
-> Float
-> Bool
-> IO (Either String ())
executeAction mixer (AnimationId id) delayIn delayOut weightTarget autoLock =
checkError (c_executeAction mixer id
(realToFrac delayIn)
(realToFrac delayOut)
(realToFrac weightTarget)
(fromBool autoLock))
0 "executeAction failed"
foreign import ccall safe "executeAction"
c_executeAction :: Mixer -> CInt -> CFloat -> CFloat -> CFloat ->
CInt -> IO CInt