Game Engine Architecture

(Ben Green) #1

648 12. Collision and Rigid Body Dynamics


() ()
() ().
() ()

xxxxyxzx
yyxyyyzy
zzxzyzzz

Lt I I I t
Lt I I I t
Lt I I I t

⎡ ⎤ ⎡ ⎤⎡ω ⎤
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ ⎥ ⎢=ω⎥⎢ ⎥
⎢⎣ ⎥ ⎢⎦ ⎣ ⎥⎢⎦⎣ω ⎥⎦

Because the angular velocity ω is not conserved, we do not treat it as
a primary quantity in our dynamics simulations the way we do the linear
velocity v. Instead, we treat angular momentum L as the primary quantity.
The angular velocity is a secondary quantity, determined only aft er we have
determined the value of L at each time step of the simulation.

12.4.6.4. Torque in Three Dimensions
In three dimensions, we still calculate torque as the cross product between
the radial position vector of the point of force application and the force vector
itself (N = r × F). Equation (12.8) still holds, but we always write it in terms of
the angular momentum because angular velocity is not a conserved quantity:

NI I I

L

== =()


=


()


()


()


().


t

dt
dt

d
dt

t

dt
dt

ω
α ω

12.4.6.5. Solving the Equations of Angular Motion in Three Dimensions
When solving the equations of angular motion in three dimensions, we might
be tempted to take exactly the same approach we used for linear motion and
two-dimensional angular motion. We might guess that the diff erential equa-
tions of motion should be writt en

A3D(?):


NInet
() ();

() ();

t

t

=

=




ωt

ω θt

L:


Fv

vr

net()^ ();
() (),

t mt

t

=


=





t
and using the explicit Euler method, we might guess that the approximate
solutions to these ODEs would look something like this:

A3D(?):


() ()IN() ;


() () () ;


tt
tt

211 1
21 1

=+


=+



net^

Δ


θ Δ

ω
ω

ω t
θ t t

L:


vv

F

r rv

() ()

()
;

() () ().

t

t
m t
tt

21 1

211

=+

=+

net
Δ

Δ

t

t t
However, this is not actually correct. The diff erential equations of angular mo-
tion diff er from their linear and two-dimensional angular counterparts in two
important ways:


  1. Instead of solving for the angular velocity ω, we solve for the angular
    momentum L directly. We then calculate the angular velocity vector as a
    secondary quantity using I and L. We do this because angular momen-
    tum is conserved , while angular velocity is not.

Free download pdf