| 07-09-2007, 06:54 PM | #1 |
I think ive found i nice, non memory taxing way of moving units in a arc without trigonometry and still imposing gravity and drag and such... it might not be super effective but it works, at least when i graphed it... please, check my work to see if its some dumb fantasy idea. Variables: IFv='Z' Force Fh='XY' Force IH=Initial Height Fg=Gravimetric Force Fd=Drag Force T= Time Elapsed per 'step' X= 'Steps' run Calculations Run Per Step: Fv = IH+((((IFv-Fg*X)X)-Fg*X)*T) Fh = Fh-Fd Example Function: JASS:function Move takes real height, real horforce, real vertforce, real steptime, unit u returns nothing local real IFv = vertforce local real IH = height local integer X = 0 local real T = steptime local real Fh = horforce set Fv= IH+((((IFv-Fg()*X)X)-Fg()*X)*T) //Fd() and Fg() are imaginary functions that return gravity force and drag force set Fh=Fh-Fd() call SetUnitFlyHeight(u,Fv) //Set Unit XY code, im to lazy to write it out set X=X+1 endfunction |
| 07-09-2007, 07:00 PM | #2 |
Learn to use JASS tags. Additionally, trig functions are lightning fast. Faster than an empty function call. |
| 07-09-2007, 07:02 PM | #3 |
err... i was editing the post to use JASS tags and add /remove content... and trig functions get slow when called every .01 seconds for over a few seconds |
| 07-09-2007, 07:26 PM | #4 | ||
Quote:
Quote:
// btw who cares ^^ |
| 07-09-2007, 07:48 PM | #5 |
Trig functions don't get slower. They are a very very fast lookup table. |
| 07-09-2007, 07:55 PM | #6 | |
This is a post that I did at the Hive, which was useless because the requesters wanted only GUI (meh!!) probably it can be useful for you TheSecretArts. Quote:
|
| 07-09-2007, 08:08 PM | #7 | |
Quote:
|
| 07-09-2007, 08:37 PM | #8 |
Instead of parabolic equation, just write Quadratic... and im going to condese my declaration to a quadratic, because it can be condesed... i implemented this system in my Spell Entry #9... well... it actually doesnt do quadratic math but i am unable to update it but it arcs the way it should be... but it does create nice arcs that actually work if your not looking for perfection |
