浏览代码

Merge pull request #50472 from akien-mga/room_manager-fix-csg-dependency

RoomManager: Fix build with CSG module disabled
Rémi Verschelde 4 年之前
父节点
当前提交
91241d9944
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      scene/3d/room_manager.cpp

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

@@ -36,13 +36,17 @@
 #include "core/os/os.h"
 #include "editor/editor_node.h"
 #include "mesh_instance.h"
-#include "modules/csg/csg_shape.h"
 #include "portal.h"
 #include "room_group.h"
 #include "scene/3d/camera.h"
 #include "scene/3d/light.h"
 #include "visibility_notifier.h"
 
+#include "modules/modules_enabled.gen.h"
+#ifdef MODULE_CSG_ENABLED
+#include "modules/csg/csg_shape.h"
+#endif
+
 // #define GODOT_PORTALS_USE_BULLET_CONVEX_HULL
 
 #ifdef GODOT_PORTALS_USE_BULLET_CONVEX_HULL
@@ -1412,6 +1416,7 @@ void RoomManager::_convert_portal(Room *p_room, Spatial *p_node, LocalVector<Por
 }
 
 bool RoomManager::_bound_findpoints_geom_instance(GeometryInstance *p_gi, Vector<Vector3> &r_room_pts, AABB &r_aabb) {
+#ifdef MODULE_CSG_ENABLED
 	// max opposite extents .. note AABB storing size is rubbish in this aspect
 	// it can fail once mesh min is larger than FLT_MAX / 2.
 	r_aabb.position = Vector3(FLT_MAX / 2, FLT_MAX / 2, FLT_MAX / 2);
@@ -1459,6 +1464,9 @@ bool RoomManager::_bound_findpoints_geom_instance(GeometryInstance *p_gi, Vector
 	} // if csg shape
 
 	return true;
+#else
+	return false;
+#endif
 }
 
 bool RoomManager::_bound_findpoints_mesh_instance(MeshInstance *p_mi, Vector<Vector3> &r_room_pts, AABB &r_aabb) {