withCollisions(_:)
Provides access to the collisions with cloth bodies that took place.
Declaration
func withCollisions<Result>(_ callback: (Span<ClothColliderEvents.NewBodyCollisions.Collision>) -> Result) -> ResultParameters
- callback:
A closure that receives a span over the collisions.
Return Value
The value returned by callback.
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.