-- 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\\ClassBone.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. -- -- ClassBone.chs -- module HGamer3D.Bindings.Ogre.ClassBone 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\\ClassBone.chs" #-} import HGamer3D.Bindings.Ogre.ClassPtr {-# LINE 41 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} import HGamer3D.Bindings.Ogre.StructHG3DClass {-# LINE 42 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} import HGamer3D.Bindings.Ogre.StructVec3 {-# LINE 43 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} import HGamer3D.Bindings.Ogre.StructQuaternion {-# LINE 44 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} -- | delete :: HG3DClass -- ^ classpointer - pointer of Class instance which is going to be deleted. -> IO () -- ^ delete a1 = withHG3DClass a1 $ \a1' -> delete'_ a1' >>= \res -> return () {-# LINE 49 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} -- | Creates a new BoneThis method creates a new bone which will inherit the transforms of this bone, with the handle specified. createChild :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Int -- ^ handle - The numeric handle to give the new bone; must be unique within the Skeleton. -> Vec3 -- ^ translate - Initial translation offset of child relative to parent -> Quaternion -- ^ rotate - Initial rotation relative to parent -> IO (HG3DClass) -- ^ createChild a1 a2 a3 a4 = withHG3DClass a1 $ \a1' -> let {a2' = fromIntegral a2} in withVec3 a3 $ \a3' -> withQuaternion a4 $ \a4' -> alloca $ \a5' -> createChild'_ a1' a2' a3' a4' a5' >>= \res -> peek a5'>>= \a5'' -> return (a5'') {-# LINE 57 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} -- | Gets the numeric handle for this bone (unique within the skeleton). getHandle :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Int) -- ^ getHandle a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> getHandle'_ a1' a2' >>= \res -> peekIntConv a2'>>= \a2'' -> return (a2'') {-# LINE 62 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} -- | Sets the current position / orientation to be the 'binding pose' ie the layout in which bones were originally bound to a mesh. setBindingPose :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO () -- ^ setBindingPose a1 = withHG3DClass a1 $ \a1' -> setBindingPose'_ a1' >>= \res -> return () {-# LINE 66 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} -- | Resets the position and orientation of this BoneBones are bound to the mesh in a binding pose. They are then modified from this position during animation. This method returns the bone to it's original position and orientation. reset :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO () -- ^ reset a1 = withHG3DClass a1 $ \a1' -> reset'_ a1' >>= \res -> return () {-# LINE 70 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} -- | Sets whether or not this bone is manually controlled. Manually controlled bones can be altered by the application at runtime, and their positions will not be reset by the animation routines. Note that you should also make sure that there are no AnimationTrackgetHandle()You can also use AnimationState::setBlendMask to mask out animation from chosen tracks if you want to prevent application of a scripted animation to a bone without altering the Animation setManuallyControlled :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Bool -- ^ manuallyControlled -> IO () -- ^ setManuallyControlled a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = fromBool a2} in setManuallyControlled'_ a1' a2' >>= \res -> return () {-# LINE 75 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} -- | Getter for mManuallyControlled Flag isManuallyControlled :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> IO (Bool) -- ^ isManuallyControlled a1 = withHG3DClass a1 $ \a1' -> alloca $ \a2' -> isManuallyControlled'_ a1' a2' >>= \res -> peekBoolUtil a2'>>= \a2'' -> return (a2'') {-# LINE 80 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} -- | Node::needUpdate needUpdate :: HG3DClass -- ^ classpointer - pointer of Class instance from which this methods is called. -> Bool -- ^ forceParentUpdate -> IO () -- ^ needUpdate a1 a2 = withHG3DClass a1 $ \a1' -> let {a2' = fromBool a2} in needUpdate'_ a1' a2' >>= \res -> return () {-# LINE 85 ".\\HGamer3D\\Bindings\\Ogre\\ClassBone.chs" #-} foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassBone.chs.h ogre_bn_destruct" delete'_ :: ((HG3DClassPtr) -> (IO ())) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassBone.chs.h ogre_bn_createChild" createChild'_ :: ((HG3DClassPtr) -> (CUShort -> ((Vec3Ptr) -> ((QuaternionPtr) -> ((HG3DClassPtr) -> (IO ())))))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassBone.chs.h ogre_bn_getHandle" getHandle'_ :: ((HG3DClassPtr) -> ((Ptr CUShort) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassBone.chs.h ogre_bn_setBindingPose" setBindingPose'_ :: ((HG3DClassPtr) -> (IO ())) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassBone.chs.h ogre_bn_reset" reset'_ :: ((HG3DClassPtr) -> (IO ())) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassBone.chs.h ogre_bn_setManuallyControlled" setManuallyControlled'_ :: ((HG3DClassPtr) -> (CInt -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassBone.chs.h ogre_bn_isManuallyControlled" isManuallyControlled'_ :: ((HG3DClassPtr) -> ((Ptr CInt) -> (IO ()))) foreign import ccall safe "HGamer3D\\Bindings\\Ogre\\ClassBone.chs.h ogre_bn_needUpdate" needUpdate'_ :: ((HG3DClassPtr) -> (CInt -> (IO ())))