fuseCollisionPoints<C extends PositionComponent> function

void fuseCollisionPoints<C extends PositionComponent>(
  1. FuseCollisionPointsFn<C> fn
)

Calls fn when this component is colliding with another component of type C.

This version also returns the points at which the collision occurred.

Implementation

void fuseCollisionPoints<C extends PositionComponent>(FuseCollisionPointsFn<C> fn) {
  _fuseCollisionsCheck();
  final component = fuseComponent<FuseCollisions>();

  component._collisionPointsFns.add((target, points) {
    if (target is C) {
      fn(target, points);
    }
  });
}