@Override
public List<EntityRef> scanArea(AABB area, Iterable<CollisionGroup> collisionFilter) {
// TODO: Add the aabbTest method from newer versions of bullet to TeraBullet, use that instead
BoxShape shape = new BoxShape(area.getExtents());
GhostObject scanObject = createCollider(area.getCenter(), shape, CollisionFilterGroups.SENSOR_TRIGGER,
combineGroups(collisionFilter), CollisionFlags.NO_CONTACT_RESPONSE);
// This in particular is overkill
broadphase.calculateOverlappingPairs(dispatcher);
List<EntityRef> result = Lists.newArrayList();
for (int i = 0; i < scanObject.getNumOverlappingObjects(); ++i) {
CollisionObject other = scanObject.getOverlappingObject(i);
Object userObj = other.getUserPointer();
if (userObj instanceof EntityRef) {
result.add((EntityRef) userObj);
}
}