1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #ifndef __I_BONE_SCENE_NODE_H_INCLUDED__
\r
6 #define __I_BONE_SCENE_NODE_H_INCLUDED__
\r
8 #include "ISceneNode.h"
\r
15 //! Enumeration for different bone animation modes
\r
16 enum E_BONE_ANIMATION_MODE
\r
18 //! The bone is usually animated, unless it's parent is not animated
\r
21 //! The bone is animated by the skin, if it's parent is not animated then animation will resume from this bone onward
\r
24 //! The bone is not animated by the skin
\r
27 //! Not an animation mode, just here to count the available modes
\r
32 enum E_BONE_SKINNING_SPACE
\r
34 //! local skinning, standard
\r
43 //! Names for bone animation modes
\r
44 const c8* const BoneAnimationModeNames[] =
\r
53 //! Interface for bones used for skeletal animation.
\r
54 /** Used with ISkinnedMesh and IAnimatedMeshSceneNode. */
\r
55 class IBoneSceneNode : public ISceneNode
\r
59 IBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id=-1) :
\r
60 ISceneNode(parent, mgr, id),positionHint(-1),scaleHint(-1),rotationHint(-1) { }
\r
62 //! Get the name of the bone
\r
63 /** \deprecated Use getName instead. This method may be removed by Irrlicht 1.9 */
\r
64 _IRR_DEPRECATED_ virtual const c8* getBoneName() const { return getName(); }
\r
66 //! Get the index of the bone
\r
67 virtual u32 getBoneIndex() const = 0;
\r
69 //! Sets the animation mode of the bone.
\r
70 /** \return True if successful. (Unused) */
\r
71 virtual bool setAnimationMode(E_BONE_ANIMATION_MODE mode) = 0;
\r
73 //! Gets the current animation mode of the bone
\r
74 virtual E_BONE_ANIMATION_MODE getAnimationMode() const = 0;
\r
76 //! Get the axis aligned bounding box of this node
\r
77 const core::aabbox3d<f32>& getBoundingBox() const override = 0;
\r
79 //! Returns the relative transformation of the scene node.
\r
80 //virtual core::matrix4 getRelativeTransformation() const = 0;
\r
82 //! The animation method.
\r
83 void OnAnimate(u32 timeMs) override =0;
\r
85 //! The render method.
\r
86 /** Does nothing as bones are not visible. */
\r
87 void render() override { }
\r
89 //! How the relative transformation of the bone is used
\r
90 virtual void setSkinningSpace( E_BONE_SKINNING_SPACE space ) =0;
\r
92 //! How the relative transformation of the bone is used
\r
93 virtual E_BONE_SKINNING_SPACE getSkinningSpace() const =0;
\r
95 //! Updates the absolute position based on the relative and the parents position
\r
96 virtual void updateAbsolutePositionOfAllChildren()=0;
\r
104 } // end namespace scene
\r
105 } // end namespace irr
\r