1
General / Re: Slow startup
« on: November 17, 2012, 04:52:51 pm »
maybe as you said, your initial frame time is too large. You may change your collision code to check if the ball pass the bat instead of colliding.
For example if previously the ball is on top of the bat, and in the next frame the ball is below the bat a possible collision might have occurred. (Another check is necessary to determine if this is a false positive)
Next you can then resolve the a 2D line intersection equation to check the exact location of collision with the bat. The first line is from the current ball position to the next ball position. The second line would be your bat.
If an intersection occur, then it means a collision has occur.
Using this method, the collision is not so dependent on the time step being small.
Not sure if this helps
For example if previously the ball is on top of the bat, and in the next frame the ball is below the bat a possible collision might have occurred. (Another check is necessary to determine if this is a false positive)
Next you can then resolve the a 2D line intersection equation to check the exact location of collision with the bat. The first line is from the current ball position to the next ball position. The second line would be your bat.
If an intersection occur, then it means a collision has occur.
Using this method, the collision is not so dependent on the time step being small.
Not sure if this helps