mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-18 15:23:26 +00:00
improvement
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user