Game Development Reference
In-Depth Information
player hit the target). Although our guiding principle is always f = m a ,
the methods used to define f can vary greatly.
This section discusses three important forces that exist in the real world
and are often used in physics simulations. Gravity, friction, and springs are
the subjects of Section 12.2.1, Section 12.2.2, and Section 12.2.3, respec-
tively. Of course, a computer simulation may need to consider many more
real-world forces, such as buoyancy, drag, or lift. The goal of this topic is
to give an overview of the most important topics and not to be exhaustive;
however, sources that cover these types of forces are listed in the suggested
reading in Section 12.7.
One other extremely important force that appears in physics simulations
is the contact force, also known as a normal force. This is the force that
prevents objects from penetrating each other. When a box is resting on
a table, the force the table exerts on the box, counteracting the force of
gravity and preventing the box from accelerating downwards, is called a
contact force. Contact forces in a physics engine are inherently tied up
with the engine's method for resolving collisions and are usually handled in
a way that forms a compromise between the stability of the simulation and
physical reality. As such, the details for how contact forces are computed
can vary from one physics engine to another; indeed, resolving collisions is
a very active area of research.
12.2.1
Gravitational Force
In Principia, Newton stated all sorts of laws in addition to the three for
which he is the most famous. One such law, which he discovered through
analysis of the motions of the planets, is the law of universal gravitation,
which states that all objects in the universe feel an attractive force to
each other. This force is proportionate to the product of their masses and
inversely proportionate to the square of the distance between the objects
and can be calculated by Equation (12.3).
Law of Universal Gravitation
f = G m 1 m 2
d 2
.
(12.3)
In this equation, f is the magnitude of the force, m 1 and m 2 are the masses
of the two objects, and d is the distance between their centers of mass.
(We'll have more to say about exactly what the center of mass is in Sec-
 
Search WWH ::




Custom Search