fuseCollisionStartPoints<C extends PositionComponent> function

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

Calls fn when this component collides with another component of type C.

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

Implementation

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

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