offMeshConnTool.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef _OFFMESHCONNTOOL_H_
  2. #define _OFFMESHCONNTOOL_H_
  3. #ifndef _NAVMESH_TOOL_H_
  4. #include "navigation/navMeshTool.h"
  5. #endif
  6. class OffMeshConnectionTool : public NavMeshTool
  7. {
  8. typedef NavMeshTool Parent;
  9. bool mStartPosSet;
  10. bool mBiDir;
  11. S32 mLink;
  12. S32 mCurLink;
  13. Point3F mLinkStart;
  14. LinkData mLinkCache;
  15. F32 mLinkRadius;
  16. public:
  17. DECLARE_CONOBJECT(OffMeshConnectionTool);
  18. OffMeshConnectionTool() {
  19. mStartPosSet = false;
  20. mBiDir = false;
  21. mLink = -1;
  22. mCurLink = -1;
  23. mLinkStart = Point3F::Max;
  24. mLinkCache = LinkData(0);
  25. mLinkRadius = 1.0;
  26. }
  27. virtual ~OffMeshConnectionTool() {}
  28. void setActiveNavMesh(NavMesh* nav_mesh) override {
  29. mNavMesh = nav_mesh;
  30. if (!mNavMesh.isNull())
  31. mLinkRadius = mNavMesh->mWalkableRadius;
  32. }
  33. void onActivated(const Gui3DMouseEvent& evt) override;
  34. void onDeactivated() override;
  35. void on3DMouseDown(const Gui3DMouseEvent& evt) override;
  36. void on3DMouseMove(const Gui3DMouseEvent& evt) override;
  37. void onRender3D() override;
  38. bool updateGuiInfo() override;
  39. void setLinkProperties(const LinkData& d, bool biDir, F32 rad);
  40. };
  41. #endif