Game Development Reference
In-Depth Information
For example, earlier we computed how long it would take for a ball
bearing dropped from a great height to hit the sidewalk below, which is
a one-dimensional problem. The corresponding three-dimensional problem
would be to try to drop the ball bearing into a bucket which is free to move
around on the sidewalk. Let's say that the bucket is off to our left. Our
initial velocity had better have some leftward component then, or else the
ball bearing won't land in the bucket. Another indication that the multi-
dimensional case is more complicated than 1D is that a direct translation
of Equation (11.17) into vector form results in nonsensical operations of
taking the square root of a vector and dividing one vector by another.
The key to solving this problem is to realize that any horizontal changes
(either to the bucket's position or the initial velocity of the ball bearing) do
not affect how long it takes the ball bearing to reach the sidewalk. This is
because the coordinates are independent from one another. The horizontal
velocity and acceleration do not interact with the vertical velocity and
acceleration. To be specific, let's switch to our standard 3D coordinate
system, which has +y pointing up and x and z in the horizontal plane. The
time it takes the ball bearing to reach the altitude of the bucket depends
only on the equations having to do with y; the x- and z-coordinates can
be ignored for this purpose. 33 In other words, calculating the time when a
projectile will reach a target is still a one-dimensional calculation—we just
need to chose which direction to use. We can apply Equation (11.17) to
solve for a time of impact t. But this solution is just a proposal. We know
that if the projectile were to hit the target, it would do so at this time. To
make sure we really did hit the target, we must plug this time of alleged
impact into Equation (11.19) to see where the projectile will be at that
location, and verify that the position of the projectile is within appropriate
tolerances.
Let's talk a bit more about exactly what it means to “chose which
direction to use,” as was stated in the previous paragraph. In cases of simple
projectile motion, such as the ball-bearing example, where gravity is the
constant acceleration, the direction to choose is obvious: use the direction
of gravity. Furthermore, because coordinate systems are chosen such that
“up” is one of the cardinal axes, the process of solving a one-dimensional
problem in that direction is a trivial matter of plucking out the appropriate
Cartesian coordinate and discarding the others. In general, however, the
situation can be more complicated. But before we discuss the details of
the general case, there are a few more things we can say about this very
important and common special situation.
33 This is all assuming ideal projectile motion, which ignores wind resistance. Of course
we can't crash into an adjacent building, or else the horizontal motion certainly would
be relevant.
Search WWH ::




Custom Search