I remember it is symmetrical in v2.0.x.
Here is a demo. The pole will not fall down in v2.0.x.
Here is a demo. The pole will not fall down in v2.0.x.
Code:
#ifndef PoleTest_H
#define PoleTest_H
class PoleTest : public Test
{
public:
PoleTest ()
{
b2Body* ground = NULL;
{
b2BodyDef bd;
ground = m_world->CreateBody(&bd);
b2EdgeShape shape;
shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f));
ground->CreateFixture(&shape, 0.0f);
}
{
b2PolygonShape polygon_shape;
polygon_shape.SetAsBox(0.2f, 10.0f, b2Vec2 (-10.0f, 10.0f), 0.0f);
b2BodyDef polygon_bd;
polygon_bd.type = b2_dynamicBody;
polygon_bd.bullet = true;
b2Body* polygon_body = m_world->CreateBody(&polygon_bd);
polygon_body->CreateFixture(&polygon_shape, 2.0f);
}
}
~PoleTest ()
{
}
static Test* Create()
{
return new PoleTest ();
}
};
#endif
#define PoleTest_H
class PoleTest : public Test
{
public:
PoleTest ()
{
b2Body* ground = NULL;
{
b2BodyDef bd;
ground = m_world->CreateBody(&bd);
b2EdgeShape shape;
shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f));
ground->CreateFixture(&shape, 0.0f);
}
{
b2PolygonShape polygon_shape;
polygon_shape.SetAsBox(0.2f, 10.0f, b2Vec2 (-10.0f, 10.0f), 0.0f);
b2BodyDef polygon_bd;
polygon_bd.type = b2_dynamicBody;
polygon_bd.bullet = true;
b2Body* polygon_body = m_world->CreateBody(&polygon_bd);
polygon_body->CreateFixture(&polygon_shape, 2.0f);
}
}
~PoleTest ()
{
}
static Test* Create()
{
return new PoleTest ();
}
};
#endif