Tag Archives: Physics

Optimizations and Physics

I’ve been doing a lot of optimizations recently, including tracking down a few memory leaks and increasing VertexBuffer performance. To put it numerically, I was only able to simulate ~64 physics cubes on the iPhone pre-optimization, but now I can have close to 300 active cubes and still maintain a solid frame rate. At one point the bottleneck was actually my rendering code, but I fixed the issue and now Bullet’s speed is the limiting factor. The Simulator still out performs the device a bit in this case, but that’s to be expected.

With the scene chugging along quite well, I decided to add accelerometer input to the mix. I’m using the accelerometer to set the gravity vector for the scene, so flipping the phone will flip the gravity. The only issue so far is that Bullet will not “wake up” sleeping physics objects when the gravity vector changes, so only active objects are affected by the accelerometer. It’s still pretty cool, so I decided to put up a video:


I’ve also uploaded a few videos from the Simulator showing the progress of the physics performance:

http://vimeo.com/27829407 – Poor performance

http://vimeo.com/27872952 – First pass at optimization

http://vimeo.com/27921243 – Fixed the rendering bug. 😉

Also, on another note I’ve decided to drop the “OpenGL ES Adventure” from my engine posts. It’s no longer just a rendering engine project, so I don’t think it’s suitable anymore. I still haven’t decided on a name for it yet, but when I do that’ll probably start popping up in the post titles instead.


%d bloggers like this: