Game Engine Architecture

(Ben Green) #1
645

Angular:


ω ω

θ θω

() () ();

() () () ;

t Nt
I

t

tt

21 1

211

=+

=+

net
Δ

t Δ

t

t

Linear:

vv

F

r rv

() ()

()
;

() () ().

t

t
m t
tt

21

1

211

=+

=+

net
Δ

Δ

t

t t
Of course, we could apply any of the other more-accurate numerical
methods as well, such as the velocity Verlet method (I’ve omitt ed the lin-
ear case here for compactness, but compare this to the steps given in Section
12.4.4.5):



  1. Calculate θ(t t tt 1 += +t) () ()θω 11 tt+Δ^12 α(). 1 2 ΔΔ

  2. Calculate ω(t tt 1 +=+ 21 ΔΔt) ()ωα 1 12 () .t 1

  3. Determine α(t 12 += =Δt) ()αθt IN t−^1 net(,(), ()).22 2 tωt

  4. Calculate ω()( )().t 11 += + + +Δt ttωαt 21 21 tt 1 Δ ΔΔ


12.4.6. Angular Dynamics in Three Dimensions


Angular dynamics in three dimensions is a somewhat more complex topic
than its two-dimensional counterpart, although the basic concepts are of
course very similar. In the following section, I’ll give a very brief overview of
how angular dynamics works in 3D, focusing primarily on the things that are
typically confusing to someone who is new to the topic. For further informa-
tion, check out Glenn Fiedler’s series of articles on the topic, available at htt p://
gaff erongames.wordpress.com/game-physics. Another helpful resource is the
paper entitled “An Introduction to Physically Based Modeling” by David Ba-
raff of the Robotics Institute at Carnegie Mellon University, available at htt p://
www-2.cs.cmu.edu/~baraff /sigcourse/notesd1.pdf.


12.4.6.1. The Inertia Tensor


A rigid body may have a very diff erent distribution of mass about the three
coordinate axes. As such, we should expect a body to have diff erent moments
of inertia about diff erent axes. For example, a long thin rod should be relative-
ly easy to make rotate about its long axis because all the mass is concentrated
very close to the axis of rotation. Likewise, the rod should be relatively more
diffi cult to make rotate about its short axis because its mass is spread out far-
ther from the axis. This is indeed the case, and it is why a fi gure skater spins
faster when she tucks her limbs in close to her body.
In three dimensions, the rotational mass of a rigid body is represented
by a 3 × 3 matrix known as its inertia tensor. It is usually represented by the
symbol I (as before, we won’t describe how to calculate the inertia tensor here;
see [15] for details):


12.4. Rigid Body Dynamics

Free download pdf