I am working on a 2D game which includes high-speed projectiles that will impact high-speed (and potentially very quickly rotating) polygonal target objects. I have been experimenting and searching for a robust collision detection algorithm that will work for me.
If fast rotation was not a factor (i.e. 0 or slow rotation), then I can just use ray casting, which I have had general success with in the past and even with this project. However, there are a few edge cases involving fast rotation where this system can break down. For instance, check the following image:
In the above example, the projectile (black circle) is moving straight down very fast, and the target (red rectangle) is rotating approximately 180°/frame. The projectile should contact the target some time between the 0th and 1st frame, but instead will completely miss.
Most of the time this would be remedied using small discreet time steps between each frame, but due to the high speed that objects will be moving, this will create its own collision detection issues. Not to mention the computational cost. I have also experimented with a convoluted nonlinear ray-casting solution, where I (1) get the velocity vector of the projectile relative to the target, and create functions for the x and y position vs. time, (2) convert x(t) and y(t) to polar to get r(t) and θ(t), (3) add the target's rotation speed to θ(t), (4) convert back to Cartesian. This of course results in a nonlinear "ray" representing the projectile's movement within the frame. Using this "ray" to find a collision point with the target results in a system of equations that is usually analytically unsolvable, and too expensive to numerically solve. Alternatively, instead of (4), I could convert the parametric equation for of the target's line segments to polar, and then again try to solve the system of equations, but in polar this time. This system seems to be just as much of a mess, and is equally unfeasible.
Does anyone have any experience with anything like this, or any suggestions for algorithms to solve this problem? Thanks in advance!