First 3rd-Party Submission - Projectile Aiming with Gravity

Thursday, June 24 2004 @ 03:57 PM EDT

Contributed by: Mark Wegner

I've made a VSL script in the open source spirit of DevLab; it is now posted for anyone interested in the techniques and use of what I have created. It is my answer to the question of how to aim a projectile of a given initial speed and location, affected by gravity, in such a way that you can hit a stationary target.

The VSL script uses the position of the shooter, the target, the magnitude of gravity in the y direction, the speed of the projectile to compute the position relative to the shooter to apply an impulse towards such that the projectile will hit the target and the time until impact.

The test level demonstrates the success of my technique by randomly spawning balls and shooting them at a set speed of 30m/s so they will intersect the center of the torus. The next logical step for the test is to modify the iterative techniques to allow aiming at linearly moving targets, or to modify the technique to use error feedback to find theta faster.

The web version is posted here, and the source .cmo is available here.

0 comments



http://devlab.flashbangstudios.biz/article.php?story=20040624155749998