瀏覽代碼

Portals - Config warning for Rooms with too many planes

Just a small addition, a config warning if the user creates a Room with a large number of bounding planes, letting them know to simplify it.
lawnjelly 4 年之前
父節點
當前提交
5e59f7ce3a
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 7 0
      scene/3d/room.cpp
  2. 1 0
      scene/3d/room_manager.cpp

+ 7 - 0
scene/3d/room.cpp

@@ -225,6 +225,13 @@ String Room::get_configuration_warning() const {
 		}
 	}
 
+	if (_planes.size() > 80) {
+		if (!warning.empty()) {
+			warning += "\n\n";
+		}
+		warning += TTR("Room convex hull contains a large number of planes.\nConsider simplifying the room bound in order to increase performance.");
+	}
+
 	return warning;
 }
 

+ 1 - 0
scene/3d/room_manager.cpp

@@ -796,6 +796,7 @@ void RoomManager::_third_pass_rooms(const LocalVector<Portal *> &p_portals) {
 			found_errors = true;
 		}
 		room->update_gizmo();
+		room->update_configuration_warning();
 	}
 
 	if (found_errors) {