Calculate BoundSphere from Points.
742 {
744
745 SpicesShader::Sphere sphere;
746
747 glm::vec3 min = { 1E11, 1E11, 1E11 };
748 glm::vec3 max = { -1E11, -1E11, -1E11 };
749
750 for (const auto& point : points)
751 {
752 min = glm::min(min, point);
753 max = glm::max(max, point);
754 }
755
756 glm::vec3 bound = max - min;
757 sphere.c = 0.5f * (max + min);
758 sphere.r = 0.5f * glm::sqrt(bound.x * bound.x + bound.y * bound.y + bound.z * bound.z);
759
760 return sphere;
761 }
#define SPICES_PROFILE_ZONE