Closed GoogleCodeExporter closed 8 years ago
The node size is nicely 16 bytes, which is cache friendly.
See bullet\src\BulletCollision\BroadphaseCollision\btQuantizedBvh.h
// 10 gives the potential for 1024 parts, with at most 2^21 (2097152) (minus one
// actually) triangles each (since the sign bit is reserved
#define MAX_NUM_PARTS_IN_BITS 10
Just descrease MAX_NUM_PARTS_IN_BITS, and it should work.
Hope this helps,
Erwin
Original comment by erwin.coumans
on 4 Jun 2013 at 9:50
(Alternatively, split the triangle mesh into multiple parts, each below 2
million triangles)
Original comment by erwin.coumans
on 4 Jun 2013 at 9:51
That's what I did to work around it, created several TriangleMeshes each about
1M tris. I don't think the TriangleMesh interface allows you to easily create
parts in the BVH, but I'm not very familiar with the bullet API.
However this is suboptimal for two reasons:
- I understand having them all in a single BVH is the most efficient
- the character controller gets stuck occasionally in the border between two
such static bodies
Original comment by c...@gmx.com
on 5 Jun 2013 at 9:25
Actually, with the last patch of issue 198, the char controller works fine. So
it's only about the efficiency then.
Original comment by c...@gmx.com
on 5 Jun 2013 at 3:21
[deleted comment]
The two suggestions I gave will still use a single BVH.
Did you try changing MAX_NUM_PARTS_IN_BITS to 0?
Alternatively, you can use a single btTriangleIndexVertexArray and add multiple
mesh parts using btTriangleIndexVertexArray::addIndexedMesh. Then you can
create a single btBvhTriangleMeshShape. That is what I meant in comment #2. See
Bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h
More important: you should not see any performance difference, because the
Bullet btDbvtBroadphase uses BVH acceleration structures too. In fact, it might
be even better to split the triangle mesh into smaller parts, and add each
parts as a static btCollisionObject into the world.
Original comment by erwin.coumans
on 5 Jun 2013 at 4:02
Thanks.
Please consider this bug a documentation issue then - this limit and the
workarounds weren't documented anywhere. Mentioning them in the related
classes' descriptions would be good.
Original comment by c...@gmx.com
on 6 Jun 2013 at 9:22
MAX_NUM_PARTS_IN_BITS and which headerfile will mentioned in the docs for
Bullet 2.82,
Thanks!
Erwin
Original comment by erwin.coumans
on 12 Sep 2013 at 9:49
Original issue reported on code.google.com by
c...@gmx.com
on 4 Jun 2013 at 8:19