Wwwebber's Blog

Upgrading to Box2D 2.1 (Flash)

Posted in Uncategorized by wwwebber on May 11, 2010

Box2d 2.1 offers several improvements in its use of events, its object models and added features like buoyancy, over 2.02 but you’ll find that none of your code compiles anymore.

Read this post about fixtures
Read this forum post about the new and improved contact listener
2.1 a documentation
Other changes

Version 2.02 Version 2.1
myB2body.WakeUp() myB2Body.SetAwake(true)

Gone and Not Necessarily Missed

  • myB2Body.SetMassFromShapes() //apparently done automatically
  • declaring a size of your   B2World() . Create a world with new b2World(GRAVITY_VECTOR,  doSleep ) Notice the lack of a b2aab for the world size!

New and Very Welcome

The new contactListner is vastly improved and would take a whole post in itself to explain, but it’s a very welcome improvement

I’ll add other small feature changes as I stumble upon them while working on my new kids game: RJ the Robot ( math based platform game)

Advertisements

Comments Off on Upgrading to Box2D 2.1 (Flash)

%d bloggers like this: