Closed GoogleCodeExporter closed 9 years ago
Please post flash issues here: http://sourceforge.net/projects/box2dflash/
Original comment by erinca...@gmail.com
on 28 Feb 2010 at 6:32
No, this is really an issue with the C++.
Try the following in the CharacterCollision TestBed.
// Square character
{
b2BodyDef bd;
bd.position.Set(-3.0f, 5.0f);
bd.type = b2_dynamicBody;
bd.allowSleep = false;
b2Body* body = m_world->CreateBody(&bd);
b2PolygonShape shape;
shape.SetAsBox(0.5f, 0.5f, b2Vec2(0.5f, 0.5f), 0.0f);
b2FixtureDef fd;
fd.shape = &shape;
fd.density = 20.0f;
body->CreateFixture(&fd);
body->ResetMassData();
b2MassData md;
body->GetMassData(&md);
body->SetMassData(&md);
}
Problem disappears if you remove the 3 lines at the end. The problem is that
there is
a conversion from I about origin to I about center, contrary to what the
documentation says. I'd recommend making two mass data types, with conversions
between them, for each way of storing I - let the type system do the work of
ensuring
I is consistent.
Original comment by sadwanm...@gmail.com
on 28 Feb 2010 at 10:19
Original comment by erinca...@gmail.com
on 4 Mar 2010 at 6:02
Fixed. b2MassData.I is always about the local origin. b2BodyGetInertia returns
I about
the local origin. The only place I is stored about the center is in the body.
Original comment by erinca...@gmail.com
on 8 Mar 2010 at 1:15
Original issue reported on code.google.com by
evaldas...@gmail.com
on 27 Feb 2010 at 9:11