Game Development Reference
In-Depth Information
of time. To obtain the velocity and location requires the solution of the corresponding differ-
ential equations. For example, consider the relationship between the z-location of an object
and the z-component of velocity.
dz
v
=
(4.9)
z
dt
To determine the z-location at a given time, it is necessary to integrate the differential
equation shown in Equation (4.9). Integration is a way to determine the value of a variable from
its derivative. In the case of Equation (4.9), the corresponding integral equation would be the
following:
zz
−=
v t
(4.10)
0
z
symbol in Equation (4.10) is the integral symbol and the quantity z 0 is the initial value
of the z . For example, if an object was dropped from an altitude of 50 m , the initial value of z
would be z 0 = 50.
This topic won't go into the subject of integration in any detail, but it will provide you with
enough information to solve the basic equations of motion. If the initial differential equation is
relatively simple, it can be solved directly, giving what is called a closed-form solution . Closed-
form solutions can sometimes be simple algebraic equations. If the differential equations are
more complicated, however, a closed-form solution is usually not possible, and the differential
equations must be solved using other techniques, one of which we will discuss in the “Solving
Ordinary Differential Equations” section a little later in the chapter.
If the forces acting on an object are constant, a simple closed-form solution to the differ-
ential equations can usually be obtained. For example, the force due to gravity on an object can
usually be assumed to be constant (if minor changes due to changing altitude are ignored). If
gravity is the only force acting on an object, the net external force on the object in the vertical
direction is equal to the mass of the object, m , multiplied by the gravitational acceleration, g .
The
z F
=−
g
(4.11)
Since gravity force acts in the vertical, or z-, direction, the x- and y-components of force
will be zero. Recall from Chapter 3 that the gravitational acceleration on the surface of the earth
is 9.81 m/s 2 . The negative sign in Equation (4.11) indicates that the gravity force is acting in the
downward direction towards the ground. If the mass of the object is constant, the acceleration
on the object in the z-direction is also constant and is equal to the force divided by the mass of
the object.
a
=−
g
(4.12)
z
The derivative of the z-component of velocity with respect to time is equal to the z-component
of acceleration. The z-component of velocity at any given time can be found by integrating
Equation (4.4).
dv
a
=−
g
=
z
(4.13)
z
dt
v
=+
v
a dt
=−
v
gdt
=−
v
gt
(4.14)
z
z
0
z
z
0
z
0
 
Search WWH ::




Custom Search