Portal
Inherits: Spatial < Node < Object Rooms.
Description
Portals are a special type of MeshInstance that allow the portal culling system to ‘see’ from one room to the next. They often correspond to doors and windows in level geometry. By only allowing Cameras to see through portals, this allows the system to cull out all the objects in rooms that cannot be seen through portals. This is a form of occlusion culling, and can greatly increase performance.
There are some limitations to the form of portals:
outward from the Room they are placed in. The vertices should be positioned on a single plane (although their positioning does not have to be perfect).
There is no need to place an opposite portal in an adjacent room, links are made two-way automatically.
Properties
Methods
Property Descriptions
- NodePath linked_room
Room in the name of the
Portal(the name is used during conversion).
- PoolVector2Array points
Portalpolygon (which should be convex).0,0being the origin of thePortalnode’s Spatial.global_transform. Note: These raw points are sanitized for winding order internally.
- bool portal_active
Portals can be turned on and off at runtime - this is useful for having closable doors.
- float portal_margin
Room (‘sprawling’). As we often don’t want objects that just breach the edges to be assigned to neighbouring rooms, you can assign an extra margin through the
Portalto allow objects to breach without sprawling.
- bool two_way Portals default to being two way - see through in both directions, however you can make them one way, visible from the source room only.
