QGearsHRCSkeletonLoader.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #pragma once
  16. #include <OgreResource.h>
  17. #include "common/TypeDefine.h"
  18. namespace QGears{
  19. class HRCFile;
  20. /**
  21. * A loader for skeletons.
  22. */
  23. class HRCSkeletonLoader : public Ogre::ManualResourceLoader{
  24. public:
  25. /**
  26. * Constructor.
  27. *
  28. * @param hrc_file[in] The HRC file to load from.
  29. */
  30. explicit HRCSkeletonLoader(HRCFile &hrc_file);
  31. /**
  32. * Destructor.
  33. */
  34. virtual ~HRCSkeletonLoader();
  35. /**
  36. * Loads a resource.
  37. *
  38. * @param resource[in] The resource to load.
  39. */
  40. virtual void loadResource( Ogre::Resource *resource );
  41. protected:
  42. /**
  43. * The name of the root bone.
  44. */
  45. static const String ROOT_BONE_NAME;
  46. /**
  47. * The root orientation
  48. */
  49. static const Ogre::Quaternion ROOT_ORIENTATION;
  50. /**
  51. * Creates a base orientation for the skeleton.
  52. */
  53. static Ogre::Quaternion CreateRootOrientation();
  54. private:
  55. HRCFile &hrc_file_;
  56. };
  57. }