Solve the launch that leads a moving target: the aim that lands the
projectile where the target will be, not where it is. targetAt(t) gives
the target's world position at flight-time t (e.g. its animated base plus
root travel). This is the reactive event the launch verb promises against a
mover ("shoot him off his galloping horse") without the model timing it.
A fixed-point iteration on the time of flight: guess t from the target's
current distance, aim at targetAt(t), take that
solve's hitTime as the next t, and repeat until it settles. It converges
when the target is slower than the projectile (each aim overshoots the last
miss by less); a target that outruns the shot never settles, so the loop is
capped at iterations and returns the closest solve found. Returns null
when the intercept is out of range at that speed (or the speed is
non-positive).
Solve the launch that leads a moving target: the aim that lands the projectile where the target will be, not where it is.
targetAt(t)gives the target's world position at flight-timet(e.g. its animated base plus root travel). This is the reactive event thelaunchverb promises against a mover ("shoot him off his galloping horse") without the model timing it.A fixed-point iteration on the time of flight: guess
tfrom the target's current distance, aim attargetAt(t), take that solve'shitTimeas the nextt, and repeat until it settles. It converges when the target is slower than the projectile (each aim overshoots the last miss by less); a target that outruns the shot never settles, so the loop is capped atiterationsand returns the closest solve found. Returnsnullwhen the intercept is out of range at that speed (or the speed is non-positive).