20 template <
typename Real>
22 Cylinder3<Real>& cylinder);
25 template <
typename Real>
26 bool InContainer(Vector3<Real>
const& point, Cylinder3<Real>
const& cylinder);
29 template <
typename Real>
34 fitter.
Fit(numPoints, points);
38 Real maxRadiusSqr = (Real)0;
39 for (
int i = 0; i < numPoints; ++i)
41 auto result = plQuery(points[i], line);
42 if (
result.sqrDistance > maxRadiusSqr)
44 maxRadiusSqr =
result.sqrDistance;
51 for (
int i = 1; i < numPoints; ++i)
53 diff = points[i] - line.
origin;
66 (((Real)0.5)*(wMax + wMin))*line.
direction;
68 cylinder.
radius = sqrt(maxRadiusSqr);
69 cylinder.
height = wMax - wMin;
73 template <
typename Real>
77 Real zProj =
Dot(diff, cylinder.
axis.direction);
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
bool GetContainer(int numPoints, Vector3< Real > const *points, Capsule3< Real > &capsule)
bool InContainer(Vector3< Real > const &point, Capsule3< Real > const &capsule)
GLubyte GLubyte GLubyte GLubyte w
Vector< N, Real > direction
GLfixed GLfixed GLint GLint GLfixed points
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
DualQuaternion< Real > Length(DualQuaternion< Real > const &d, bool robust=false)
bool Fit(int numPoints, Vector3< Real > const *points)
Line3< Real > const & GetParameters() const