147#define SPLIT (OVER|UNDER)
148#define PAPERWIDTH (btScalar(0.001))
174 for(
int i=0;i<
convex.vertices.size();i++) {
221 for(
int i=0;i<count;i++)
299 if(a[i]!=b[i])
return 0;
317 if(
t[i]==a &&
t[
i1]==b)
return 1;
324 return (
t[0]==v ||
t[1]==v ||
t[2]==v) ;
357 int &
neib(
int a,
int b);
369 if((*
this)[i]==a && (*this)[
i1]==b)
return n[
i2];
370 if((*
this)[i]==b && (*this)[
i1]==a)
return n[
i2];
386 m_tris[
s->neib(a,b)]->neib(b,a) =
t->neib(b,a);
387 m_tris[
t->neib(b,a)]->neib(a,b) =
s->neib(a,b);
437 tri->~btHullTriangle();
490 return int4(-1,-1,-1,-1);
495 basis[1].normalize();
498 basis[1].normalize ();
506 return int4(-1,-1,-1,-1);
512 return int4(-1,-1,-1,-1);
541 if(p.
x==-1)
return 0;
601 if(
t->vmax>=0)
break;
637 for (i=0;i<
ts.size();i++)
639 tris_out[i] =
static_cast<unsigned int>(
ts[i]);
655 if(!
ret)
return false;
668 if (
result.m_Indices.size() )
717 for (
unsigned int i=0; i<
ovcount; i++)
745 result.mNumIndices =
hr.mIndexCount;
747 result.m_Indices.resize(
static_cast<int>(
hr.mIndexCount));
754 const unsigned int *
source = &
hr.m_Indices[0];
757 for (
unsigned int i=0; i<
hr.mFaceCount; i++)
769 memcpy(&
result.m_Indices[0], &
hr.m_Indices[0],
sizeof(
unsigned int)*
hr.mIndexCount);
778 result.mNumIndices =
hr.mIndexCount+
hr.mFaceCount;
779 result.m_Indices.resize(
static_cast<int>(
result.mNumIndices));
784 const unsigned int *
source = &
hr.m_Indices[0];
786 for (
unsigned int i=0; i<
hr.mFaceCount; i++)
818 if (
result.m_OutputVertices.size())
820 result.mNumOutputVertices=0;
821 result.m_OutputVertices.clear();
823 if (
result.m_Indices.size() )
863 if (
svcount == 0 )
return false;
868#define EPSILON btScalar(0.000001)
888 for (
unsigned int i=0; i<
svcount; i++)
894 for (
int j=0;
j<3;
j++)
978 for (
unsigned int i=0; i<
svcount; i++)
1050 for (
unsigned int i=0; i<
vcount; i++)
1053 for (
int j=0;
j<3;
j++)
#define btAlignedFree(ptr)
#define btAlignedAlloc(size, alignment)
ConvexH::HalfEdge HalfEdge
btVector3 ThreePlaneIntersection(const btPlane &p0, const btPlane &p1, const btPlane &p2)
btScalar DistanceBetweenLines(const btVector3 &ustart, const btVector3 &udir, const btVector3 &vstart, const btVector3 &vdir, btVector3 *upoint=NULL, btVector3 *vpoint=NULL)
int maxdirsterid(const T *p, int count, const T &dir, btAlignedObjectArray< int > &allow)
btVector3 PlaneLineIntersection(const btPlane &plane, const btVector3 &p0, const btVector3 &p1)
static void addPoint(unsigned int &vcount, btVector3 *p, btScalar x, btScalar y, btScalar z)
int operator==(const btPlane &a, const btPlane &b)
void ReleaseHull(PHullResult &result)
int hasvert(const int3 &t, int v)
btPlane PlaneFlip(const btPlane &plane)
btVector3 NormalOf(const btVector3 *vert, const int n)
int coplanar(const btPlane &a, const btPlane &b)
btVector3 PlaneProject(const btPlane &plane, const btVector3 &point)
int maxdirfiltered(const T *p, int count, const T &dir, btAlignedObjectArray< int > &allow)
btVector3 TriNormal(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2)
int SplitTest(ConvexH &convex, const btPlane &plane)
int hasedge(const int3 &t, int a, int b)
int above(btVector3 *vertices, const int3 &t, const btVector3 &p, btScalar epsilon)
btScalar planetestepsilon
int PlaneTest(const btPlane &p, const btVector3 &v)
btScalar GetDist(btScalar px, btScalar py, btScalar pz, const btScalar *p2)
int shareedge(const int3 &a, const int3 &b)
btVector3 orth(const btVector3 &v)
const T & btMax(const T &a, const T &b)
btScalar length(const btQuaternion &q)
Return the length of a quaternion.
#define SIMD_RADS_PER_DEG
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btSin(btScalar x)
btScalar btFabs(btScalar x)
btScalar btCos(btScalar x)
btScalar btDot(const btVector3 &v1, const btVector3 &v2)
Return the dot product between two vectors.
btVector3 btCross(const btVector3 &v1, const btVector3 &v2)
Return the cross product of two vectors.
btAlignedObjectArray< HalfEdge > edges
btAlignedObjectArray< btPlane > facets
btAlignedObjectArray< btVector3 > vertices
btHullTriangle * extrudable(btScalar epsilon)
class btHullTriangle * allocateTriangle(int a, int b, int c)
bool ComputeHull(unsigned int vcount, const btVector3 *vertices, PHullResult &result, unsigned int vlimit)
HullError ReleaseResult(HullResult &result)
void BringOutYourDead(const btVector3 *verts, unsigned int vcount, btVector3 *overts, unsigned int &ocount, unsigned int *indices, unsigned indexcount)
HullError CreateConvexHull(const HullDesc &desc, HullResult &result)
void deAllocateTriangle(btHullTriangle *)
int calchull(btVector3 *verts, int verts_count, TUIntArray &tris_out, int &tris_count, int vlimit)
btAlignedObjectArray< int > m_vertexIndexMapping
void b2bfix(btHullTriangle *s, btHullTriangle *t)
void removeb2b(btHullTriangle *s, btHullTriangle *t)
btAlignedObjectArray< class btHullTriangle * > m_tris
void checkit(btHullTriangle *t)
void extrude(class btHullTriangle *t0, int v)
int calchullgen(btVector3 *verts, int verts_count, int vlimit)
int4 FindSimplex(btVector3 *verts, int verts_count, btAlignedObjectArray< int > &allow)
bool CleanupVertices(unsigned int svcount, const btVector3 *svertices, unsigned int stride, unsigned int &vcount, btVector3 *vertices, btScalar normalepsilon, btVector3 &scale)
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 resize(int newsize, const T &fillData=T())
void push_back(const T &_Val)
btHullTriangle(int a, int b, int c)
btVector3 can be used to represent 3D points and vectors.
const btScalar & getZ() const
Return the z value.
btScalar length() const
Return the length of the vector.
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
btVector3 normalized() const
Return a normalized version of this vector.
const btScalar & getY() const
Return the y value.
const btScalar & getX() const
Return the x value.
int3(int _x, int _y, int _z)
const int & operator[](int i) const