Changing AABB ignored by Bullet

Post Reply
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland
Contact:

Changing AABB ignored by Bullet

Post by Dragonlord »

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?
rrck
Posts: 26
Joined: Mon Sep 21, 2009 7:30 am

Re: Changing AABB ignored by Bullet

Post by rrck »

User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland
Contact:

Re: Changing AABB ignored by Bullet

Post by Dragonlord »

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.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Changing AABB ignored by Bullet

Post by Erwin Coumans »

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
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland
Contact:

Re: Changing AABB ignored by Bullet

Post by Dragonlord »

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.
Post Reply