14 years
edited 8 years
Parabolic function simplified by Spec
I left this function because it allows to understand the formula coefficients...
This function takes as a parameters the distance that the parabolic movement should move (d) and the maximum height the projectile will flight (h).
So x is a value between 0 and d, and the function will return the height for that value.
As a side note, if x < 0 or x > d then this function will return negative values.
Here's a picture for a better understanding of the parameters:
Parabolic movement now taking into account initial and final Z heights.

Notes:
I left this function because it allows to understand the formula coefficients...
This function takes as a parameters the distance that the parabolic movement should move (d) and the maximum height the projectile will flight (h).
So x is a value between 0 and d, and the function will return the height for that value.
As a side note, if x < 0 or x > d then this function will return negative values.
Here's a picture for a better understanding of the parameters:
Parabolic movement now taking into account initial and final Z heights.
Notes:
- This function will return the absolute height and therefore this value should be the height you must set to the unit in the function SetUnitFlyHeight()-y0.
- In order to obtain a proper parabolic shape, "h" must be greater or equal than the maximum value of "y0" and "y1", but anyways, you're free to play with lower values of "h". "h" is the height when x = d/2 but it's not necessarily the maximum height it will reach, the maximum height will be reached when x = -B/2A.
