EntityPoint.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 <tuple>
  17. #include <OgreRoot.h>
  18. /**
  19. * An entity point.
  20. */
  21. class EntityPoint{
  22. public:
  23. /**
  24. * Constructor.
  25. *
  26. * @param[in] name Name of the entity point.
  27. */
  28. EntityPoint(const Ogre::String& name);
  29. /**
  30. * Destructor.
  31. */
  32. virtual ~EntityPoint();
  33. /**
  34. * Updates the point state with debug information.
  35. */
  36. void UpdateDebug();
  37. /**
  38. * Retrieves the entity point name.
  39. *
  40. * @return The name of the entity point.
  41. */
  42. const Ogre::String& GetName() const;
  43. /**
  44. * Sets the point position.
  45. *
  46. * @param[in] point The new point position
  47. */
  48. void SetPosition(const Ogre::Vector3& point);
  49. /**
  50. * Retrieves the point position.
  51. *
  52. * @return The point position.
  53. */
  54. const Ogre::Vector3& GetPosition() const;
  55. /**
  56. * Retrieves the point position for Lua scripts.
  57. *
  58. * @return The X, Y and Z coordinates.
  59. */
  60. std::tuple<float, float, float> ScriptGetPosition() const;
  61. /**
  62. * Sets the point orientation.
  63. *
  64. * @param[in] rotation The new orientation (0-360).
  65. */
  66. void SetRotation(const float rotation);
  67. /**
  68. * Retrieves the point orientation.
  69. *
  70. * @return The point orientation.
  71. */
  72. float GetRotation() const;
  73. /**
  74. * Retrieves the point orientation.
  75. *
  76. * @return The point orientation.
  77. */
  78. float ScriptGetRotation() const;
  79. protected:
  80. /**
  81. * The entity point name.
  82. */
  83. Ogre::String name_;
  84. /**
  85. * The entity point's position.
  86. */
  87. Ogre::Vector3 position_;
  88. /**
  89. * The entity point's orientation.
  90. */
  91. float rotation_;
  92. };