Hello. I'm new to the forum.
[spelling edited here]
I'm going to start the story....
I'm building a simple 2D OpenGL Game Engine to the college dissertation.
A part of this Engine is an integration with an Physics Lib/Engine. Steps:
- I have built a class that holds and initialize the b2World:
Code:
b2Vec2 gravity(0.0f, 10.0f);
world = new b2World(gravity);
world->SetAllowSleeping(true);
- This class have a method to simple create box fixture
Code:
//METHOD LOCAL SCOPE
b2PolygonShape pShape;
pShape.SetAsBox(newSize.X, newSize.Y);
b2FixtureDef fDef;
fDef.shape = &pShape;
//method param friction
fDef.friction = friction;
//method param density
fDef.density = density;
//this pointer is saved on a list after the method finishes
b2Fixture *pFix = bodyComp->body->CreateFixture(&fDef);
- I have simple compiled Box2D 2.2.1 as static library with Eclipse Indigo (CDT -> GNU GCC) on MacOSX Leopard 10.5 [<- its Leopard not Lion that makes all difference].
And then compiled the engine and test app projects (Success).
- The engine test application is very simple:
A Rocket as body with type 'b2_dynamicBody' and box shape on fixture
and 2 more bodies with 'b2_staticBody' body type.
One fixture per body.
- The engine is cross and then compiled on windows (Eclipse Indigo -> MinGW).
And there no problems at all. Only MacOSX Lion problems related.
- The problem is occurring during the execution process:
Assertion failed: (s_initialized == true), function Destroy, file ../Box2D/Dynamics/Contacts/b2Contact.cpp, line 103.
When the rocket collides with static bodies everything is ok and work. But when he leaves the collision the problem reaches.
This means that b2Contact wasn't initialized or 's_initialized' flag !? And then don't know why it occurs only on Mac.
It looks a simple problem, maybe a mistake.
Any light ?
Thanks everything.