|
Post by rosy on Dec 30, 2020 7:39:13 GMT -6
At John's request ... There are many ways to round a flight. A parabola is a graph of a quadratic function, so this is the first idea. I will use a sine in the examples, the graph of which is also rounded. Or I will give 2 examples ...
x, y - position, h - height, l - length (e.g. jump)
1: y = h * sin (PI / l * x)
2. I don't want to derive the final formula, but you can use the equation for the circle centered on (0,0): r ^ 2 = x ^ 2 + y ^ 2 then y^2 = r^2 - x^2
There is no programming without math, although you can invent a less mathematical way ...
|
|
|
Post by n00b on Dec 30, 2020 10:23:02 GMT -6
Awesome. I might try to implement this when I get around to rewriting my physics system in my engine.
|
|
|
Post by rosy on Dec 30, 2020 13:57:43 GMT -6
I don't know what's amazing here, I haven't tested it, but it should be OK ...
|
|
|
Post by johnno56 on Dec 30, 2020 17:50:43 GMT -6
Looks like a winner to me!
|
|
|
Post by rosy on Dec 30, 2020 18:06:51 GMT -6
By the way, I don't even know what you call an engine ...
|
|
|
Post by n00b on Dec 30, 2020 18:17:19 GMT -6
By the way, I don't even know what you call an engine ... Its just my editor and library.
|
|