---
title: "withParticleIndices(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/clothqueryvolumeevents/newbodyintersections/intersection/withparticleindices(_:)"
---

# withParticleIndices(_:)

Provides access to the indices of particles that intersected the volume.

## Declaration

```swift
func withParticleIndices<Result>(_ callback: (Span<UInt32>) -> Result) -> Result
```

## Parameters

- `callback`: A closure that receives a span over the intersecting particle indices.

## Return Value

Return Value The value returned by callback.

## Discussion

Discussion This span is only available during the subscription callback of this event. The provided span is only valid for the lifetime of the callback.

## See Also

### Inspecting the intersection

- [bodyEntity](realitykit/clothqueryvolumeevents/newbodyintersections/intersection/bodyentity.md)
- [bodyComponent](realitykit/clothqueryvolumeevents/newbodyintersections/intersection/bodycomponent.md)
- [particleIndices](realitykit/clothqueryvolumeevents/newbodyintersections/intersection/particleindices.md)
