cocos2d-1.0.1-X-0.10.0 Box2D Version

cocos2d-1.0.1-X-0.10.0 Box2D Version
0.0 0


Minor correction to the home page here, it says:

Primary feathers (should be features)


•upgrade Box2d to 2.2.1

The code says it is 2.2.2 (see Box2d\Common\b2Settings.cpp

I had already merged in version 2.2.1 and noticed some small changes.



Thank you.
We should check it.

#ifdef SHP
b2Version b2_version = {2, 2, 1};

// Memory allocators. Modify these to use your own allocator.
void* b2Alloc(int32 size)
    return malloc(size);

void b2Free(void* mem)

I check the file, it is actually 2.2.1 version. Where did you get the version ‘2.2.2’?


Sorry, you are correct, I just checked the file I downloaded and it is 2.2.1. I must have been looking at another directory tree when I noticed the difference.


I couldn’t work with this new Box2D version.
I’ve receiving error in HelloWorld.


Box2D 2.2.1 change some their APIs. You must upgrade your source, or re-create HelloWorld from new templates / wizard of v0.10.


I installed the new cocos2d-x version in an mac and the Box2D HelloWorld is ok.
I took this Box2D HelloWorld for iphone code in an android project, and I received Box2D errors.

Cocos2d-1.0.1-X-0.10.0 for iphone is using Box2D 2.2.1?


Hello, on my project I updated this line: world = new b2World(gravity);
and add a new line to allowSleeping: world~~>SetAllowSleeping;
Other change is to define world box, now you should define a b2EdgeShape similar to:
b2EdgeShape groundBox;
groundBox.Set/PTM_RATIO), b2Vec2/PTM_RATIO));
bottom = world~~>CreateBody(&groundBodyDef);
bottom->CreateFixture(&groundBox, 0);


All platforms use the same version of Box2D.