Howto: Use the Bullet 3D Physics Engine in Xcode

Its been a while since I added a Howto on here. Hope you find it useful.

The Bullet 3D Physics engine is shipped with the Oolong 3D Engine for iPhone. However, if you just want to use the physics engine in your iPhone app, the following steps should help you to integrate it into your project:

  1. Download Bullet. I got it as part of the Oolong Engine source from Google Code.
  2. Open Xcode Preferences, select Source Trees and add one with Setting Name “BULLET_ROOT” and Display Name “Bullet”. Give it the full path to your Bullet folder.
  3. In your Xcode project, CTRL+Click on Classes folder and select Add Group. Give it the name “Bullet”. Then CTRL+Click the Bullet group and select Get Info. Set the Path Type combo box to  ”Relative to Bullet”. The Full Path should show the full directory path for the Bullet folder.
  4. Select Project/Edit Project Settings from the Xcode menu. Search for “header search paths” in the Build tab and add the full path to your Bullet src. Make sure to check the Recursive checkbox. You will need to do this for Debug and Release build configurations.
  5. In your source code, include the relevant bullet header e.g.

    #include "btBulletDynamicsCommon.h"

    will include everything you need for rigid body dynamics.
  6. Check out the Oolong samples to see how to use the physics engine or head over to the Bullet website for more resources.

Hopefully, I haven’t missed anything out but let me know if you spot something incorrect or can’t get it to work.

Update: 21/07/09: One step I forgot to mention was that Bullet is written in C++. You iPhone application class files will default to Objective-C and so won’t be able to compile. You need to CTRL+Click the class file referrencing the btBulletDynamicsCommon.h header file, select Get Info and change its file type to be Objective-C++. That should allow it to compile properly.

WWDC – 3 weeks to go

Apple’s Worldwide Developer Conference takes place from 8-12 June in San Francisco. I am heading over as part of a 30 strong InvestNI delegation for my first Apple conference since converting from the Dark Side last year. Its going to be pretty intense with tons of information on iPhone and Mac application development! So with the miserable, wet and cold May we are experiencing at the moment, I thought I’d cheer myself up with a nice picture of the Golden Gate Bridge:

Golden Gate Bridge.

San Francisco is probably my favourite city. This will be my 3rd trip there (last time was my honeymoon in 2006) and I can’t wait to see it again! I’ll post some more pictures over the next few weeks…

Happy New Year!!

OK I am a little late but it’s the thought that counts, right??

I am ashamed to admit that I have been neglecting the blog lately. I guess I haven’t really had very much to say of late. Nothing has changed there I hear you say! Even so,  I thought I’d give a quick round-up of the year to date…

Development

The new year has been a busy period. We have just finished the development phase of our next major release, my first since joining last year. Its been a step learning curve but we have managed OK. The next release will be a lot more involved so I am looking forward to getting going with that. It should see us through the rest of the year.

I have also lined up a few interesting side projects to keep myself off the streets at night. They are mix of web and iPhone apps using Ruby on Rails, the iPhone SDK and OpenGL ES. I am also hoping to take a look at Android development at some stage. It’s a very interesting time for independent developers. Every day seems to bring a new platform or app store announcement lately (Nokia’s Ovi Store, Palm’s App Catalog and as well as others by MS, O2 and Orange!). I guess with the amazing success of the iPhone’s App Store, it was inevitable that the other smart-phone makers would follow suit. It will be interesting to see how things shape up once the dust settles. I’m also hoping to climb out of my cave and go meet some other developers.

Gaming

It was a quiet Christmas in terms of gaming. I have been playing Uncharted: Drake’s Fortune on the PS3 when I find time. Its a 3rd person action-adventure game, similar to the Lara Croft series with a Gears of War style cover system. Its fun to play and the graphics are excellent, considering its over a year old. Overall, its fantastic value for money on the budget Platinum series.  I will definitely be picking up a copy of Uncharted 2 when it is released later this year. Also, the much anticipated Killzone 2 is due for release on the PS3 very soon. Unfortunately the Wii didn’t even get switched on over Christmas due to the dearth of quality titles. I am toying with the idea of trading it in for a DS or more PS3 games.

Football

Since I last posted, Stevie G was arrested, Rafa Benitez cracked, Arsenal have disappeared and Chelsea sacked their manager of 6 months. Meanwhile, Man Utd have went on a record breaking run of 14 clean sheets (and counting) and have stormed their way to a 5 point lead at the top of the English Premier League. They are currently English, European and World Champions, own the world’s best footballer (at least for now) and have an unprecedented quintuple in their sights. It’s a pretty good time to be a Red! I could be smug about it :-) but I really don’t expect them to do a clean sweep. Barcelona are looking really strong at the moment and must be favourites alongside Utd for the Champions League. Also, it only takes one bit of bad luck (As Utd saw against Portsmouth in the FA Cup last year) and you can be knocked out. Everyone thinks the Carling Cup is a foregone conclusion, but I expect Spurs to be really up for it against some of the younger members of Utd’s squad. It should make for an exciting run in.

And I thought I was the only one…

From the BBC Editor Blog:

I have restrained myself to such an extent that I have not uttered a single word about the new iPhone in the last 36 hours, on TV, on radio or online. So, while I’m here, wasn’t it just a little disappointing? Still no video, the camera stays at the original 2mp, and no ability to cut and paste. And isn’t the price cut proof enough that Apple misjudged the European market, and needed to kick-start sales?

I couldn’t have put it better myself.