It seems that btGenerateInternalEdgeInfo locks vertex buffer of striding mesh interface twice:
Before the (triangleIndex, numFaces) loop:
Code:
...
meshInterface->getLockedReadOnlyVertexIndexBase(&vertexbase,numverts, type,stride,&indexbase,indexstride,numfaces,indicestype,partId);
...
then, in the end of the loop:
Code:
trimeshShape->processAllTriangles(&connectivityProcessor,aabbMin,aabbMax);
}
which tries to lock the same buffer again during callback:
Code:
virtual void processNode(int nodeSubPart, int nodeTriangleIndex)
{
const unsigned char *vertexbase;
int numverts;
PHY_ScalarType type;
int stride;
const unsigned char *indexbase;
int indexstride;
int numfaces;
PHY_ScalarType indicestype;
m_meshInterface->getLockedReadOnlyVertexIndexBase(
&vertexbase,
numverts,
type,
stride,
&indexbase,
indexstride,
numfaces,
indicestype,
nodeSubPart);
I'm using ogre, and in desktop GL hardware buffers implementation it throws an exception while trying to lock an already locked buffer.
I also don't see where btGenerateInternalEdgeInfo unlocks the buffer.