Contents

ClippingComponent

A component that clips entities and their children to a customizable bounding box volume with feathered edges.

Declaration

struct ClippingComponent

Overview

The ClippingComponent provides a powerful and performant way to clip content in RealityKit. It’s particularly useful for:

  • Creating soft-edge effects with feathered boundaries instead of hard cuts

  • Creating polished spatial experiences with hierarchical clipping control

Add a ClippingComponent to an entity by passing it to an entity’s Entity/ComponentSet/set() method.

let windowEntity = Entity()

let bounds = BoundingBox(min: SIMD3<Float>(-10, -10, -10), max: SIMD3<Float>(10, 10, 10))
var clipping = ClippingComponent(bounds: bounds)
clipping.featheredEdge.falloff = .linear
clipping.featheredEdge.positiveEdgeInset = [2, 2, 0.0]  // 2-unit feather zone on +X & +Y edges
clipping.featheredEdge.negativeEdgeInset = [0.0, 0.0, 0.0]  // no feathering on negative edges
clipping.shouldClipSelf = true
clipping.shouldClipChildren = true

windowEntity.components.set(clipping)

Topics

Creating a clipping component

Configuring clipping behavior

Feathering clipped edges

Instance Properties

See Also

Portals, clipping, and occlusion