Bug) physics inconsistancy
by Greg Belote · in Torque X 2D · 04/09/2007 (5:24 pm) · 3 replies
I've come across an inconsistency regarding "bounce" collision resolution -- objects will bounce differently based on their speeds. I've setup a minimal test case that demonstrates this issue: I spawn balls and shoot them at the same angle at a random speed. The balls bounce off several block obstacles and stick to the wall. Depending on the speed, these balls end up at different locations. I Assert there is zero angular velocity to ensure collisions occur at the same angle.
Linked below is my minimal test case (C# project code and TGBX xml files) that demonstrates this issue. The file is 424k compressed. The TGBX level file is at data/levels/test.txscene
http://web.mit.edu/gbelote/public/SimpleTestCase.zip
This happens with the TorqueX beta on Windows XP Professional 64bit
Thanks,
Greg
Linked below is my minimal test case (C# project code and TGBX xml files) that demonstrates this issue. The file is 424k compressed. The TGBX level file is at data/levels/test.txscene
http://web.mit.edu/gbelote/public/SimpleTestCase.zip
This happens with the TorqueX beta on Windows XP Professional 64bit
Thanks,
Greg
#2
I think what you are seeing is the result of precision issues. As you increase the velocity of the ball, you will naturally lose precision in the fractional components of the velocity vector, and in the collision computations based on that velocity.
These precision differences can add up, and are exacerbated even more by the "second" bounce block in your test case, which, because of the way it is positioned, will expose very slight precision differences. That is, either balls will hit that block, or not.
This block is at this position:
-14.517
-30.297
If you remove this block, you'll find that when the balls stick to the outer edge, there isn't much spread in their final positions. In additional, the collision polygon of the ball, which is not a perfect circle, may influence the bounce direction at any given collision point.
So after taking a brief look at this, we decided that the spread was, as Jason says, good enough for our purposes.
04/10/2007 (10:43 am)
Hi Greg, thanks for posting the test case, it made it very easy for us to check it out.I think what you are seeing is the result of precision issues. As you increase the velocity of the ball, you will naturally lose precision in the fractional components of the velocity vector, and in the collision computations based on that velocity.
These precision differences can add up, and are exacerbated even more by the "second" bounce block in your test case, which, because of the way it is positioned, will expose very slight precision differences. That is, either balls will hit that block, or not.
This block is at this position:
If you remove this block, you'll find that when the balls stick to the outer edge, there isn't much spread in their final positions. In additional, the collision polygon of the ball, which is not a perfect circle, may influence the bounce direction at any given collision point.
So after taking a brief look at this, we decided that the spread was, as Jason says, good enough for our purposes.
#3
John, I think that's the most 'nerd' thing I've ever heard you say! lol.

04/11/2007 (8:19 am)
Quote:As you increase the velocity of the ball, you will naturally lose precision in the fractional components of the velocity vector, and in the collision computations based on that velocity.
John, I think that's the most 'nerd' thing I've ever heard you say! lol.

Torque Owner Jason Swearingen