Contents

enclosingBox(depth:)

Returns a boundary style that uses a box enclosing the portal surface.

Declaration

static func enclosingBox(depth: Float) -> PortalComponent.BoundaryStyle

Parameters

  • depth:

    The depth of the box in meters, along the entity’s local Z axis.

Discussion

The box is centered on the portal entity’s origin. Its X and Y extents come from the accompanying PortalComponent.SurfaceStyle; its Z extent is the depth you provide.

Use this style for room-sized portals and other bounded portal spaces where content shouldn’t extend infinitely behind the surface. Entities with PortalCrossingComponent cross the box’s faces rather than an infinite plane.

This boundary corresponds to PortalComponent.ClippingMode.volume(_:) and PortalComponent.CrossingMode.volume(_:). To offset the box from the portal entity’s origin, configure those modes directly with a PortalComponent.Volume that has a non-zero position.