IBoneSceneNode.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef IRR_I_BONE_SCENE_NODE_H_INCLUDED
  5. #define IRR_I_BONE_SCENE_NODE_H_INCLUDED
  6. #include "ISceneNode.h"
  7. namespace irr
  8. {
  9. namespace scene
  10. {
  11. //! Enumeration for different bone animation modes
  12. enum E_BONE_ANIMATION_MODE
  13. {
  14. //! The bone is usually animated, unless it's parent is not animated
  15. EBAM_AUTOMATIC=0,
  16. //! The bone is animated by the skin, if it's parent is not animated then animation will resume from this bone onward
  17. EBAM_ANIMATED,
  18. //! The bone is not animated by the skin
  19. EBAM_UNANIMATED,
  20. //! Not an animation mode, just here to count the available modes
  21. EBAM_COUNT
  22. };
  23. enum E_BONE_SKINNING_SPACE
  24. {
  25. //! local skinning, standard
  26. EBSS_LOCAL=0,
  27. //! global skinning
  28. EBSS_GLOBAL,
  29. EBSS_COUNT
  30. };
  31. //! Names for bone animation modes
  32. const c8* const BoneAnimationModeNames[] =
  33. {
  34. "automatic",
  35. "animated",
  36. "unanimated",
  37. 0,
  38. };
  39. //! Interface for bones used for skeletal animation.
  40. /** Used with ISkinnedMesh and IAnimatedMeshSceneNode. */
  41. class IBoneSceneNode : public ISceneNode
  42. {
  43. public:
  44. IBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id=-1) :
  45. ISceneNode(parent, mgr, id),positionHint(-1),scaleHint(-1),rotationHint(-1) { }
  46. //! Get the name of the bone
  47. /** \deprecated Use getName instead. This method may be removed by Irrlicht 1.9 */
  48. IRR_DEPRECATED virtual const c8* getBoneName() const { return getName(); }
  49. //! Get the index of the bone
  50. virtual u32 getBoneIndex() const = 0;
  51. //! Sets the animation mode of the bone.
  52. /** \return True if successful. (Unused) */
  53. virtual bool setAnimationMode(E_BONE_ANIMATION_MODE mode) = 0;
  54. //! Gets the current animation mode of the bone
  55. virtual E_BONE_ANIMATION_MODE getAnimationMode() const = 0;
  56. //! Get the axis aligned bounding box of this node
  57. virtual const core::aabbox3d<f32>& getBoundingBox() const IRR_OVERRIDE = 0;
  58. //! Returns the relative transformation of the scene node.
  59. //virtual core::matrix4 getRelativeTransformation() const = 0;
  60. //! The animation method.
  61. virtual void OnAnimate(u32 timeMs) IRR_OVERRIDE =0;
  62. //! The render method.
  63. /** Does nothing as bones are not visible. */
  64. virtual void render() IRR_OVERRIDE { }
  65. //! How the relative transformation of the bone is used
  66. virtual void setSkinningSpace( E_BONE_SKINNING_SPACE space ) =0;
  67. //! How the relative transformation of the bone is used
  68. virtual E_BONE_SKINNING_SPACE getSkinningSpace() const =0;
  69. //! Updates the absolute position based on the relative and the parents position
  70. virtual void updateAbsolutePositionOfAllChildren()=0;
  71. s32 positionHint;
  72. s32 scaleHint;
  73. s32 rotationHint;
  74. };
  75. } // end namespace scene
  76. } // end namespace irr
  77. #endif