summaryrefslogtreecommitdiffstats
path: root/modules/navigation/nav_map.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-06-14 09:25:10 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-06-14 09:25:10 +0200
commit375156a637ad2a997f3cda7bbfb8ed51f4b7beab (patch)
tree4aef8a528f86ab3208c8d7d3c7f3886d8763f064 /modules/navigation/nav_map.cpp
parent56ac32feabf807d1d08fea35dabeb0ecfccc0450 (diff)
parentc92088110567bd9c61aa046e9a93bdbc6469073e (diff)
downloadredot-engine-375156a637ad2a997f3cda7bbfb8ed51f4b7beab.tar.gz
Merge pull request #78099 from DeeJayLSP/rvo2023
Update RVO2 to git 2022.09
Diffstat (limited to 'modules/navigation/nav_map.cpp')
-rw-r--r--modules/navigation/nav_map.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp
index 57c33a49b5..dbacb2df6b 100644
--- a/modules/navigation/nav_map.cpp
+++ b/modules/navigation/nav_map.cpp
@@ -1022,16 +1022,16 @@ void NavMap::_update_rvo_obstacles_tree_2d() {
rvo_2d_obstacle->avoidance_layers_ = _obstacle_avoidance_layers;
if (i != 0) {
- rvo_2d_obstacle->prevObstacle_ = raw_obstacles.back();
- rvo_2d_obstacle->prevObstacle_->nextObstacle_ = rvo_2d_obstacle;
+ rvo_2d_obstacle->previous_ = raw_obstacles.back();
+ rvo_2d_obstacle->previous_->next_ = rvo_2d_obstacle;
}
if (i == rvo_2d_vertices.size() - 1) {
- rvo_2d_obstacle->nextObstacle_ = raw_obstacles[obstacleNo];
- rvo_2d_obstacle->nextObstacle_->prevObstacle_ = rvo_2d_obstacle;
+ rvo_2d_obstacle->next_ = raw_obstacles[obstacleNo];
+ rvo_2d_obstacle->next_->previous_ = rvo_2d_obstacle;
}
- rvo_2d_obstacle->unitDir_ = normalize(rvo_2d_vertices[(i == rvo_2d_vertices.size() - 1 ? 0 : i + 1)] - rvo_2d_vertices[i]);
+ rvo_2d_obstacle->direction_ = normalize(rvo_2d_vertices[(i == rvo_2d_vertices.size() - 1 ? 0 : i + 1)] - rvo_2d_vertices[i]);
if (rvo_2d_vertices.size() == 2) {
rvo_2d_obstacle->isConvex_ = true;
@@ -1079,9 +1079,9 @@ void NavMap::_update_rvo_simulation() {
}
void NavMap::compute_single_avoidance_step_2d(uint32_t index, NavAgent **agent) {
- (*(agent + index))->get_rvo_agent_2d()->computeNeighbors(&rvo_simulation_2d);
- (*(agent + index))->get_rvo_agent_2d()->computeNewVelocity(&rvo_simulation_2d);
- (*(agent + index))->get_rvo_agent_2d()->update(&rvo_simulation_2d);
+ (*(agent + index))->get_rvo_agent_2d()->computeNeighbors(rvo_simulation_2d.kdTree_);
+ (*(agent + index))->get_rvo_agent_2d()->computeNewVelocity(rvo_simulation_2d.timeStep_);
+ (*(agent + index))->get_rvo_agent_2d()->update(rvo_simulation_2d.timeStep_);
(*(agent + index))->update();
}
@@ -1104,9 +1104,9 @@ void NavMap::step(real_t p_deltatime) {
WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_task);
} else {
for (NavAgent *agent : active_2d_avoidance_agents) {
- agent->get_rvo_agent_2d()->computeNeighbors(&rvo_simulation_2d);
- agent->get_rvo_agent_2d()->computeNewVelocity(&rvo_simulation_2d);
- agent->get_rvo_agent_2d()->update(&rvo_simulation_2d);
+ agent->get_rvo_agent_2d()->computeNeighbors(rvo_simulation_2d.kdTree_);
+ agent->get_rvo_agent_2d()->computeNewVelocity(rvo_simulation_2d.timeStep_);
+ agent->get_rvo_agent_2d()->update(rvo_simulation_2d.timeStep_);
agent->update();
}
}