destroyParticlesInShape method

void destroyParticlesInShape(
  1. Shape shape,
  2. Transform xf, {
  3. bool callDestructionListener = false,
})

Destroy particles inside a shape. In addition, this function immediately destroys particles in the shape in contrast to DestroyParticle() which defers the destruction until the next simulation step.

Implementation

void destroyParticlesInShape(
  Shape shape,
  Transform xf, {
  bool callDestructionListener = false,
}) {
  final callback = DestroyParticlesInShapeCallback(
    this,
    shape,
    xf,
    callDestructionListener: callDestructionListener,
  );
  shape.computeAABB(_temp, xf, 0);
  world.queryAABBParticle(callback, _temp);
}