Game Development Reference
In-Depth Information
tion 12.3.2.) G is a physical constant of the universe, approximately equal
to 6.673 × 10 −11 N m 2 kg
−2 .
The law of universal gravitational attraction is very helpful if you want
to understand planetary motion or the tides, or just need a cheesy pick-
up line. 8 However, most simulations are confined to a fairly small region
close to Earth's surface. When we make the typical assumption that one
Cartesian axis points “down,” we are ignoring the curvature of Earth and
also locking in the direction of the force of gravity to a constant. It's also
common to ignore the slight decrease in the strength of gravity that occurs
at higher altitudes, and assume a constant value for d. Thus, if we let m 1
stand for Earth's mass, then the only variable in Equation (12.3) is m 2 ,
the mass of the object being simulated. In most video games, the force of
gravity is computed using Equation (12.4).
Video Game Gravity
f = m g .
(12.4)
In Equation (12.4), m is the mass of the object and g is a constant vector
pointing in the downward direction. Notice that the force of gravity is pro-
portional to the mass, but Newton's second law says that the acceleration
due to any force is inversely proportional to mass. Therefore, g specifies the
acceleration due to gravity for all objects in free fall. (Notice the similarity
between Equation (12.4) and Newton's second law, f = m a .)
Chapter 11 told you what the magnitude of g is in the real world, but
let's see if we can derive it from the universal law of gravitation. Earth's
mass is approximately m 1 = 5.98×10 24 kg, and its mean radius is 6,371 km:
−11 N m 2
kg 2
(5.98 × 10 24 kg)m 2
(6.371 × 10 6 m) 2
f = G m 1 m 2
d 2
=
6.673 × 10
Calculating the force of
gravity near Earth's
surface from the law of
universal gravitation
≈ (9.83 N) m 2
kg
9.83 m
s 2
m 2 .
But wait, this value is larger than the value of 9.81 quoted earlier! The
reason for the difference is that, while Earth's gravity provides a centripetal
force, its rotation creates an apparent centrifugal force, which partly coun-
teracts gravity. We calculated the magnitude of the acceleration required to
keep objects from spinning out into space in Section 11.8. At the equator,
8 Hint: make sure and work in the phrase “heavenly body” while you're at it.
Search WWH ::




Custom Search