BoxEmitterShape constructor

BoxEmitterShape({
  1. Vector3? halfExtents,
  2. Vector3? direction,
})

Creates a box emitter spanning [-halfExtents, halfExtents], heading along direction (default +Y).

Implementation

BoxEmitterShape({Vector3? halfExtents, Vector3? direction})
  : direction = (direction?.clone() ?? Vector3(0, 1, 0))..normalize(),
    _box = UniformBoxVec3(
      (halfExtents?.clone() ?? Vector3.all(0.5))..scale(-1.0),
      halfExtents?.clone() ?? Vector3.all(0.5),
    );