Closed Darthfett closed 12 years ago
WIP d657727 is a first pass on converting the algorithms. The game is compiling, but collision is acting strangely.
Collision is VERY strange indeed. Collision sub-issues:
In cd429a3, there is some debugging output for the new algorithm.
After removing all duplicate calls to ParabolaLineCollision, here are the results of what is happening for a player defined as a 3-sided circle, and randomly generated lines for the ground at 64px intervals:
New algorithm: http://pastebin.com/q9LEsHnw Old algorithm: http://pastebin.com/WraDgAX3
What's interesting to note is that the values are identical for detecting collisions of the ground relative to the player. However, even more interesting is the collisions of the player relative to the ground. It is clearly wrong, but I can see what is happening: Each iteration is somehow adding '30' to the x and '350' to the y of the player's position. This is exactly the values for the player's position. The ground position is at (0, 0), and this is why the issue is not seen in both sides.
This currently happens with shapes with more than just a single line, which share points.
This would effectively change the running time of the algorithm from depending on an entity's 'number of lines' to 'number of points', by forcing entities' shape structures to be a sequential list of points, rather than an unordered list of lines.
I haven't seen any use case for having entities be represented by lines which are not always connected together.