We can do this much cleaner.

Don't even create `boundingSphere` until after this loop.  Instead just track a separate center variable initialized to `(0.0, 0.0, 0.0)`.