31 int numbrushes = planeEquations.
size();
32 for (
int i = 0; i < numbrushes; i++)
46 int numvertices = vertices.
size();
47 for (
int i = 0; i < numvertices; i++)
63 int numbrushes = planeEquations.
size();
64 for (
int i = 0; i < numbrushes; i++)
77 const int numvertices = vertices.
size();
79 for (
int i = 0; i < numvertices; i++)
83 for (
int j = i + 1; j < numvertices; j++)
87 for (
int k = j + 1; k < numvertices; k++)
95 for (
int ww = 0; ww < 2; ww++)
97 planeEquation = normalSign * edge0.
cross(edge1);
101 if (
notExist(planeEquation, planeEquationsOut))
103 planeEquation[3] = -planeEquation.
dot(N1);
108 planeEquationsOut.
push_back(planeEquation);
121 const int numbrushes = planeEquations.
size();
123 for (
int i = 0; i < numbrushes; i++)
127 for (
int j = i + 1; j < numbrushes; j++)
131 for (
int k = j + 1; k < numbrushes; k++)
155 quotient =
btScalar(-1.) / quotient;
160 potentialVertex += n3n1;
161 potentialVertex += n1n2;
162 potentialVertex *= quotient;
bool notExist(const btVector3 &planeEquation, const btAlignedObjectArray< btVector3 > &planeEquations)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btFabs(btScalar x)
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
int size() const
return the number of elements in the array
void push_back(const T &_Val)
static void getVerticesFromPlaneEquations(const btAlignedObjectArray< btVector3 > &planeEquations, btAlignedObjectArray< btVector3 > &verticesOut)
static bool areVerticesBehindPlane(const btVector3 &planeNormal, const btAlignedObjectArray< btVector3 > &vertices, btScalar margin)
static void getPlaneEquationsFromVertices(btAlignedObjectArray< btVector3 > &vertices, btAlignedObjectArray< btVector3 > &planeEquationsOut)
static bool isPointInsidePlanes(const btAlignedObjectArray< btVector3 > &planeEquations, const btVector3 &point, btScalar margin)
btVector3 can be used to represent 3D points and vectors.
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
btScalar dot(const btVector3 &v) const
Return the dot product.
btScalar length2() const
Return the length of the vector squared.
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.