<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/PortalComponent/Volume",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation15PortalComponentV6VolumeV"
  },
  "title" : "PortalComponent.Volume"
}
-->

# PortalComponent.Volume

A box-shaped region in portal-local space that defines a volumetric portal boundary.

```
struct Volume
```

## Overview

Pair this type with [`PortalComponent.ClippingMode.volume(_:)`](/documentation/RealityKit/PortalComponent/ClippingMode-swift.enum/volume(_:)) to clip portal world content to
a box, or with [`PortalComponent.CrossingMode.volume(_:)`](/documentation/RealityKit/PortalComponent/CrossingMode-swift.enum/volume(_:)) to allow crossing entities to pass
through the box’s faces.

[`PortalComponent.Volume`](/documentation/RealityKit/PortalComponent/Volume) describes an axis-aligned box in the portal entity’s local coordinate space.
The box is centered at [`position`](/documentation/RealityKit/PortalComponent/Volume/position) and spans the full lengths given by [`extents`](/documentation/RealityKit/PortalComponent/Volume/extents) along
each axis. [`extents`](/documentation/RealityKit/PortalComponent/Volume/extents) are full extents, not half-extents — a volume with
`extents = [1, 1, 1]` is a one-cubic-meter box.

For typical room-sized portals where the box should enclose the portal surface, prefer
[`enclosingBox(depth:)`](/documentation/RealityKit/PortalComponent/BoundaryStyle/enclosingBox(depth:)), which derives the X and Y extents from the portal’s
[`PortalComponent.SurfaceStyle`](/documentation/RealityKit/PortalComponent/SurfaceStyle) for you.

## Topics

### Creating a volume

[`init(position: SIMD3<Float>, extents: SIMD3<Float>)`](/documentation/RealityKit/PortalComponent/Volume/init(position:extents:))

Creates a volume with the given center position and extents.

### Configuring the extents

[`var extents: SIMD3<Float>`](/documentation/RealityKit/PortalComponent/Volume/extents)

The full lengths of the volume along the X, Y, and Z axes of portal-local space, in meters.

### Instance Properties

[`var position: SIMD3<Float>`](/documentation/RealityKit/PortalComponent/Volume/position)

The center of the volume in portal-local space, in meters.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)