Hi!
I develop with oolong for the iPhone and use bullet for the collision detection.
currently, there are three collsionGroups in the game: bullets and enemies and shields.
bullets don't collide with each other or with shields. enemies do not collide with each other, but collide with bullets and shields.
bullets and enemies are aproximated with btSphereShape, shields use btTriangleShape (they really are just triangles).
There are 35 enemies, 60 shields and between 50 and 100 bullets.
all have theyr own collisionGroups set.
collisionMask of bullets: enemies
collisionMask of shields: enemies
collisionMask of enemies: bullets | shields
in each frame, i loop over all my objects and use
ColObj->getWorldTransform().setOrigin(...)
to update the position of the colision object
then i perform a
myCollisionWrold->performDiscreteCollisionDetection();
and loop afterwards over all detected collisions.
The problem is, that i get quite bad performance. Profiling showed me, that it was the performDiscreteCollisionDetection() routine, and in particular the
updateSingleAabb()
function that uses up quite a lot of time.
Strange thing is, that the performancepenalty is more or less the same independant of whether i use bvtBroadphase, AxisSweep or SimpleBoradphase (so, it can't really be a problem of runtime complexity)
Does anyone have an idea how i could figure out what's the problem? 100 bullet + 60 shields against 35 enemy sphereShapes - even in a naive aproach this boils down to only 5600 simple tests so i don't see where the performance hit is comming from.
Thanks for the help!