rotaion of a falling body in box2D -
i try build tower brick game (there falling shapes sky , should make tower) when drop shapes physics doesnt work , if on top each other on corner not fall.... how can fix it?
here shape:
var fixdef = new b2fixturedef;//shape 1 fixdef.shape = new b2polygonshape; fixdef.density = 0; fixdef.friction = 0.5; fixdef.restitution = 0.5; fixdef.shape.setasarray([ new b2vec2(-1, 0), new b2vec2(0, -1), new b2vec2(1, 0)],3 ); bodydef.type = b2body.b2_dynamicbody; bodydef.position.set(24.5/30, 60/30); bodydef.userdata = new traingle(); addchild(bodydef.userdata); world.createbody(bodydef).createfixture(fixdef); and here world:
i think that's because you've set density zero. impact should zero-weight body make?
Comments
Post a Comment