Hi, I create 2 boxes with following code:
Code:
var myShape:PolygonShape= new b2PolygonShape();
var torsoB:b2Body;
myShape.SetAsBox(10/RATIO, 10/RATIO);
b2Def.fixture.shape = myShape;
b2Def.fixture.density=1;
b2Def.fixture.friction = 0.5;
b2Def.fixture.restitution = 0;
myBodyDef=new b2BodyDef();
myBodyDef.type = b2Body.b2_dynamicBody;
myBodyDef.position.v2 = new V2(my.x/RATIO,(my.y-250)/RATIO);
//myBodyDef.fixedRotation=true;
//b2Def.body.position.v2 = new V2(roda1.GetPosition().x,roda1.GetPosition().y-15/RATIO);
torsoB = myWorld.CreateBody(myBodyDef);
torsoB.CreateFixture(b2Def.fixture);
myShape.SetAsBox(10/RATIO, 10/RATIO);
b2Def.fixture.shape = myShape;
b2Def.fixture.density = 0.1;
b2Def.fixture.friction = 0.5;
b2Def.fixture.restitution = 0;
myBodyDef=new b2BodyDef();
myBodyDef.type = b2Body.b2_dynamicBody;
myBodyDef.position.v2 = new V2((my.x+50)/RATIO,(my.y-250)/RATIO);
//myBodyDef.fixedRotation=true;
//b2Def.body.position.v2 = new V2(roda1.GetPosition().x,roda1.GetPosition().y-15/RATIO);
var torsoBB:b2Body;
torsoBB = myWorld.CreateBody(myBodyDef);
torsoBB.CreateFixture(b2Def.fixture);
Though they have same size and different density, they fall to the ground with the same speed, so at the same time. Only force acts onto them is gravity. Why? Shouldn't the one with the more density reach the ground first ?