20 template <
typename Real>
22 OrientedBox3<Real>& box);
27 template <
typename Real>
28 bool InContainer(Vector3<Real>
const& point, OrientedBox3<Real>
const& box);
33 template <
typename Real>
35 OrientedBox3<Real>
const& box1, OrientedBox3<Real>& merge);
38 template <
typename Real>
44 if (fitter.
Fit(numPoints, points))
59 for (
int i = 1; i < numPoints; ++i)
61 diff = points[i] - box.
center;
62 for (
int j = 0; j < 3; ++j)
64 Real dot =
Dot(diff, box.
axis[j]);
69 else if (dot > pmax[j])
76 for (
int j = 0; j < 3; ++j)
78 box.
center += (((Real)0.5)*(pmin[j] + pmax[j]))*box.
axis[j];
79 box.
extent[j] = ((Real)0.5)*(pmax[j] - pmin[j]);
87 template <
typename Real>
91 for (
int i = 0; i < 3; ++i)
93 Real coeff =
Dot(diff, box.
axis[i]);
102 template <
typename Real>
126 if (
Dot(q0, q1) < (Real)0)
134 for (
int j = 0; j < 3; ++j)
150 std::array<Vector3<Real>, 8> vertex;
155 for (
int i = 0; i < 8; ++i)
158 for (
int j = 0; j < 3; ++j)
160 Real dot =
Dot(diff, merge.
axis[j]);
165 else if (dot < pmin[j])
173 for (
int i = 0; i < 8; ++i)
176 for (
int j = 0; j < 3; ++j)
178 Real dot =
Dot(diff, merge.
axis[j]);
183 else if (dot < pmin[j])
193 Real
const half = (Real)0.5;
194 for (
int j = 0; j < 3; ++j)
196 merge.
center += half*(pmax[j] + pmin[j])*merge.
axis[j];
197 merge.
extent[j] = half*(pmax[j] - pmin[j]);
bool Fit(int numPoints, Vector3< Real > const *points)
std::array< Vector< N, Real >, N > axis
Vector< NumRows, Real > GetCol(int c) const
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
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)
void SetCol(int c, Vector< NumRows, Real > const &vec)
Real Normalize(GVector< Real > &v, bool robust=false)
OrientedBox3< Real > const & GetParameters() const
GLdouble GLdouble GLdouble GLdouble q
void GetVertices(std::array< Vector< N, Real >,(1<< N)> &vertex) const