Box2D 2.1.0 Released

News about Box2D
Erin Catto
Site Admin
Posts: 2948
Joined: Thu Sep 06, 2007 12:34 am

Box2D 2.1.0 Released

Postby Erin Catto » Sat Apr 03, 2010 10:30 pm

Almost two years have passed since 2.0.1 was released. Box2D has changed a lot since then. So much has changed that I don't think it is practical to put together comprehensive release notes. Please read the revised manual and look at the testbed.

Here is a high level overview of the changes in 2.1.0:
- Separated out collision from dynamics
- Full rewrite of continuous collision and resolution
- Sweep and prune replaced by a dynamic AABB tree
- Rewrote the contact callback system
- Ray casting
- New joint types
- Moved to Google project hosting
- CMake build system
- Moved manual from docbook to Word 2007
- Rewrote much of the manual

Please see these resources:
- Readme.txt
- Building.txt
- manual.html
- API docs
- TestBed
- Project site: http://www.box2d.org
- Download/SVN host: http://code.google.com/p/box2d/
- Wiki: http://www.box2d.org/wiki/

Thank you for waiting for this release. I hope you find it useful.

Some of you may be wondering what's coming next for Box2D. For that I refer you to the issues list on Google: http://code.google.com/p/box2d/issues/list

Oz1571
Posts: 7
Joined: Sat Jul 25, 2009 1:13 pm

Re: Box2D 2.1.0 Released

Postby Oz1571 » Sun Apr 04, 2010 1:20 am

Awesome news. I read through the documentation and it seems like this release improves on the few issues I had with the old version. Thanks a lot. :)

Orm
Posts: 44
Joined: Wed Nov 11, 2009 6:25 am

Re: Box2D 2.1.0 Released

Postby Orm » Wed Apr 07, 2010 3:19 pm

Badass!

*checks documentation for collision lines*

Chapter 4.4
However, you can create line segments using 2 point polygons.


T_T it's indescribably beautiful. Box2D is now complete in my book.

Erin Catto
Site Admin
Posts: 2948
Joined: Thu Sep 06, 2007 12:34 am

Re: Box2D 2.1.0 Released

Postby Erin Catto » Wed Apr 07, 2010 3:49 pm

My plan for 2.2.0 is to fix any bugs and implement edge-shape connectivity for smooth sliding.
http://code.google.com/p/box2d/issues/detail?id=107

I may also implement some support for buoyancy.

snowcrash
Posts: 58
Joined: Mon Jan 11, 2010 5:52 am

Re: Box2D 2.1.0 Released

Postby snowcrash » Thu Apr 08, 2010 5:29 am

Hi Erin,

Amazing job on 2.1! It has some features I've been desperate for (esp. kinematic bodies).

I have noticed some possible errors in the new doco though:

In the section, "Exploring the World" the following snippet:

Code: Select all

for (b2Body* b = myWorld->GetBodyList(); b; b = b->GetNext())
{
    b->WakeUp();
}

Won't actually work. It seems the b2Body class no longer has a "WakeUp" method? Which reminds me... how do I wake up a body anyway? (I stumbled across this because I think I need to wake a body)

Also, in 2.2 Creating a Ground Box, we have:

Code: Select all

b2PolygonShape groundBox;
groundBox.SetAsBox(50.0f, 10.0f);
...
groundBody->CreateFixture(&groundBox);

This also doesn't work because the CreateFixture method requires a density parameter. In my case, I did this:

Code: Select all

   // Use a fixture def to define the ground restitution and friction
   b2FixtureDef groundDef;
   groundDef.density = 0; // Ground is always infinite density
   groundDef.shape = &groundBox; // Use the box as the shape
   groundDef.friction = 1;
   groundDef.restitution = 0;

   // Add the ground shape to the ground body.
   groundBody->CreateFixture(&groundDef);


I'll let you know if I spot any other inconsistencies.

Cheers,

Jason

snowcrash
Posts: 58
Joined: Mon Jan 11, 2010 5:52 am

Re: Box2D 2.1.0 Released

Postby snowcrash » Thu Apr 08, 2010 5:33 am

hmm.. RTFC Jason (that's RTF Code)...

Code: Select all

   for (b2Body* b = box2dWorld->GetBodyList(); b; b = b->GetNext())
   {
       b->SetAwake(true);
   }


:)

snowcrash
Posts: 58
Joined: Mon Jan 11, 2010 5:52 am

Re: Box2D 2.1.0 Released

Postby snowcrash » Thu Apr 08, 2010 9:00 am

Hi Erin,

Just wanted to say.. I have been playing with the new version (2.1) now for a couple of days, and I have to say it is absolutely fantastic.

There are so many small improvements, both in the api itself, but also the structure of how objects relate to one another. Initially I found it a bit of a concern that most of my existing code broke (due to api changes), but when I understood the nature of the changes it became clear how much of an improvement they really are.

Not to forget the (seemingly) great improvement in the general "behavior" of objects as they move around the world. Obviously I am not clear on the precise nature of these changes, but whatever you did has worked brilliantly.

Oh.. and I got it compiling for Android. One of these days I'll put together a native port for Android (ie lean JNI calls with no garbage collection).

Well done again.

Orm
Posts: 44
Joined: Wed Nov 11, 2009 6:25 am

Re: Box2D 2.1.0 Released

Postby Orm » Thu Apr 08, 2010 9:12 am

Have to ask Erin, why is it that all the include paths are all relative to the compilers directories and not relative to each other? For example, in b2Shape.h

Code: Select all

#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Common/b2Math.h>
#include <Box2D/Collision/b2Collision.h>


instead of

Code: Select all

#include "../../b2BlockAllocator.h"
#include "../../b2Math.h"
#include "../b2Collision.h"
// or whatever


I only ask because I was going to compile the Box2D code directly into my engine. This makes it a bit difficult/a pain in the butt to do so. =/

EDIT: I was able to rectify the problem by putting the *.cpp sources into my project and dropping the headers into my default include directory. This was under Windows, so of course it was more complex than it needed to be.
Last edited by Orm on Thu Apr 08, 2010 9:54 am, edited 2 times in total.

Erin Catto
Site Admin
Posts: 2948
Joined: Thu Sep 06, 2007 12:34 am

Re: Box2D 2.1.0 Released

Postby Erin Catto » Thu Apr 08, 2010 9:42 am

snocrash: Thanks for the manual corrections. I may make a thread for people to post these.

Orm: I changed the include paths by request of Linux users who want to install Box2D in a shared location. It is actually quite easy to work with, just define the include path in your project settings. This can be a relative or absolute path.

Orm
Posts: 44
Joined: Wed Nov 11, 2009 6:25 am

Re: Box2D 2.1.0 Released

Postby Orm » Thu Apr 08, 2010 9:53 am

Erin Catto wrote:snocrash: Thanks for the manual corrections. I may make a thread for people to post these.

Orm: I changed the include paths by request of Linux users who want to install Box2D in a shared location. It is actually quite easy to work with, just define the include path in your project settings. This can be a relative or absolute path.


Ah, good thinking then. As a Linux fan, I thank you. :lol:

I was able to rectify the problem by putting the *.cpp sources into my project and dropping the headers into my default include directory. This was under Windows, so of course it was more complex than it needed to be.

Should be better when I get back to my Linux box.


Return to “News”



Who is online

Users browsing this forum: No registered users and 1 guest