I'm newing up a rectangle body, applying a small impulse, and letting it fall. However, I'm noticing something weird happen.
If the x and y coordinates are not equal, the rectangle body spins like if I applied torque or angular velocity. Is there anyway to fix this?
Spin
No Spin
Thanks!
Johnny
If the x and y coordinates are not equal, the rectangle body spins like if I applied torque or angular velocity. Is there anyway to fix this?
Spin
Code:
var rectangle = new Rectangle();
rectangle.x = 200;
rectangle.y = 300;
parent.addChild(rectangle);
rectangle.b2body.ApplyImpulse(new V2(-.1, -.1), new V2(0, 0));
rectangle.x = 200;
rectangle.y = 300;
parent.addChild(rectangle);
rectangle.b2body.ApplyImpulse(new V2(-.1, -.1), new V2(0, 0));
No Spin
Code:
var rectangle = new Rectangle();
rectangle.x = 200;
rectangle.y = 200;
parent.addChild(rectangle);
rectangle.b2body.ApplyImpulse(new V2(-.1, -.1), new V2(0, 0));
rectangle.x = 200;
rectangle.y = 200;
parent.addChild(rectangle);
rectangle.b2body.ApplyImpulse(new V2(-.1, -.1), new V2(0, 0));
Thanks!
Johnny