ソースを参照

NavMap2D: check if obstacles have avoidance enabled

In NavMap2D::_update_rvo_obstacles_tree() check if the NavObstacle2D
has avoidance enabled before adding it to the tree.

This is the 2D fix for #108259
David M. Lary 2 ヶ月 前
コミット
780f3d5e3b
1 ファイル変更3 行追加0 行削除
  1. 3 0
      modules/navigation_2d/nav_map_2d.cpp

+ 3 - 0
modules/navigation_2d/nav_map_2d.cpp

@@ -444,6 +444,9 @@ void NavMap2D::_update_rvo_obstacles_tree() {
 	// The following block is modified copy from RVO2D::AddObstacle()
 	// Obstacles are linked and depend on all other obstacles.
 	for (NavObstacle2D *obstacle : obstacles) {
+		if (!obstacle->is_avoidance_enabled()) {
+			continue;
+		}
 		const Vector2 &_obstacle_position = obstacle->get_position();
 		const Vector<Vector2> &_obstacle_vertices = obstacle->get_vertices();