Fulla
Evil Overlord
- Reaction score
- 31
That is definitely wrong, because the units don't match (g*t*t is in meters, but 2.82 is in meters per second). It should just be gravity * period.
You're getting a usable number out, but there's something wonky here.
Yea Mad said the same thing. However I've converted it all to per period instead of per second. It lowers the amount of calculations I need to do in the timer.
JASS:
set x = GetUnitX(dat.missile)
set y = GetUnitY(dat.missile)
set z = GetUnitZ(dat.missile)
set p = GetZ(x, y) + 1
//Move missile
call SetUnitX(dat.missile, x + dat.vx)
call SetUnitY(dat.missile, y + dat.vy)
//Adjust height
set dat.vz = dat.vz - GRAVITY * PERIOD * PERIOD
call SetUnitFlyHeight(dat.missile, z + dat.vz, 0)
//Adjust angle/facing
set aoa = R2I(Atan2BJ(dat.vz, SquareRoot(dat.vx * dat.vx + dat.vy * dat.vy))) + 90
call SetUnitAnimationByIndex(dat.missile, aoa)