Back to class index
| Sphere::FastEnclosingSphereSyntaxSphere Sphere::FastEnclosingSphere(const float4 *pointArray, int numPoints); [43 lines of code]Computes a Sphere that bounds the given point array. This functions implements a fast approximate (though rather crude) algorithm of Jack Ritter. See "An Efficient Bounding Sphere", in Graphics Gems 1, pp. 301-303, or Christer Ericson's Real-time Collision Detection, pp. 89-91. This algorithm performs two linear passes over the data set, i.e. it has a time complexity of O(n). Parametersconst float4 *pointArrayAn array of points to compute an enclosing sphere for. This pointer must not be null. intnumPointsThe number of elements in the input array pointArray. See Also |