CBoneSceneNode.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 __C_BONE_SCENE_NODE_H_INCLUDED__
  5. #define __C_BONE_SCENE_NODE_H_INCLUDED__
  6. // Used with SkinnedMesh and IAnimatedMeshSceneNode, for boned meshes
  7. #include "IBoneSceneNode.h"
  8. namespace irr
  9. {
  10. namespace scene
  11. {
  12. class CBoneSceneNode : public IBoneSceneNode
  13. {
  14. public:
  15. //! constructor
  16. CBoneSceneNode(ISceneNode* parent, ISceneManager* mgr,
  17. s32 id=-1, u32 boneIndex=0, const c8* boneName=0);
  18. //! Returns the index of the bone
  19. virtual u32 getBoneIndex() const;
  20. //! Sets the animation mode of the bone. Returns true if successful.
  21. virtual bool setAnimationMode(E_BONE_ANIMATION_MODE mode);
  22. //! Gets the current animation mode of the bone
  23. virtual E_BONE_ANIMATION_MODE getAnimationMode() const;
  24. //! returns the axis aligned bounding box of this node
  25. virtual const core::aabbox3d<f32>& getBoundingBox() const;
  26. /*
  27. //! Returns the relative transformation of the scene node.
  28. //virtual core::matrix4 getRelativeTransformation() const;
  29. */
  30. virtual void OnAnimate(u32 timeMs);
  31. virtual void updateAbsolutePositionOfAllChildren();
  32. //! Writes attributes of the scene node.
  33. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;
  34. //! Reads attributes of the scene node.
  35. virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
  36. //! How the relative transformation of the bone is used
  37. virtual void setSkinningSpace( E_BONE_SKINNING_SPACE space )
  38. {
  39. SkinningSpace=space;
  40. }
  41. virtual E_BONE_SKINNING_SPACE getSkinningSpace() const
  42. {
  43. return SkinningSpace;
  44. }
  45. private:
  46. void helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node);
  47. u32 BoneIndex;
  48. core::aabbox3d<f32> Box;
  49. E_BONE_ANIMATION_MODE AnimationMode;
  50. E_BONE_SKINNING_SPACE SkinningSpace;
  51. };
  52. } // end namespace scene
  53. } // end namespace irr
  54. #endif