I am creating a 2d car simulation in c ++ and found it fantastic to detect irregular areas of collision using PixelPerfectTest.
But I would like as I could "advance" this collision.
For example: a car is walking at 80 km / h and there is a barrier in front of it, say, 40 meters away. At this speed, using the full brake, the car will still travel 32 meters ahead.
In the PixelPerfectTest solution, collision is only detected when the car literally bumps into the barrier.
Thinking about it, I created an artificial barrier in front of the car's png image, to force an early collision:
But this is not enough, because in practice, the faster the car is, the more ahead the driver has to pay attention. In this way the artificial barrier in front of the image should be "flexible".
To avoid freakish solutions, I ask: is there any way to pass some parameter to PixelPerfectTest for it to "advance" the collision?