Contents

withCollisions(_:)

Provides access to the collisions with cloth bodies that took place.

Declaration

func withCollisions<Result>(_ callback: (Span<ClothColliderEvents.NewBodyCollisions.Collision>) -> Result) -> Result

Parameters

  • 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.

See Also

Accessing collision data