overlap method
The entities whose bodies shape at position and rotation
overlaps.
Implementation
List<Entity> overlap(
Shape3D shape,
Vector3 position,
Quaternion rotation, {
int layerMask = 0xFFFF,
Entity? ignore,
bool includeSensors = false,
}) {
final world = _world;
if (world == null) return const [];
final seen = <Entity>{};
for (final hit in world.overlap(
shape,
position,
rotation,
filter: _filter(layerMask, ignore, includeSensors),
)) {
final entity = system.entityOf(hit.body);
if (entity != null) seen.add(entity);
}
return seen.toList();
}