(I've posted this question on GameDev and I've been told to ask here so I'm pasting the question)
I need to make a car jump from a ramp to another, and I need this to be done using AI so I thought it would be enough to set a fixed speed for my car when near the ramp, in order to let it jump correctly.
It works fine if I input the speed manually but I'd like my game to calculate it since the ramps will be generated by user's input.
Unfortunately my physics knowledge lacks, so I need your help.
The problem is summarized in the picture below.
Basically, what I need to compute is the speed (in m/s) that the car has to have on the highest point of the first ramp, given that all the data in red are user's input.
I had some rough ideas on using the projectile range with
x=L, y=h-launchRampHeight but the results weren't as I expected them so I gave up.
Do you have any hints on this?
Please note that both ramps have the same length (50m) and that
theta is expressed in degrees.
Based on the two replies I wrote some code and it seems to work fine but sometimes it returns a speed that's way higher than the correct one (which is not wrong but it's not the minimum one either).
For example, with
theta = 8, L = 145, h = 12 it returns 100m/s (or maybe more, but the input's limited to 100m/s so it doesnt't show anything higher) while the jump works fine with 80m/s.
Can you please help me in sorting this out?