Skip to content

Commit

Permalink
Revert "Update RVO2 to git 2022.09"
Browse files Browse the repository at this point in the history
This reverts commit c920881.

Fixes godotengine#78826.
  • Loading branch information
akien-mga committed Jun 29, 2023
1 parent c83f912 commit d0c1dd1
Show file tree
Hide file tree
Showing 33 changed files with 4,271 additions and 5,055 deletions.
2 changes: 1 addition & 1 deletion COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ License: Zlib

Files: ./thirdparty/rvo2/
Comment: RVO2
Copyright: 2008, University of North Carolina at Chapel Hill
Copyright: 2016, University of North Carolina at Chapel Hill
License: Apache-2.0

Files: ./thirdparty/spirv-reflect/
Expand Down
18 changes: 7 additions & 11 deletions modules/navigation/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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]

Expand Down
22 changes: 11 additions & 11 deletions modules/navigation/nav_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand All @@ -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();
}
}
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,13 +639,13 @@ Files extracted from upstream source:
For 2D in `rvo2_2d` folder

- Upstream: https://github.com/snape/RVO2
- Version: git (5961f05ed310f3a5e902aa70ad54e010ba6dcdfd, 2022)
- Version: git (f7c5380235f6c9ac8d19cbf71fc94e2d4758b0a3, 2021)
- License: Apache 2.0

For 3D in `rvo2_3d` folder

- Upstream: https://github.com/snape/RVO2-3D
- Version: git (8be355eb84dc763267b5acf7070d6d623d752e51, 2022)
- Version: git (bfc048670a4e85066e86a1f923d8ea92e3add3b2, 2021)
- License: Apache 2.0

Files extracted from upstream source:
Expand Down
Loading

0 comments on commit d0c1dd1

Please sign in to comment.