Vectors (Spatial) - Need a little help

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)
 

Vexorian

Why no custom sig?
Reaction score
187
http://www.thehelper.net/forums/showthread.php?t=83498

its actually just an old, unfished 2d movement system, which allowed you to specify the mass of units, and apply an acceleration to them to knock them backwards - also includes an inellastic collision method, which takes into account units masses and movement velocity (along with their movement angle) to create a realistic, real-life like collision

the main purpose was to allowing larger/massier(tm) units to deal more substantial knockbacks, as well as to resist being knocked to a greater extent - an enable users to creat neat collisions between units/missiles/etc.

so basically you could consider mass being in grams, or kilos, and distances(velocities) being in m and m/s - which easily enables a realistic 9.8m/s gravitational acceleration - given WC3 distances are arbitrary, it allows you to give them some quantifiable value
1. You never use the Gravity constant.
2. In one part, you use 9.8, but you use it for friction, so everything would
actually depend on that Friction constant, you are compensating the low gravity acceleration value by using the high friction 0.7 I guess your knockback doesn't really look realistic, it just looks 'ok', it doesn't look realistic because the deacceleration probably wouldn't look too much like a real life case where the friction is 0.7, perhaps right now it is equivalent to using a very low friction.

I think, if you used the gravity acceleration for something like a projectile downfall, you would also see that 9.8 is too small.

Another thing : "(m*9.8*Friction) / m", could just do Gravity*Friction
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top