Page 1 of 1

Re: Plane brushes with Bullet?

Posted: Fri Nov 16, 2007 7:30 pm
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.


Re: Plane brushes with Bullet?

Posted: Fri Nov 16, 2007 9:16 pm
by Erwin Coumans
How many objects are there in your level?

Thanks for the feedback, we should optimize this,

Re: Plane brushes with Bullet?

Posted: Sat Nov 17, 2007 1:01 am
by Peter Tchernev
How many objects are there in your level?
Currently just over 2700.

Re: updating aabb's of inactive objects

Posted: Mon Dec 10, 2007 2:16 am
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!