Bugfix/chunkytrimesh subdivide maxnodes (#451)

* minor redundant: dir

* bugfix: ChunkyTriMesh nodes array: out of bounds
This commit is contained in:
Kyeongho Park 2020-11-17 19:46:52 +09:00 committed by GitHub
parent 65b314a44e
commit 24230e8e8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -83,7 +83,7 @@ static void subdivide(BoundsItem* items, int nitems, int imin, int imax, int tri
int inum = imax - imin;
int icur = curNode;
if (curNode > maxNodes)
if (curNode >= maxNodes)
return;
rcChunkyTriMeshNode& node = nodes[curNode++];

View File

@ -424,9 +424,6 @@ static bool isectSegAABB(const float* sp, const float* sq,
bool InputGeom::raycastMesh(float* src, float* dst, float& tmin)
{
float dir[3];
rcVsub(dir, dst, src);
// Prune hit ray.
float btmin, btmax;
if (!isectSegAABB(src, dst, m_meshBMin, m_meshBMax, btmin, btmax))