improvement

This commit is contained in:
2026-04-12 11:16:39 +03:00
parent fde764c1fa
commit bb974da0e2
2 changed files with 5 additions and 1 deletions

View File

@@ -12,9 +12,9 @@ namespace omath::pathfinding
public:
void update(const Vector3<float>& bot_position, const Vector3<float>& target_position, float min_node_distance) const;
void on_path(std::function<void(const Vector3<float>&)> callback);
private:
std::weak_ptr<NavigationMesh> m_mav_mesh;
float m_min_distance_to_path_point;
std::optional<std::function<void(const Vector3<float>&)>> m_on_next_path_node = nullptr;
};
} // namespace omath::pathfinding

View File

@@ -28,4 +28,8 @@ namespace omath::pathfinding
else
m_on_next_path_node->operator()(path.front());
}
void WalkBot::on_path(std::function<void(const Vector3<float>&)> callback)
{
m_on_next_path_node = callback;
}
} // namespace omath::pathfinding