Game Development Reference
In-Depth Information
Mathematics for Physics Refresher
I don
t know about you, but every time I read anything that has anything to do with
math, I somehow feel all of the intelligence leak right out of my skull. I think it has
something to do with the presentation. I hope to do better here because if you can
'
'
t
get past understanding these concepts, you ' ll be pretty lost when you get around to
debugging physics and collision code.
Meters, Feet, Cubits, or Kellicams?
What you are about to read is true (even though you might not believe it), so read it
over and over until you have no doubt:
Units of measure don
t matter in any physics calculation. All the formulas will work,
as long as you are consistent.
I
'
'
m sure you remember the unfortunate story about the Mars Lander that crashed
because two different units of measurement were used? One team used meters, and
the other team used feet. This error is frighteningly simple to make, so don
'
t laugh
too hard. It
s not just the programmers who need to agree on the units of measure
for a game project. Artists use units of measurement, too, and they can cause all
kinds of trouble by choosing the wrong ones.
A unitless measure of distance can therefore be anything you like: meters, feet,
inches, and so on. There are two other properties that can also be unitless: mass
and time. You
'
ll go out on a
limb here and suggest you use seconds for time. Whatever you use, just be consistent.
All other measurements, such as velocity and force, are derived from various combi-
nations of distance, mass, and time.
By the way, if you are wondering how I knew how to spell Kellicams (the unit of
measure used by the Klingon Empire), I did what any author would do: I searched
Google and chose the spelling that gave me the most returns.
'
ll generally use kilograms or pounds for mass, and I
'
Distance, Velocity, and Acceleration
When you need to work with objects moving through space, you
ll be interested in
their position, velocity, and acceleration. Each one of these is represented by a 3D
vector:
'
Vec3 m_Pos;
Vec3 m_Vel;
Vec3 m_Accel;
 
 
 
 
Search WWH ::




Custom Search