Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - rogeriodec

Pages: 1 [2]
16
General / PixelPerfectTest: car simulation
« on: April 17, 2018, 06:10:12 am »
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?

Pages: 1 [2]