-- GENERATED by C->Haskell Compiler, version 0.16.3 Crystal Seed, 24 Jan 2009 (Haskell) -- Edit the ORIGNAL .chs file instead! {-# LINE 1 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE TypeSynonymInstances #-} -- This source file is part of HGamer3D -- (A project to enable 3D game development in Haskell) -- For the latest info, see http://www.althainz.de/HGamer3D.html -- -- (c) 2011, 2012 Peter Althainz -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- ClassAnimationState.chs -- module HGamer3D.Bindings.Ogre.ClassAnimationState where import Foreign import Foreign.Ptr import Foreign.C import HGamer3D.Data.HG3DClass import HGamer3D.Data.Vector import HGamer3D.Data.Colour import HGamer3D.Data.Angle import HGamer3D.Bindings.Ogre.Utils {-# LINE 40 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} import HGamer3D.Bindings.Ogre.ClassPtr {-# LINE 41 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} import HGamer3D.Bindings.Ogre.StructHG3DClass {-# LINE 42 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Normal constructor with all params supplied. new :: String -- ^ animName -> HG3DClass -- ^ parent -> Float -- ^ timePos -> Float -- ^ length -> Float -- ^ weight -> Bool -- ^ enabled -> IO (HG3DClass) -- ^ new a1 a2 a3 a4 a5 a6 = withCString a1 $ \a1' -> withHG3DClass a2 $ \a2' -> let {a3' = realToFrac a3} in let {a4' = realToFrac a4} in let {a5' = realToFrac a5} in let {a6' = fromBool a6} in alloca $ \a7' -> new'_ a1' a2' a3' a4' a5' a6' a7' >>= \res -> peek a7'>>= \a7'' -> return (a7'') {-# LINE 53 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Destructor - is here because class has virtual functions and some compilers would whine if it won't exist. delete :: HG3DClass -- ^ classpointer - pointer of Class instance which is going to be deleted. -> IO () -- ^ delete a1 = withHG3DClass a1 $ \a1' -> delete'_ a1' >>= \res -> return () {-# LINE 57 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Gets the name of the animation to which this state applies. getAnimationName :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (String) -- ^ getAnimationName a1 = withHG3DClass a1 $ \a1' -> alloc64k $ \a2' -> getAnimationName'_ a1' a2' >>= \res -> peekCString a2'>>= \a2'' -> return (a2'') {-# LINE 62 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Gets the time position for this animation. getTimePosition :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Float) -- ^ getTimePosition a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getTimePosition'_ a1' a2' >>= \res -> peekFloatConv a2'>>= \a2'' -> return (a2'') {-# LINE 67 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Sets the time position for this animation. setTimePosition :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Float -- ^ timePos -> IO () -- ^ setTimePosition a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = realToFrac a2} in setTimePosition'_ a1' a2' >>= \res -> return () {-# LINE 72 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Gets the total length of this animation (may be shorter than whole animation) getLength :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Float) -- ^ getLength a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getLength'_ a1' a2' >>= \res -> peekFloatConv a2'>>= \a2'' -> return (a2'') {-# LINE 77 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Sets the total length of this animation (may be shorter than whole animation) setLength :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Float -- ^ len -> IO () -- ^ setLength a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = realToFrac a2} in setLength'_ a1' a2' >>= \res -> return () {-# LINE 82 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Gets the weight (influence) of this animation. getWeight :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Float) -- ^ getWeight a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getWeight'_ a1' a2' >>= \res -> peekFloatConv a2'>>= \a2'' -> return (a2'') {-# LINE 87 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Sets the weight (influence) of this animation. setWeight :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Float -- ^ weight -> IO () -- ^ setWeight a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = realToFrac a2} in setWeight'_ a1' a2' >>= \res -> return () {-# LINE 92 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Modifies the time position, adjusting for animation length This method loops at the edges if animation looping is enabled. addTime :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Float -- ^ offset -> IO () -- ^ addTime a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = realToFrac a2} in addTime'_ a1' a2' >>= \res -> return () {-# LINE 97 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Returns true if the animation has reached the end and is not looping. hasEnded :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Bool) -- ^ hasEnded a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> hasEnded'_ a1' a2' >>= \res -> peekBoolUtil a2'>>= \a2'' -> return (a2'') {-# LINE 102 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Returns true if this animation is currently enabled. getEnabled :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Bool) -- ^ getEnabled a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getEnabled'_ a1' a2' >>= \res -> peekBoolUtil a2'>>= \a2'' -> return (a2'') {-# LINE 107 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Sets whether this animation is enabled. setEnabled :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Bool -- ^ enabled -> IO () -- ^ setEnabled a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = fromBool a2} in setEnabled'_ a1' a2' >>= \res -> return () {-# LINE 112 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Sets whether or not an animation loops at the start and end of the animation if the time continues to be altered. setLoop :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Bool -- ^ loop -> IO () -- ^ setLoop a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = fromBool a2} in setLoop'_ a1' a2' >>= \res -> return () {-# LINE 117 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Gets whether or not this animation loops. getLoop :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Bool) -- ^ getLoop a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getLoop'_ a1' a2' >>= \res -> peekBoolUtil a2'>>= \a2'' -> return (a2'') {-# LINE 122 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Copies the states from another animation state, preserving the animation name (unlike operator=) but copying everything else. copyStateFrom :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> HG3DClass -- ^ animState - Reference to animation state which will use as source. -> IO () -- ^ copyStateFrom a1 a2 = withHG3DClass a1 $ \a1' -> withHG3DClass a2 $ \a2' -> copyStateFrom'_ a1' a2' >>= \res -> return () {-# LINE 127 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | Get the parent animation state set. getParent :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (HG3DClass) -- ^ getParent a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getParent'_ a1' a2' >>= \res -> peek a2'>>= \a2'' -> return (a2'') {-# LINE 132 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | create a new blend mask with the given number of entries - Details: In addition to assigning a single weight value to a skeletal animation, it may be desirable to assign animation weights per bone using a 'blend mask'. createBlendMask :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Int -- ^ blendMaskSizeHint -> Float -- ^ initialWeight -> IO () -- ^ createBlendMask a1 a2 a3 = withHG3DClass a1 $ \a1' -> let {a2' = fromIntegral a2} in let {a3' = realToFrac a3} in createBlendMask'_ a1' a2' a3' >>= \res -> return () {-# LINE 138 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | destroy the currently set blend mask destroyBlendMask :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO () -- ^ destroyBlendMask a1 = withHG3DClass a1 $ \a1' -> destroyBlendMask'_ a1' >>= \res -> return () {-# LINE 142 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | return whether there is currently a valid blend mask set hasBlendMask :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Bool) -- ^ hasBlendMask a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> hasBlendMask'_ a1' a2' >>= \res -> peekBoolUtil a2'>>= \a2'' -> return (a2'') {-# LINE 147 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | set the weight for the bone identified by the given handle setBlendMaskEntry :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Int -- ^ boneHandle -> Float -- ^ weight -> IO () -- ^ setBlendMaskEntry a1 a2 a3 = withHG3DClass a1 $ \a1' -> let {a2' = fromIntegral a2} in let {a3' = realToFrac a3} in setBlendMaskEntry'_ a1' a2' a3' >>= \res -> return () {-# LINE 153 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} -- | get the weight for the bone identified by the given handle getBlendMaskEntry :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Int -- ^ boneHandle -> IO (Float) -- ^ getBlendMaskEntry a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = fromIntegral a2} in alloca $ \a3' -> getBlendMaskEntry'_ a1' a2' a3' >>= \res -> peekFloatConv a3'>>= \a3'' -> return (a3'') {-# LINE 159 ".\\HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs" #-} foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_construct" new'_ :: ((Ptr CChar) -> ((HG3DClassPtr) -> (CFloat -> (CFloat -> (CFloat -> (CInt -> ((HG3DClassPtr) -> (IO ())))))))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_destruct" delete'_ :: ((HG3DClassPtr) -> (IO ())) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_getAnimationName" getAnimationName'_ :: ((HG3DClassPtr) -> ((Ptr CChar) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_getTimePosition" getTimePosition'_ :: ((HG3DClassPtr) -> ((Ptr CFloat) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_setTimePosition" setTimePosition'_ :: ((HG3DClassPtr) -> (CFloat -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_getLength" getLength'_ :: ((HG3DClassPtr) -> ((Ptr CFloat) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_setLength" setLength'_ :: ((HG3DClassPtr) -> (CFloat -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_getWeight" getWeight'_ :: ((HG3DClassPtr) -> ((Ptr CFloat) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_setWeight" setWeight'_ :: ((HG3DClassPtr) -> (CFloat -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_addTime" addTime'_ :: ((HG3DClassPtr) -> (CFloat -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_hasEnded" hasEnded'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_getEnabled" getEnabled'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_setEnabled" setEnabled'_ :: ((HG3DClassPtr) -> (CInt -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_setLoop" setLoop'_ :: ((HG3DClassPtr) -> (CInt -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_getLoop" getLoop'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_copyStateFrom" copyStateFrom'_ :: ((HG3DClassPtr) -> ((HG3DClassPtr) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_getParent" getParent'_ :: ((HG3DClassPtr) -> ((HG3DClassPtr) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_createBlendMask" createBlendMask'_ :: ((HG3DClassPtr) -> (CInt -> (CFloat -> (IO ())))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_destroyBlendMask" destroyBlendMask'_ :: ((HG3DClassPtr) -> (IO ())) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_hasBlendMask" hasBlendMask'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_setBlendMaskEntry" setBlendMaskEntry'_ :: ((HG3DClassPtr) -> (CInt -> (CFloat -> (IO ())))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassAnimationState.chs.h ogre_anms_getBlendMaskEntry" getBlendMaskEntry'_ :: ((HG3DClassPtr) -> (CInt -> ((Ptr CFloat) -> (IO ()))))