31 int numbrushes = planeEquations.
size();
32 for (
int i = 0; i < numbrushes; i++)
34 const btVector3& N1 = planeEquations[i];
46 int numvertices = vertices.
size();
47 for (
int i = 0; i < numvertices; i++)
49 const btVector3& N1 = vertices[i];
63 int numbrushes = planeEquations.
size();
64 for (
int i = 0; i < numbrushes; i++)
66 const btVector3& N1 = planeEquations[i];
67 if (planeEquation.dot(N1) >
btScalar(0.999))
77 const int numvertices = vertices.
size();
79 for (
int i = 0; i < numvertices; i++)
81 const btVector3& N1 = vertices[i];
83 for (
int j = i + 1; j < numvertices; j++)
85 const btVector3& N2 = vertices[j];
87 for (
int k = j + 1; k < numvertices; k++)
89 const btVector3& N3 = vertices[k];
91 btVector3 planeEquation, edge0, edge1;
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++)
125 const btVector3& N1 = planeEquations[i];
127 for (
int j = i + 1; j < numbrushes; j++)
129 const btVector3& N2 = planeEquations[j];
131 for (
int k = j + 1; k < numbrushes; k++)
133 const btVector3& N3 = planeEquations[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;
159 btVector3 potentialVertex = n2n3;
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)
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)