updating aabb's of inactive objects

Post Reply
Peter Tchernev
Posts: 4
Joined: Thu Nov 15, 2007 8:25 pm

Re: Plane brushes with Bullet?

Post by Peter Tchernev »

Thanks for the quick response!
Do you have more detailed information where the time is spend? Can you reproduce it in the Bullet/Demos/BspDemo with your .bsp file?
My scenario wasn't actually a .bsp file but I posted here since the issue seems related.

I did a test on the BspDemo as is and I am getting similar numbers.
But please keep in mind that I had to turn off global optimizations ( /Og ) to get the profiler to produce sensible output.
So the numbers are probably somewhat skewed.

This is what I am getting from the profiler:

,,,,"(48.13) btDiscreteDynamicsWorld::stepSimulation"
,,,,,"(43.46) btDiscreteDynamicsWorld::internalSingleStepSimulation"
,,,,,,"(16.36) btCollisionWorld::performDiscreteCollisionDetection"
,,,,,,,"(8.41) btAxisSweep3::setAabb"
,,,,,,,"(4.21) btPolyhedralConvexShape::getAabb"
,,,,,,"(15.89) btDiscreteDynamicsWorld::updateAabbs"
,,,,,,,"(10.28) btAxisSweep3::setAabb"
,,,,,,,"(1.40) btPolyhedralConvexShape::getAabb"
,,,,,,"(8.41) btDiscreteDynamicsWorld::solveConstraints"
,,,,,,,"(7.48) btSimulationIslandManager::buildAndProcessIslands"
,,,,,,,"(0.47) btAlignedObjectArray<btTypedConstraint *>::heapSort<btSortConstraintOnIslandPredicate>"
,,,,,,"(2.34) btDiscreteDynamicsWorld::calculateSimulationIslands"
,,,,,,,"(1.87) btSimulationIslandManager::updateActivationState"
,,,,,,,"(0.47) btSimulationIslandManager::storeIslandActivationState"
,,,,,,"(0.47) btDiscreteDynamicsWorld::updateActivationState"
,,,,,"(4.21) btDiscreteDynamicsWorld::synchronizeMotionStates"

Which indicates that the majority of the frame time is spent get/set:ing the aabbs.

So the good news is I am probably not disturbing the static objects in any unorderly fashion, but the bad news is they still chew cycles.

Right now I am leaning toward subclassing btDiscreteDynamicsWorld and overloading internalStepSimulation to only update the AABBs of the objects that have moved during the frame.

If all goes well I will report back.

/Peter
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Plane brushes with Bullet?

Post by Erwin Coumans »

How many objects are there in your level?

Thanks for the feedback, we should optimize this,
Erwin
Peter Tchernev
Posts: 4
Joined: Thu Nov 15, 2007 8:25 pm

Re: Plane brushes with Bullet?

Post by Peter Tchernev »

How many objects are there in your level?
Currently just over 2700.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: updating aabb's of inactive objects

Post by Erwin Coumans »

The issue has been fixed, the aabb is only updated for active objects.

It will be available in Bullet 2.65.

Thanks for the report!
Erwin
Post Reply