|
|
@@ -275,9 +275,11 @@ int maxdirsterid(const T *p,int count,const T &dir,btAlignedObjectArray<int> &al |
|
|
|
int mc = ma; |
|
|
|
for(btScalar xx = x-btScalar(40.0) ; xx <= x ; xx+= btScalar(5.0)) |
|
|
|
{ |
|
|
|
btScalar s = btSin(SIMD_RADS_PER_DEG*(xx)); |
|
|
|
btScalar c = btCos(SIMD_RADS_PER_DEG*(xx)); |
|
|
|
int md = maxdirfiltered(p,count,dir+(u*s+v*c)*btScalar(0.025),allow); |
|
|
|
// LOL BEGIN |
|
|
|
btScalar ss = btSin(SIMD_RADS_PER_DEG*(xx)); |
|
|
|
btScalar cc = btCos(SIMD_RADS_PER_DEG*(xx)); |
|
|
|
int md = maxdirfiltered(p,count,dir+(u*ss+v*cc)*btScalar(0.025),allow); |
|
|
|
// LOL END |
|
|
|
if(mc==m && md==m) |
|
|
|
{ |
|
|
|
allow[m]=3; |
|
|
@@ -309,8 +311,10 @@ int operator ==(const int3 &a,const int3 &b) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int above(btVector3* vertices,const int3& t, const btVector3 &p, btScalar epsilon); |
|
|
|
int above(btVector3* vertices,const int3& t, const btVector3 &p, btScalar epsilon) |
|
|
|
// LOL BEGIN |
|
|
|
int above(btVector3 const* vertices,const int3& t, const btVector3 &p, btScalar epsilon); |
|
|
|
int above(btVector3 const* vertices,const int3& t, const btVector3 &p, btScalar epsilon) |
|
|
|
// LOL END |
|
|
|
{ |
|
|
|
btVector3 n=TriNormal(vertices[t[0]],vertices[t[1]],vertices[t[2]]); |
|
|
|
return (btDot(n,p-vertices[t[0]]) > epsilon); // EPSILON??? |
|
|
@@ -486,7 +490,9 @@ btHullTriangle* HullLibrary::extrudable(btScalar epsilon) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int4 HullLibrary::FindSimplex(btVector3 *verts,int verts_count,btAlignedObjectArray<int> &allow) |
|
|
|
// LOL BEGIN |
|
|
|
int4 HullLibrary::FindSimplex(btVector3 const *verts,int verts_count,btAlignedObjectArray<int> &allow) |
|
|
|
// LOL END |
|
|
|
{ |
|
|
|
btVector3 basis[3]; |
|
|
|
basis[0] = btVector3( btScalar(0.01), btScalar(0.02), btScalar(1.0) ); |
|
|
@@ -522,7 +528,9 @@ int4 HullLibrary::FindSimplex(btVector3 *verts,int verts_count,btAlignedObjectAr |
|
|
|
return int4(p0,p1,p2,p3); |
|
|
|
} |
|
|
|
|
|
|
|
int HullLibrary::calchullgen(btVector3 *verts,int verts_count, int vlimit) |
|
|
|
// LOL BEGIN |
|
|
|
int HullLibrary::calchullgen(btVector3 const *verts,int verts_count, int vlimit) |
|
|
|
// LOL END |
|
|
|
{ |
|
|
|
if(verts_count <4) return 0; |
|
|
|
if(vlimit==0) vlimit=1000000000; |
|
|
@@ -570,7 +578,9 @@ int HullLibrary::calchullgen(btVector3 *verts,int verts_count, int vlimit) |
|
|
|
vlimit-=4; |
|
|
|
while(vlimit >0 && ((te=extrudable(epsilon)) != 0)) |
|
|
|
{ |
|
|
|
int3 ti=*te; |
|
|
|
// LOL BEGIN |
|
|
|
//int3 ti=*te; |
|
|
|
// LOL END |
|
|
|
int v=te->vmax; |
|
|
|
btAssert(v != -1); |
|
|
|
btAssert(!isextreme[v]); // wtf we've already done this vertex |
|
|
@@ -622,7 +632,9 @@ int HullLibrary::calchullgen(btVector3 *verts,int verts_count, int vlimit) |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
int HullLibrary::calchull(btVector3 *verts,int verts_count, TUIntArray& tris_out, int &tris_count,int vlimit) |
|
|
|
// LOL BEGIN |
|
|
|
int HullLibrary::calchull(btVector3 const *verts,int verts_count, TUIntArray& tris_out, int &tris_count,int vlimit) |
|
|
|
// LOL END |
|
|
|
{ |
|
|
|
int rc=calchullgen(verts,verts_count, vlimit) ; |
|
|
|
if(!rc) return 0; |
|
|
@@ -658,7 +670,9 @@ bool HullLibrary::ComputeHull(unsigned int vcount,const btVector3 *vertices,PHul |
|
|
|
{ |
|
|
|
|
|
|
|
int tris_count; |
|
|
|
int ret = calchull( (btVector3 *) vertices, (int) vcount, result.m_Indices, tris_count, static_cast<int>(vlimit) ); |
|
|
|
// LOL BEGIN |
|
|
|
int ret = calchull( vertices, (int) vcount, result.m_Indices, tris_count, static_cast<int>(vlimit) ); |
|
|
|
// LOL END |
|
|
|
if(!ret) return false; |
|
|
|
result.mIndexCount = (unsigned int) (tris_count*3); |
|
|
|
result.mFaceCount = (unsigned int) tris_count; |
|
|
|