mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-18 20:23:28 +00:00
improved walkbot
This commit is contained in:
@@ -5,16 +5,24 @@
|
||||
#include "navigation_mesh.hpp"
|
||||
#include "omath/linear_algebra/vector3.hpp"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
namespace omath::pathfinding
|
||||
{
|
||||
class WalkBot
|
||||
{
|
||||
public:
|
||||
void update(const Vector3<float>& bot_position, const Vector3<float>& target_position, float min_node_distance) const;
|
||||
WalkBot() = default;
|
||||
explicit WalkBot(std::shared_ptr<NavigationMesh> mesh);
|
||||
|
||||
void set_nav_mesh(std::shared_ptr<NavigationMesh> mesh);
|
||||
|
||||
void update(const Vector3<float>& bot_position, const Vector3<float>& target_position, float min_node_distance);
|
||||
|
||||
void on_path(std::function<void(const Vector3<float>&)> callback);
|
||||
|
||||
private:
|
||||
std::weak_ptr<NavigationMesh> m_mav_mesh;
|
||||
std::optional<std::function<void(const Vector3<float>&)>> m_on_next_path_node = nullptr;
|
||||
std::optional<std::function<void(const Vector3<float>&)>> m_on_next_path_node;
|
||||
std::optional<Vector3<float>> m_last_visited;
|
||||
};
|
||||
} // namespace omath::pathfinding
|
||||
Reference in New Issue
Block a user