I'm new to Box2D and I have a little anoying problem. Im trying to build a little game framework using box2d for physical simulation. There is a little problem as you can see on attached image. There is somethnig like collision offset.
Any quick suggestion?
This way Im updating world:
m_physScene->Step(dt, m_velocityIterations, m_positionIterations);
m_physScene->ClearForces();
And this way, I have created those boxes:
b2BodyDef bdef;
bdef.position.Set(posx, posy);
bdef.type = b2_dynamicBody;
m_body = m_physScene.CreateBody(&bdef);
b2PolygonShape shape;
flt32 hs = size * 0.5f;
shape.SetAsBox(hs, hs);
b2FixtureDef fd;
fd.shape = &shape;
fd.friction = 0.3f;
fd.density = 1.0f;
m_body->CreateFixture(&fd);
Any quick suggestion?
This way Im updating world:
m_physScene->Step(dt, m_velocityIterations, m_positionIterations);
m_physScene->ClearForces();
And this way, I have created those boxes:
b2BodyDef bdef;
bdef.position.Set(posx, posy);
bdef.type = b2_dynamicBody;
m_body = m_physScene.CreateBody(&bdef);
b2PolygonShape shape;
flt32 hs = size * 0.5f;
shape.SetAsBox(hs, hs);
b2FixtureDef fd;
fd.shape = &shape;
fd.friction = 0.3f;
fd.density = 1.0f;
m_body->CreateFixture(&fd);