Entries Tagged 'Programming' ↓

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.

Only 7 days to go to #wwdc

Wow! Where has the time gone. I can’t believe I am flying out to San Francisco later this week. This is my last picture of San Francisco, so enjoy the twisty bends of Lombard Street on Russian Hill.

Lombard Street

2 weeks to #wwdc

Not long to go now! Continuing on from last week’s post. Here are the Painted Ladies, famous Victorian Houses on Haight St, San Francisco.

Painted Ladies

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.

Boston Office View


Just coming to the end of my first day in the Cambridge office. Totally gobsmacked by the views of Boston. It is great meeting the people I have been working with in person. Everyone is very friendly and welcoming.

Unfortunately, the weather hasn’t been great. I was caught in a heavy thunderstorm last night. The rain hammered down for three hours with no let up. I found shelter in a nearby Abercrombie and Fitch store which became a living hell after an hour. Ended up having a Clam Chowder Bread Bowl then onto a great little bar where a pint of Bud was $1.50 so it wasn’t all bad.

I will be going to my first baseball game tomorrow night to see World Champions Boston Redsox take on the Texas Rangers. Its a hard job but somebody has got to do it :)

Saved by the bell

Recently I’ve been thinking about how productive I was at school compared to the current day. I am still amazed at the amount of different subjects I was juggling back during my GCSEs, carrying a backpack crammed with a bunch of textbooks and file blocks. Somehow I still managed to study, play computer games, play Gaelic and football for for 3 different teams and still find time for some telly (and the odd date!). Ok maybe I didn’t study as much as I should have but I still did well enough. Continue reading →

Focus focus focus

Lately I have had a lot of stuff on my mind and it is driving me slightly crazy. There are so many different things I want to do and I have so little time to share between them. So each night, I sit down and try to decide what do to that night, by the time I get round to deciding, its bed time. Whats a guy to do?!

What things I hear you cry? Well its quite a diverse list ranging from expanding my knowledge portfolio (thanks prag prog!), working on my current list of projects, fleshing out some of the ideas I have for new projects, getting myself fit, DIY work round the house, learning to play the guitar, my new hobby of amateur photography, gaming and spending quality time with the family. I am also considering touting for little bit of freelance work to supplement my craving for all things gadgety (Anyone need a part-time coder??).

Somehow I need to organise my thoughts and start to manage my time effectively. If I don’t, I will never get anything done!

Bitesize – Comments

I like to encourage programming best-practices where possible. I also would like to encourage discussion about what is good programming practice. What might seem obvious to some may be completely new to others. I also find that there is very little in the way of advice on how best to program, especially for our more inexperienced comrades. Besides, you are never to old to learn.

As such, I am going to start by offering small pieces of advice, mostly related to Java but much can be considered good practice for any programming language. You may find that you disagree with what I have to say. If so, great!! Feel free to share your opinions.

The first topic of discussion are comments. This might seem like a very trivial topic but I can assure you it is one of the most important for programmers but is sadly the most often abused. Continue reading →