Possible bug in btBvhTriangleMeshShape

reltham
Posts: 66
Joined: Fri Oct 12, 2007 6:28 pm
Location: San Diego

Possible bug in btBvhTriangleMeshShape

Post by reltham »

When you construct a btBvhTriangleMeshShape and set the flag for it to not build it's bvh at construction time and then set the scale on it, it will crash on accessing a null m_bvh pointer down inside processAllTriangles().

The desire is to avoid building the bvh twice when something is scaled. Once at construction and once when you scale it.

I'm not sure how to go about fixing this, or if there is some other approach that works?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Possible bug in btBvhTriangleMeshShape

Post by Erwin Coumans »

Haven't checked the implementation (at SIGGRAPH at the moment), but it seems that checking for NULL for m_bvh should solve the problem.

Have you tried that?
Thanks,
Erwin
reltham
Posts: 66
Joined: Fri Oct 12, 2007 6:28 pm
Location: San Diego

Re: Possible bug in btBvhTriangleMeshShape

Post by reltham »

Well the issue is that is should be able to calculate an aabb without the bvh, so it can't just check for null and fail, I think it needs to check for null and use another method.