navMeshTestTool.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef _NAVMESHTESTTOOL_H_
  2. #define _NAVMESHTESTTOOL_H_
  3. #ifndef _NAVMESH_TOOL_H_
  4. #include "navigation/navMeshTool.h"
  5. #endif
  6. #ifndef _NAVPATH_H_
  7. #include "navigation/navPath.h"
  8. #endif
  9. class NavMeshTestTool : public NavMeshTool
  10. {
  11. typedef NavMeshTool Parent;
  12. protected:
  13. String mSpawnClass;
  14. String mSpawnDatablock;
  15. SimObjectPtr<SceneObject> mPlayer;
  16. SimObjectPtr<SceneObject> mCurPlayer;
  17. SimObjectPtr<SceneObject> mFollowObject;
  18. SimObjectPtr<SceneObject> mCurFollowObject;
  19. Point3F mPathStart;
  20. Point3F mPathEnd;
  21. NavPath* mTestPath;
  22. LinkData mLinkTypes;
  23. dtQueryFilter mFilter;
  24. bool mSelectFollow;
  25. public:
  26. DECLARE_CONOBJECT(NavMeshTestTool);
  27. void spawnPlayer(const Point3F& position);
  28. void drawAgent(duDebugDrawTorque& dd, const F32* pos, F32 r, F32 h, F32 c, const U32 col);
  29. NavMeshTestTool();
  30. virtual ~NavMeshTestTool() {}
  31. void onActivated(const Gui3DMouseEvent& evt) override;
  32. void onDeactivated() override;
  33. void on3DMouseDown(const Gui3DMouseEvent& evt) override;
  34. void on3DMouseMove(const Gui3DMouseEvent& evt) override;
  35. void onRender3D() override;
  36. bool updateGuiInfo() override;
  37. S32 getPlayerId();
  38. S32 getFollowObjectId();
  39. void setSpawnClass(String className) { mSpawnClass = className; }
  40. void setSpawnDatablock(String dbName) { mSpawnDatablock = dbName; }
  41. void followSelectMode() { mSelectFollow = true; }
  42. };
  43. #endif // !_NAVMESHTESTTOOL_H_