Friday, April 12, 2024
HomeGame Developmentphysics - Easy methods to Lead a Goal if the projectile inherits...

physics – Easy methods to Lead a Goal if the projectile inherits the shooter’s pace?


This query is about what coordinates to shoot at on a 2D aircraft given the shooter and goal positions, their fixed velocities, and projectile pace. This has been solved many occasions however I’ve but to discover a resolution that works if the projectiles inherit the shooter’s velocity.

I discovered one publish that describes this clearly: “My downside is that when the gun strikes, the magnitude of the projectile pace would fluctuate as a operate of the angle you shoot at, as a result of it will inherit the gun’s velocity vector (fixed angle) plus its personal velocity (on the angle to goal) so to calculate the gun’s velocity magnitude I might must have already got the angle I am on the lookout for.”
From: https://www.physicsforums.com/threads/fire-projectile-to-hit-a-moving-object.561193/

The next options work when the shooter is stationary:
Extra specific resolution – https://indyandyjones.wordpress.com/2010/04/08/intercepting-a-target-with-projectile/
Extra concise resolution – https://www.gamedeveloper.com/programming/shooting-a-moving-target

However they do not work if the shooter is transferring. When capturing forwards it will overshoot the goal, and when capturing backwards it will not make it to the goal.

There are some replies to the physicsforums.com publish, of which I solely understood I want to make use of relative positions and velocities, which https://www.gamedeveloper.com/programming/shooting-a-moving-target is already utilizing.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments

Arnavsijapati on Planet of Lana – Beta Demo
Jai Kishor Upadhyay on Planet of Lana – Beta Demo