Monday, February 1, 2010

Upgrading the physics engine

I'm continuing to work on my lunar-lander-on-a-disc game.

This week I started updating my physics engine to match the latest version of Chipmunk. My physics library is basically a C++ translation of Chipmunk, so it's easiest to just look at the diffs in the source library and make equivalent changes to mine. I also took the opportunity to replace uses of cpHashSet with more idiomatic C++ (std::set and std::map). This reduces the amount of code in the library and makes it more type-safe.

Upgrading the library is my way of re-familiarizing myself with the code since I have a set of high-priority physics-related things to do:
  • Detect impact damage
  • Finish landing gear: absorb shock in all directions, have a proper foot, and break if stressed too hard
  • Add hydraulic entry ramps that fold down when landed
I'm also interested to examine the new constraint model to see how things are arranged. It strikes me that you might be able to unify contact constraints and joint constraints into a single set of constraints; I'd have to look at things some more to decide if that would be worthwhile though.

No comments:

Post a Comment