Use body_idx in terrain part of collisionDetect

If `active_collision_options.body_idx` is non-empty, only check the bodies
listed against the terrain.