Questions tagged [projectile-physics]

The motion physics of the objects sailing through the air, ranging from thrown baseballs to battleship cannonfire to falling rocks.

This tag is a subset of , and applies to the branch of classical mechanics known as Projectile Motion. It is not to be confused with , which is about the aptly named Bullet Physics engine.

A projectile is defined as an object that is given an initial velocity, with projectile motion corresponding to the resulting trajectory of its movement. This trajectory is often affected by factors such as gravity and air resistance, though it is not uncommon to ignore the latter in both study and practice. Projectile motion problems deal with determining things such as position in flight, trajectory, accuracy, and range.

Games of many genres deal with projectiles in motion, and game development often applies the physics of projectile motion in both artistic and mechanical endeavors. Most game development reference to projectile motion deals with arc trajectory. Use this tag when your question deals with normal physics of projectiles (as opposed to the more patterned bullet movements seen in many Shoot-Em-Up games, for example).

165 questions
84
votes
15 answers

How are bullets simulated in video games?

I have been playing games like MW2 recently and, as a programmer, I tend to ask myself how do they make the game so immersive. For example, how to they simulate bullet speed. When an NPC fires a bullet from his gun, does the bullet really travel…
mahen23
  • 823
  • 1
  • 7
  • 6
14
votes
5 answers

How to calculate turn heading to a missile?

I have a missile that is shot from a ship at an angle, the missile then turns towards the target in an arc with a given turn radius. How do I determine the point on the arc when I need to start turning so the missile is heading straight for the…
Tony
  • 241
  • 2
  • 4
13
votes
3 answers

Projectile Motion - Arrow

In a 2D game, I simply want to draw the trajectory of an arrow in flight. With the code below, the trajectory (the parabola) looks right, but the angle (or rotation) or the arrow isn't. float g = -9.8f; float x = (launchVelocity * time); float y =…
Martin
  • 413
  • 5
  • 10
4
votes
4 answers

Elastic Circle-Circle collision detection and response / Slime Volleyball physics

I am trying to recreate the Slime Volleyball game; however I am unsure how to go about implementing the physics of the ball movement. The game consists of a circular ball and semi circle players that hit the ball over a net and against a wall. The…
3
votes
1 answer

What formula does this projectile velocity code derive from?

//Calculate the velocity needed to throw the object to the target at specified angle. float projectile_Velocity = target_Distance / (Mathf.Sin(2 * firingAngle * Mathf.Deg2Rad) / gravity); Which formula is used to derive this projectile…
systemdebt
  • 211
  • 1
  • 5
  • 17
3
votes
1 answer

Accelerating Missile guidence

Background I'm building a simple game where two ships are launching missiles at each other in space. Stuff got complicated when the ships started moving in a frictionless environment and the missiles naturally needed to do the same…
firelynx
  • 127
  • 4
2
votes
3 answers

how to predict where a ball will land?

For a game of table tennis, the goal is that when the player hits the ball, the opponent (the computer) will move to the position where the ball will land in order to hit it back to the player. Said another way, given a ball in 3D space with an XYZ…
patrick
  • 209
  • 1
  • 9
1
vote
2 answers

How to know when a bullet has hit its destination in a game with a fixed timestep?

@James is wording my question better than I am, so I figured I'd put this here: I believe what you are asking is that you have a bullet moving in a game with a fixed timestep and that when the bullet collides with something, the time step usually…
Daniel Kaplan
  • 3,150
  • 2
  • 19
  • 31
1
vote
0 answers

Projectile initial motion to hit a target position

I'm working on a 3D game where i need to shoot a projectile (arrow) in order to hit a target position. The projectile has an origin position and a motion vector v(t) where "t" is a time unit. v(t) represents both the direction and force/speed…
Gio Iann
  • 11
  • 2
1
vote
1 answer

Projectiles in FPS games - OpenGL

I have some experience with Blender, but now I am using Xcode 9.2 and OpenGL 4.1 on MacBook Pro. I am also attending a couple of online courses on edX. I am developing (for fun and as an exercise) a very simple FPS game. I haven't handled…
Antonio_IT
  • 13
  • 2
0
votes
1 answer

Physics / drag of object falling through atomsphere

Trying to simulate an object plunging into atmosphere. It seems to work, until the velocity falls past terminal velocity... down to zero... and then back up! Something must be wrong with how I am applying drag? I've looked at the code so long,…
0
votes
0 answers

Calculate hockey puck bouncing off rubber bumper

I am very new to game development (or any type of development for that matter) and I am trying to figure out how I would calculate a hockey type puck bouncing off a rubber bumper placed at a 45 degree angle. The puck could hit the bumper at any…
Jinxy
  • 1
  • 1