Another something which broke up with the update to the newest bullet version. This time it hit the height terrain code. It looks like the AABB is now suddenly cached which causes a problem if the AABB changes. Using printf I can verify that bullet queries the AABB multiple times but then stops querying it. Even more strange is that when the AABB changes during this query period bullet still fails to see the shape. If the AABB changed before the querying takes place bullet sees the shape.
Is there a way to notify bullet somehow that the AABB ( as returned by the getAabb (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) call ) of a class derived from btConcaveShape has changed?
Changing AABB ignored by Bullet
-
- Posts: 198
- Joined: Mon Sep 04, 2006 5:31 pm
- Location: Switzerland
-
- Posts: 26
- Joined: Mon Sep 21, 2009 7:30 am
-
- Posts: 198
- Joined: Mon Sep 04, 2006 5:31 pm
- Location: Switzerland
Re: Changing AABB ignored by Bullet
According to that topic it's disabled. It would though be better to add a call to btRigidBody which allows to force an AABB update in the dynamic world it has been added. This would allow some interesting dynamic collision shapes. In my engine I use already such a call system and this is usually fast since you call it only if the AABB potentially changes.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Changing AABB ignored by Bullet
The btTriangleMeshShape has a method 'recalcLocalAabb' for this purpose. We should add such method to all shapes that cache a local aabb. What collision shape are you using exactly?
Can you file another issue for this?
Thanks a lot,
Erwin
Can you file another issue for this?
Thanks a lot,
Erwin
-
- Posts: 198
- Joined: Mon Sep 04, 2006 5:31 pm
- Location: Switzerland
Re: Changing AABB ignored by Bullet
I'm subclassing the btConcaveShape as I replace the btHeightfieldTerrainShape. My engine supports terrains with holes and btHeightfieldTerrainShape can't cope with that. I stuck to the way btHeightfieldTerrainShape is written making simple the changes I needed to get it working with my system. The problem is that I can change the heightmap underneath using height modifiers. All done by the engine so the class in question would only get an update notice if a certain area changed heights and adjusts the AABB if required ( usually not required ). This though happenes after the first creation of the class hence the first AABB Bullet queries has 0 extend in Y direction ( height ) but soon after it gets the needed height.
I think a recalcAABB inside btConcaveShape would be already a good idea as this is used by quite some collision shapes according to the API doc.
I think a recalcAABB inside btConcaveShape would be already a good idea as this is used by quite some collision shapes according to the API doc.