From 041115ca4109766f19480e67c980a70c2df0c8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 15 Jul 2021 08:51:15 +0200 Subject: [PATCH] RoomManager: Fix build with CSG module disabled Fixes #50462. --- scene/3d/room_manager.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scene/3d/room_manager.cpp b/scene/3d/room_manager.cpp index 3f95d32c454..53bbbd86cf0 100644 --- a/scene/3d/room_manager.cpp +++ b/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 &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 &r_room_pts, AABB &r_aabb) {