One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

TriggerVolume

class · iOS 13.0+ · SDK 27.1

@MainActor @preconcurrency class TriggerVolume

An invisible 3D shape that detects when objects enter or exit a given region of space. A trigger volume is an entity that can participate in collisions because it has a ``CollisionComponent``. You use a trigger volume as a sensor that indicates when another collision-capable entity, like a ``ModelEntity``, enters the region of space occupied by the trigger volume. You can use the generated ``CollisionEvents`` between the trigger volume and the other entity to trigger an action, like indicating to the user that a projectile hit its target. ![Diagram showing the components present in the trigger volume entity.](TriggerVolume-1) The trigger volume itself is very simple. It lacks any physical appearance, and doesn’t participate in physics simulations. This makes it very efficient for tasks that require only collision detection.

Members (3)

init · iOS 13.0+

init

TypeScript
static initShapeFilter(shape: ShapeResource, filter?: CollisionFilter): Promise<TriggerVolume>
Swift declaration
@MainActor @preconcurrency convenience init(shape: ShapeResource, filter: CollisionFilter = .sensor)

Creates a trigger volume with the given shape and collision filter. - Parameters: - shape: The shape of the trigger volume. - filter: A collision filter that lets you differentiate among collision groups.

init · iOS 13.0+

init

TypeScript
static initShapesFilter(shapes: Array<ShapeResource>, filter?: CollisionFilter): Promise<TriggerVolume>
Swift declaration
@MainActor @preconcurrency init(shapes: [ShapeResource], filter: CollisionFilter = .sensor)

Creates a trigger volume with the given composite shape and collision filter. - Parameters: - shapes: A collection of shapes which taken together define the composite shape of the trigger volume. - filter: A collision filter that lets you differentiate among collision groups.

init · iOS 13.0+

init

TypeScript
static init(): Promise<TriggerVolume>
Swift declaration
@MainActor @preconcurrency required init()

Creates a trigger volume.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →