Hello, colleagues!
I'm not long ago began to use box2d and had to face with the strange behavior.
My physic body is composed of a square, circle and joint.
I'm trying to move body, set him angular velocity.
Then, after a certain number of ticks, I set angular velocity to 0
but body continues to move for some time
move end x:14.543830584751184 y:4.377520613939759
x:14.543830584751184 y:4.377520613939759
x:14.618724863714549 y:4.329811074307625
x:14.651468509634544 y:4.308911111115183
x:14.651435642383928 y:4.308859421664197
x:14.651405666799585 y:4.308812279859859
x:14.651378328472227 y:4.308769285599449
x:14.651353395375539 y:4.308730073981348
x:14.651330655896919 y:4.308694312208046
x:14.651309917041477 y:4.308661696761613
x:14.651291002794048 y:4.30863195082768
x:14.651273752625311 y:4.30860482194605
x:14.651258020129339 y:4.308580079868018
x:14.651243671781026 y:4.3085575146021995
Question:
What should I do than body becomes completely immobile after end of motion?
Code here
Compiled swf here
I'm not long ago began to use box2d and had to face with the strange behavior.
My physic body is composed of a square, circle and joint.
I'm trying to move body, set him angular velocity.
Code:
circleBody.SetAngularVelocity(10);
Then, after a certain number of ticks, I set angular velocity to 0
Code:
if(inMove) {
moveTicks++;
if(moveTicks > 5) {
circleBody.SetAngularVelocity(0);
inMove = false;
}
}
moveTicks++;
if(moveTicks > 5) {
circleBody.SetAngularVelocity(0);
inMove = false;
}
}
but body continues to move for some time
move end x:14.543830584751184 y:4.377520613939759
x:14.543830584751184 y:4.377520613939759
x:14.618724863714549 y:4.329811074307625
x:14.651468509634544 y:4.308911111115183
x:14.651435642383928 y:4.308859421664197
x:14.651405666799585 y:4.308812279859859
x:14.651378328472227 y:4.308769285599449
x:14.651353395375539 y:4.308730073981348
x:14.651330655896919 y:4.308694312208046
x:14.651309917041477 y:4.308661696761613
x:14.651291002794048 y:4.30863195082768
x:14.651273752625311 y:4.30860482194605
x:14.651258020129339 y:4.308580079868018
x:14.651243671781026 y:4.3085575146021995
Question:
What should I do than body becomes completely immobile after end of motion?
Code here
Compiled swf here