btOptimizedBvh::updateBvhNodes uses the variable curNodeSubPart to remember which part of a mesh is currently locked. If the part of the current node differs from curNodeSubPart, the old part has to be unlocked and the new one has to be locked. But the assignment of the new part index to curNodeSubPart is missing. The assignment
curNodeSubPart = nodeSubPart;
has to be added within
if (nodeSubPart != curNodeSubPart)
{
...
}
Bug fix for btOptimizedBvh
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Bug fix for btOptimizedBvh
We changed it into:
Can you double check this is correct?
Thanks,
Erwin
Code: Select all
if (nodeSubPart != curNodeSubPart)
{
if (curNodeSubPart >= 0)
meshInterface->unLockReadOnlyVertexBase(curNodeSubPart);
meshInterface->getLockedReadOnlyVertexIndexBase(&vertexbase,numverts, type,stride,&indexbase,indexstride,numfaces,indicestype,nodeSubPart);
curNodeSubPart = nodeSubPart;
btAssert(indicestype==PHY_INTEGER||indicestype==PHY_SHORT);
}
Thanks,
Erwin
-
- Posts: 17
- Joined: Thu Jun 12, 2008 1:32 pm
Re: Bug fix for btOptimizedBvh
Yes, it looks correct.Erwin Coumans wrote:Can you double check this is correct?
Thanks,
Erwin