Game Development Reference

In-Depth Information

Velocity is updated with

p
=
˙

˙

+
¨

p

pt

Orientation is updated with

δt

2
ω

θ

ˆ

=

θ

ˆ

+

θ

ˆ

ˆ

where
ω

ˆ

is the quaternion form of the angular velocity and
t
is the duration to up-

date by.

Angular velocity is updated exactly the same as linear velocity:

θ
=
θ

+
θ t

D.5

P
HYSICS

Newton's second law of motion gives us

m
p

f

=

ma

=

where
m
is the mass and
p
is the position of an object. Or

m
−
1
f

p

¨

=

in terms of position.

Euler's equivalent for rotation is

θ

I
−
1
τ

=

where
I
is the inertia tensor and
τ
is the torque.

The force of gravity is

f

=

mg

where
g
is around 10 m/s
2

on earth, but is often replaced by 20 m/s
2

for added speed

in games.

Forces through an object's center of mass can be combined using D'Alembert's

principle:

f

=

f
i

i

Forces not through the center of mass also have a torque component:

τ

=

p
f
×

f

where
p
f
is the position of application of the force, relative to the center of mass.