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++)
67 if (planeEquation.dot(N1) >
btScalar(0.999))
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);
98 if (planeEquation.length2() >
btScalar(0.0001))
100 planeEquation.normalize();
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++)
142 if ((n2n3.length2() >
btScalar(0.0001)) &&
143 (n3n1.length2() >
btScalar(0.0001)) &&
144 (n1n2.length2() >
btScalar(0.0001)))
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...
SIMD_FORCE_INLINE btScalar btFabs(btScalar x)
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
SIMD_FORCE_INLINE 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)