Parabola Function

Gotham

New Member
Reaction score
7
I'm making a map where I need to move a missile like this:


I've done the actual movement part, but I need a function to calculate the height of the missile.

So I founded this function:
JASS:
function JumpParabola takes real dist, real maxdist,real curve returns real
    local real t = (dist*2)/maxdist-1
    return (-t*t+1)*(maxdist/curve)
endfunction

It calculates the height, starting from 0 and finishing in 0. But I want it to start from 155 and finish in 0, so I tought "using this function, I need to calculate a start point of the parabola, creating the missile at X dist, where the height is 155".
I'm not that good at maths, I understand trigonometrics and it's functions (sine, cosine, tangent, etc.), but I'm stuck here.

Can someone create a function or help me creating a function that calculates the dist variable knowing the height, the max distance and the curve?
(or, if you find it easier, a function that creates something that goes like that parabola function but starts at some height (155, but this number can change))

Thank you.
 

Steel

Software Engineer
Reaction score
109
I'm making a map where I need to move a missile like this:


I've done the actual movement part, but I need a function to calculate the height of the missile.

So I founded this function:
JASS:
function JumpParabola takes real dist, real maxdist,real curve returns real
    local real t = (dist*2)/maxdist-1
    return (-t*t+1)*(maxdist/curve)
endfunction

It calculates the height, starting from 0 and finishing in 0. But I want it to start from 155 and finish in 0, so I tought "using this function, I need to calculate a start point of the parabola, creating the missile at X dist, where the height is 155".
I'm not that good at maths, I understand trigonometrics and it's functions (sine, cosine, tangent, etc.), but I'm stuck here.

Can someone create a function or help me creating a function that calculates the dist variable knowing the height, the max distance and the curve?
(or, if you find it easier, a function that creates something that goes like that parabola function but starts at some height (155, but this number can change))

Thank you.

Its not that bad, since it is a parabolic curve you can cut it down the middle and they are the exact same on both sides. So think of the starting point you want as already like 30% through the entire curve. You just need to find the theoretical starting point where the trajectory passes through the point you want.

Its not too bad, I think Vexorian's Caster system has something like this build in it already. Some collision missle and I think you can specify the arc and Z starting location.
 

Gotham

New Member
Reaction score
7
CS said:
Collision Missiles are projectiles, but they don't use parabolic movement, they have collision and you can detect when the projectiles hit an unit, and you can also destroy Collision Missiles when you need to.
:(
They use a fixed arc... I think I'll do the same way (parabolic movement looks awesome but has it's limitations, like a minimum range).
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top