allow to reserve space in OAHashMap explicitly and also in AStar.

* also handle overflow occurring in _get_probe_length
This commit is contained in:
Robin Hübner
2019-08-25 21:30:52 +02:00
parent 6d6d437146
commit 1031833fb0
6 changed files with 132 additions and 9 deletions

View File

@@ -46,6 +46,10 @@ class AStar : public Reference {
struct Point {
Point() :
neighbours(4u),
unlinked_neighbours(4u) {}
int id;
Vector3 pos;
real_t weight_scale;
@@ -132,6 +136,9 @@ public:
void disconnect_points(int p_id, int p_with_id);
bool are_points_connected(int p_id, int p_with_id) const;
int get_point_count() const;
int get_point_capacity() const;
void reserve_space(int p_num_nodes);
void clear();
int get_closest_point(const Vector3 &p_point) const;
@@ -171,6 +178,9 @@ public:
void disconnect_points(int p_id, int p_with_id);
bool are_points_connected(int p_id, int p_with_id) const;
int get_point_count() const;
int get_point_capacity() const;
void reserve_space(int p_num_nodes);
void clear();
int get_closest_point(const Vector2 &p_point) const;