QGearsHRCMeshLoader.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 "QGearsHRCFile.h"
  18. namespace QGears{
  19. /**
  20. * A loader for skeleton meshes.
  21. */
  22. class HRCMeshLoader : public Ogre::ManualResourceLoader{
  23. public:
  24. /**
  25. * Constructor.
  26. *
  27. * @param hrc_file[in] The HRC file to load from.
  28. */
  29. explicit HRCMeshLoader(HRCFile &hrc_file);
  30. /**
  31. * Destructor.
  32. */
  33. virtual ~HRCMeshLoader();
  34. /**
  35. * Loads a resource.
  36. *
  37. * @param resource[in] The resource to load.
  38. */
  39. virtual void loadResource(Ogre::Resource *resource);
  40. protected:
  41. /**
  42. * Loads a bone.
  43. *
  44. * @param mesh[in|out] The mesh to add the bone to.
  45. * @param bone[in] The bone to add.
  46. * @param path[in] Path to the file with the bone info.
  47. */
  48. virtual void LoadBone(
  49. Ogre::Mesh *mesh, const HRCFile::Bone &bone, const String &path
  50. );
  51. private:
  52. /**
  53. * The HRC file.
  54. */
  55. HRCFile &hrc_file_;
  56. };
  57. }