Commit graph

11 commits

Author SHA1 Message Date
lawnjelly
d7d7abf057 Portals - fix autolink portals to detect internal
Although explicit portals did a check to detect internal portals, this check was missing from autolinked portals. This meant they were incorrectly clipping the room bounds of the enclosing outer room.

This PR adds a check for internal rooms during the autolinking and sets the internal flag where needed.
2021-07-28 15:54:45 +01:00
lawnjelly
d012a26e6a Portals - Fix default portal margin loading
The default portal margin is stored in the RoomManager. Previously this was propagated to Portals when the value was changed, and Portals each stored this default value.

This caused a bug during loading, if the RoomManager was loaded before Portals, the value was never propagated.

This PR makes the default margin a static value stored in the RoomManager, and the Portals now read directly from the static value when required, and do not store locally. This gets around the problem.
2021-07-27 11:48:34 +01:00
lawnjelly
5e59f7ce3a 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.
2021-07-23 10:19:09 +01:00
lawnjelly
c2dd51a85e Portals - fix adding statics twice
Due to an oversight in the autoplace recursive search for static objects, static objects were getting added twice to the portal renderer, which meant they were being rendered twice, lowering performance.

This PR corrects this horrendous error.
2021-07-22 20:23:57 +01:00
lawnjelly
83f1377a8f Portals - lift roomlist restrictions and fix link bug
Allows users to have the RoomManager as the roomlist.

Fixes a couple of bugs dealing with situations where users attempt to link Portals to Rooms outside the roomlist.

Adds a PortalEditorPlugin allowing you to flip individual portals.
2021-07-20 19:05:16 +01:00
lawnjelly
06d66488c2 Portals - Add the ability to autoplace static objects
In order to make level building easier, the system can now support STATIC and DYNAMIC objects in the roomlist that are not placed in rooms. The system will automatically place them in the appropriate room.
2021-07-20 13:24:30 +01:00
lawnjelly
44f9a0f961 Portals - fix autolink sprawling, refine logs
It turned out the new autolinking feature was linking portals AFTER the static meshes had been added to rooms in the PortalRenderer. This meant that large meshes weren't being sprawled across these portals. The fix involves doing the autolinking BEFORE adding the static meshes.

Fixes a bug in the warning for portals being in the wrong direction, they should have only been checkout for outgoing portals. This was resulting in erroneous warnings.

Also the room conversion logs are refined to be more compact and informative.

A warning icon is also added in the gizmo for portals where autolink fails.
2021-07-15 13:04:05 +01:00
Rémi Verschelde
bc40546406
Merge pull request #50457 from lawnjelly/portals_config_warn 2021-07-15 12:30:33 +02:00
lawnjelly
b663acef93 Portals - Add configuration warnings for nodes
Checks for invalid children / grandchildren etc.
2021-07-15 08:01:42 +01:00
Rémi Verschelde
041115ca41
RoomManager: Fix build with CSG module disabled
Fixes #50462.
2021-07-15 08:51:15 +02:00
lawnjelly
eb6f98ec55 Portal occlusion culling
Adds support for occlusion culling via rooms and portals.
2021-07-14 11:43:23 +01:00