Center of mass calculation is slow so make it optional via a parameter.