18 template <
typename Real>
20 Sphere3<Real>& sphere);
23 template <
typename Real>
24 bool InContainer(Vector3<Real>
const& point, Sphere3<Real>
const& sphere);
27 template <
typename Real>
29 Sphere3<Real>
const& sphere1, Sphere3<Real>& merge);
32 template <
typename Real>
37 for (
int i = 1; i < numPoints; ++i)
39 sphere.
center += points[i];
41 sphere.
center /= (Real)numPoints;
43 for (
int i = 0; i < numPoints; ++i)
46 Real radiusSqr =
Dot(diff, diff);
47 if (radiusSqr > sphere.
radius)
57 template <
typename Real>
64 template <
typename Real>
69 Real lenSqr =
Dot(cenDiff, cenDiff);
71 Real rDiffSqr = rDiff*rDiff;
73 if (rDiffSqr >= lenSqr)
75 merge = (rDiff >= (Real)0 ? sphere1 : sphere0);
79 Real
length = sqrt(lenSqr);
82 Real coeff = (length + rDiff) / (((Real)2)*
length);
bool GetContainer(int numPoints, Vector3< Real > const *points, Capsule3< Real > &capsule)
bool MergeContainers(Capsule3< Real > const &capsule0, Capsule3< Real > const &capsule1, Capsule3< Real > &merge)
bool InContainer(Vector3< Real > const &point, Capsule3< Real > const &capsule)
GLfixed GLfixed GLint GLint GLfixed points
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
GLuint GLsizei GLsizei * length
DualQuaternion< Real > Length(DualQuaternion< Real > const &d, bool robust=false)