diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-29 12:50:49 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-29 12:50:49 +0200 |
commit | d0c1dd16ee101fa51448c896372cbfa487705ee4 (patch) | |
tree | 3184b32ff1272c088b9e06e85b58cbf0ad5c5ddf /modules | |
parent | c83f912bcb33d441b90afe36bad38880acbe5f15 (diff) | |
download | redot-engine-d0c1dd16ee101fa51448c896372cbfa487705ee4.tar.gz |
Revert "Update RVO2 to git 2022.09"
This reverts commit c92088110567bd9c61aa046e9a93bdbc6469073e.
Fixes #78826.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/navigation/SCsub | 18 | ||||
-rw-r--r-- | modules/navigation/nav_map.cpp | 22 |
2 files changed, 18 insertions, 22 deletions
diff --git a/modules/navigation/SCsub b/modules/navigation/SCsub index 18a8d550ec..46bcb0fba4 100644 --- a/modules/navigation/SCsub +++ b/modules/navigation/SCsub @@ -37,12 +37,10 @@ if env["builtin_recastnavigation"]: if env["builtin_rvo2_2d"]: thirdparty_dir = "#thirdparty/rvo2/rvo2_2d/" thirdparty_sources = [ - "Agent2d.cc", - "Obstacle2d.cc", - "KdTree2d.cc", - "Line.cc", - "RVOSimulator2d.cc", - "Vector2.cc", + "Agent2d.cpp", + "Obstacle2d.cpp", + "KdTree2d.cpp", + "RVOSimulator2d.cpp", ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] @@ -56,11 +54,9 @@ if env["builtin_rvo2_2d"]: if env["builtin_rvo2_3d"]: thirdparty_dir = "#thirdparty/rvo2/rvo2_3d/" thirdparty_sources = [ - "Agent3d.cc", - "KdTree3d.cc", - "Plane.cc", - "RVOSimulator3d.cc", - "Vector3.cc", + "Agent3d.cpp", + "KdTree3d.cpp", + "RVOSimulator3d.cpp", ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index 2595a02a61..2e4bf38f50 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -1042,16 +1042,16 @@ void NavMap::_update_rvo_obstacles_tree_2d() { rvo_2d_obstacle->avoidance_layers_ = _obstacle_avoidance_layers; if (i != 0) { - rvo_2d_obstacle->previous_ = raw_obstacles.back(); - rvo_2d_obstacle->previous_->next_ = rvo_2d_obstacle; + rvo_2d_obstacle->prevObstacle_ = raw_obstacles.back(); + rvo_2d_obstacle->prevObstacle_->nextObstacle_ = rvo_2d_obstacle; } if (i == rvo_2d_vertices.size() - 1) { - rvo_2d_obstacle->next_ = raw_obstacles[obstacleNo]; - rvo_2d_obstacle->next_->previous_ = rvo_2d_obstacle; + rvo_2d_obstacle->nextObstacle_ = raw_obstacles[obstacleNo]; + rvo_2d_obstacle->nextObstacle_->prevObstacle_ = rvo_2d_obstacle; } - rvo_2d_obstacle->direction_ = normalize(rvo_2d_vertices[(i == rvo_2d_vertices.size() - 1 ? 0 : i + 1)] - rvo_2d_vertices[i]); + rvo_2d_obstacle->unitDir_ = 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; @@ -1099,9 +1099,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.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))->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))->update(); } @@ -1124,9 +1124,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.kdTree_); - agent->get_rvo_agent_2d()->computeNewVelocity(rvo_simulation_2d.timeStep_); - agent->get_rvo_agent_2d()->update(rvo_simulation_2d.timeStep_); + 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->update(); } } |