Path.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef ANKI_SCENE_PATH_H
  2. #define ANKI_SCENE_PATH_H
  3. #include "anki/scene/Common.h"
  4. #include "anki/scene/SceneNode.h"
  5. #include "anki/scene/MoveComponent.h"
  6. namespace anki {
  7. /// XXX
  8. class PathPoint
  9. {
  10. friend class Path;
  11. public:
  12. /// @name Accessors
  13. /// @{
  14. const Vec3& getPosition() const
  15. {
  16. return pos;
  17. }
  18. const Quat& getRotation() const
  19. {
  20. return rot;
  21. }
  22. F32 getDistance() const
  23. {
  24. return dist;
  25. }
  26. F32 getDistanceFromFirst() const
  27. {
  28. return distStart;
  29. }
  30. /// @}
  31. private:
  32. Vec3 pos;
  33. Quat rot;
  34. F32 distStart; ///< Distance from the first PathPoint of the path
  35. F32 dist; ///< Distance from the previous PathPoint in the path list
  36. };
  37. /// XXX
  38. class Path: public SceneNode, public MoveComponent
  39. {
  40. public:
  41. Path(
  42. const char* name, SceneGraph* scene, // SceneNode
  43. const char* filename); // Self
  44. const SceneVector<PathPoint>& getPoints() const
  45. {
  46. return points;
  47. }
  48. F32 getDistance() const
  49. {
  50. return distance;
  51. }
  52. private:
  53. SceneVector<PathPoint> points;
  54. F32 distance;
  55. };
  56. } // end namespace anki
  57. #endif