The problem: A player entity wishes to throw a ball from a known position with a known initial velocity. The surrounding environment contains physical objects that can alter the trajectory of the ball. How can this trajectory be as accurately as possible be rendered?
One solution: perform small steps and simulate throwing the ball. During each small step, a raycast is performed against the world to find potential colliding bodies. In case a collision is reported, it must be handled accordingly. The intermediate positions of the ball will then be saved in an array and the trajectory should be described by the succession of these points.
While this solution works (it is tested and doesn't fail almost never :) ), are there any workarounds or possible optimizations that can be done to avoid performing the raycast queries too often? It would be nice if there were such a thing as a parabolic caster instead of a linear ray caster. Do you know of any existing solution that is better of the one I just described (that either avoids those many raycasts or performs a more clever kind of query to reduce the number of intermediate steps and replace the actual line segments with parabola segments)?