IBoneSceneNode.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #pragma once
  5. #include "ISceneNode.h"
  6. namespace irr
  7. {
  8. namespace scene
  9. {
  10. //! Interface for bones used for skeletal animation.
  11. /** Used with SkinnedMesh and IAnimatedMeshSceneNode. */
  12. class IBoneSceneNode : public ISceneNode
  13. {
  14. public:
  15. IBoneSceneNode(ISceneNode *parent, ISceneManager *mgr,
  16. s32 id = -1, u32 boneIndex = 0,
  17. const std::optional<std::string> &boneName = std::nullopt)
  18. :
  19. ISceneNode(parent, mgr, id),
  20. BoneIndex(boneIndex)
  21. {
  22. setName(boneName);
  23. }
  24. //! Returns the index of the bone
  25. u32 getBoneIndex() const
  26. {
  27. return BoneIndex;
  28. }
  29. //! returns the axis aligned bounding box of this node
  30. const core::aabbox3d<f32> &getBoundingBox() const override
  31. {
  32. return Box;
  33. }
  34. const u32 BoneIndex;
  35. // Bogus box; bone scene nodes are not rendered anyways.
  36. static constexpr core::aabbox3d<f32> Box = {{0, 0, 0}};
  37. //! The render method.
  38. /** Does nothing as bones are not visible. */
  39. void render() override {}
  40. };
  41. } // end namespace scene
  42. } // end namespace irr