• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Projectile Height

Status
Not open for further replies.
Level 24
Joined
Feb 9, 2009
Messages
1,787
Whats a good formula for projectile height modification?
Ex:
>Missile gaining height to hit a flying enemy from the flying height of a footman?
Just smooth ascent or descent based on the distance, or dynamic distance in case the unit travels.

Peace, Love and Understanding, thank you!
 
Level 39
Joined
Feb 27, 2007
Messages
5,037
If you don’t care about it being parabolic:

Hdiff = tgtFlyHeight - srcFlyHeight
Ddiff = distance between tgt and src
Dremain = distance between tgt and missile

H = srcFlyHeight + Hdiff*Dremain/Ddiff

Instead of checking against current src location you can set the launch location once and re-use it. It’s still possible the missile appears to go down during this if the tgt moves very quickly away from the missile faster than the missile moves in the xy plane.
 
Status
Not open for further replies.
Top