Game Development Reference

In-Depth Information

directions will become initial velocities in each direction, and they will be included in

the equations of motion once they've been integrated. The initial velocities will show

up in the velocity and displacement equations just like they did in the example in

Chapter 2
. You'll see this in the following sections.

X Components

The first step is to make the appropriate substitutions for the force terms in the equation

of motion, and then integrate to find an equation for velocity.

-F
wx
- F
dx
= m(dv
x
/dt)

-(C
w
v
w
cos γ) - C
d
v
x
= m dv
x
/dt

dt = m dv
x
/ [-(C
w
v
w
cos γ) - C
d
v
x
]

∫
(0 to t)
dt = ∫
(vx1 to vx2)
-m / [(C
w
v
w
cos γ) + C
d
v
x
] dv
x

t = -(m/C
d
) ln((C
w
v
w
cos γ) + C
d
v
x
)|
(vx1 to vx2)

t = -(m/C
d
) ln((C
w
v
w
cos γ) + C
d
v
x2
) + (m/C
d
) ln((C
w
v
w
cos γ)

+ C
d
v
x1
)

(C
d
/m) t = ln[((C
w
v
w
cos γ) + C
d
v
x1
) / ((C
w
v
w
cos γ) + C
d
v
x2
)]

e
(C
d
/m) t
= e
ln[((C
w
v
w
cos γ) + Cd v
x1
) / ((Cw vw cos γ) + C
d
v
x2
)]

e
(Cd/m) t
= ((C
w
v
w
cos γ) + C
d
v
x1
) / ((C
w
v
w
cos γ) + C
d
v
x2
)

((C
w
v
w
cos γ) + C
d
v
x2
) = ((C
w
v
w
cos γ) + C
d
v
x1
) e
-(C
d
/m) t

v
x2
= (1/C
d
) [ e
(-C
d
/m) t
(c
w
v
w
cos γ + C
d
v
x1
) - (C
w
v
w
cos γ)]

To get an equation for displacement as a function of time, you need to recall the equation

v dt
=
ds
, make the substitution for
v
(using the preceding equation) and then integrate

one more time.

v
x2
dt = ds
x

(1/C
d
) [e
(-C
d
/m) t
(c
w
v
w
cos γ + C
d
v
x1
) - (c
w
v
w
cos γ)] dt = ds
x

∫
(0 to t)
(1/C
d
) [e
(-C
d
/m) t
(c
w
v
w
cos γ + C
d
v
x1
) - (c
w
v
w
cos γ)] dt

=

= ∫
(sx1 to sx2)
ds
x

s
x2
= [(m/C
d
) e
(-C
d
/m) t
(-(C
w
v
w
cos γ) / C
d
- v
x1
) - ((C
w
v
w
cos

γ) / C
d
) t] -

[(m/C
d
) (-(C
w
v
w
cos γ) / C
d
- v
x1
)] + s
x1

Yes, these equations are ugly. Just imagine if we hadn't made the simplifying assumption

that drag is proportional to speed and not speed squared! You would have ended up

with some really nice equations with an
arctan
term or two thrown in.