I am working on a car sim. The worlds consist of a lot static geometry with a 1-8 cars and some few dynamic track objects. the cars are using raycasts for wheels. Up until now I've been batching the geometry into a single btBvhTriangleMeshShape. But with the numbers of objects increasing I am moving towards geometry instancing. The question is how to get to speed with my use case?
Here are some observations using Bullet 2.77 and setForceUpdateAllAabbs(false).
bt32BitAxisSweep3 + one big btBvhTriangleMeshShape track object + car(current setup):
Code: Select all
......Profiling: internalSingleStepSimulation (total running time: 0.311 ms) ---
......0 -- updateActivationState (0.64 %) :: 0.002 ms / frame (1 calls)
......1 -- updateActions (79.42 %) :: 0.247 ms / frame (1 calls)
......2 -- integrateTransforms (0.64 %) :: 0.002 ms / frame (1 calls)
......3 -- solveConstraints (5.79 %) :: 0.018 ms / frame (1 calls)
......4 -- calculateSimulationIslands (0.64 %) :: 0.002 ms / frame (1 calls)
......5 -- performDiscreteCollisionDetection (8.68 %) :: 0.027 ms / frame (1 calls)
......6 -- predictUnconstraintMotion (0.64 %) :: 0.002 ms / frame (1 calls)
.........----------------------------------
.........Profiling: performDiscreteCollisionDetection (total running time: 0.027 ms) ---
.........0 -- dispatchAllCollisionPairs (59.26 %) :: 0.016 ms / frame (1 calls)
.........1 -- calculateOverlappingPairs (3.70 %) :: 0.001 ms / frame (1 calls)
.........2 -- updateAabbs (18.52 %) :: 0.005 ms / frame (1 calls)
Code: Select all
......Profiling: internalSingleStepSimulation (total running time: 0.725 ms) ---
......0 -- updateActivationState (0.28 %) :: 0.002 ms / frame (1 calls)
......1 -- updateActions (45.66 %) :: 0.331 ms / frame (1 calls)
......2 -- integrateTransforms (0.41 %) :: 0.003 ms / frame (1 calls)
......3 -- solveConstraints (3.59 %) :: 0.026 ms / frame (1 calls)
......4 -- calculateSimulationIslands (1.24 %) :: 0.009 ms / frame (1 calls)
......5 -- performDiscreteCollisionDetection (46.90 %) :: 0.340 ms / frame (1 calls)
......6 -- predictUnconstraintMotion (0.41 %) :: 0.003 ms / frame (1 calls)
.........----------------------------------
.........Profiling: performDiscreteCollisionDetection (total running time: 0.340 ms) ---
.........0 -- dispatchAllCollisionPairs (6.76 %) :: 0.023 ms / frame (1 calls)
.........1 -- calculateOverlappingPairs (0.59 %) :: 0.002 ms / frame (1 calls)
.........2 -- updateAabbs (90.88 %) :: 0.309 ms / frame (1 calls)
Code: Select all
......Profiling: internalSingleStepSimulation (total running time: 1.972 ms) ---
......0 -- updateActivationState (0.10 %) :: 0.002 ms / frame (1 calls)
......1 -- updateActions (93.31 %) :: 1.840 ms / frame (1 calls)
......2 -- integrateTransforms (0.10 %) :: 0.002 ms / frame (1 calls)
......3 -- solveConstraints (1.42 %) :: 0.028 ms / frame (1 calls)
......4 -- calculateSimulationIslands (0.10 %) :: 0.002 ms / frame (1 calls)
......5 -- performDiscreteCollisionDetection (4.21 %) :: 0.083 ms / frame (1 calls)
......6 -- predictUnconstraintMotion (0.15 %) :: 0.003 ms / frame (1 calls)
.........----------------------------------
.........Profiling: performDiscreteCollisionDetection (total running time: 0.083 ms) ---
.........0 -- dispatchAllCollisionPairs (80.72 %) :: 0.067 ms / frame (1 calls)
.........1 -- calculateOverlappingPairs (2.41 %) :: 0.002 ms / frame (1 calls)
.........2 -- updateAabbs (10.84 %) :: 0.009 ms / frame (1 calls)
The btCompoundShape looks really great for the broadphase but it falls behind due to raycasts iterating over the child objects. Has anyone been working on this lately? Would it make sense to get rid of the wheel rays altogether, replace them with btGhostObject?
Thanks.