4-The_Partical_physics_engine

Ballistics

One of the most common applications of physics simulation in games is to model ballistics. This has been the case for two decades, predating the current vogue for physics engines.Regardless of the object being fired, we will call this a “projectile.”

SETTING PROJECTILE PROPERTIES

Instead, if we want the projectile’s motion to be visible, we use muzzle velocities that are in the region of 5 to 25 m/s for a human-scale game.(实际游戏的发射体速度比真是子弹的速度要小的多)。This causes two consequences that we have to cope with.

  • First, the mass of the particle should be larger than in real life, especially if you are working with the full physics engine.The effect that a projectile has when it impacts depends on both its mass and its velocity: if we drop the velocity, we should increase the mass to compensate. The equation that links energy, mass, and speed is

\[e = ms^2 \]

where \(e\) is the energy and \(s\) is the speed of the projectile (this equation doesn’t work with vectors, so we can’t use velocity). If we want to keep the same energy, we can work out the change in mass for a known change in speed:

\[\Delta m = (\Delta s)^2 \]

  • Second, we have to decrease the gravity on projectiles.Since we’ve slowed velocity down, gravity will have to slowed download.For a known change in speed we can work out a “realistic” gravity value using the formula:

\[g_{bullet} = \frac{1}{\Delta s}g_{normal} \]

posted on 2024-03-12 15:13  Ultraman_X  阅读(20)  评论(0编辑  收藏  举报

导航