Game Development Reference
In-Depth Information
Byessentiallyusingboththeaveragevelocityandaverageaccelerationswhenper-
forming the integrations, the velocity Verlet method ends up with a much greater
accuracy than both Euler methods. And the computational expense, although cer-
tainly greater than the Euler approaches, still is not that steep.
Other Integration Methods
A number of other integration methods might be used in a game, though they
are a bit more complex. Perhaps one of the most popular advanced methods is
the fourth-order Runge-Kutta method. The way this essentially works is by using
Taylor approximation in order to approximate a solution to the differential equa-
tions representing the movement. This method is inarguably more accurate than
both Euler and velocity Verlet, but it's also slower. It might make sense for a game
where very accurate integration is required (such as for car physics), but for most
games it's probably overkill.
Angular Mechanics
Angular mechanics is rotational physics. For example, you might need this type
of physics when you have an object tied to a string and rotating around another ob-
ject. Just as linear mechanics has mass, force, acceleration, velocity, and position,
angularmechanicshasmomentofinertia,torque,angularacceleration, angularve-
locity, and the angular position (or angle). The equations for angular mechanics
are a little bit more complex than linear mechanics, but not by much. As with lin-
ear mechanics, you will also have to numerically integrate if you want to simulate
angular mechanics in your game. Some types of games that have movement, such
as a billiards game, absolutely need angular mechanics to function properly. But
this is not as prevalent as games that rely on linear mechanics, so I choose not to
cover this topic in greater detail.
Physics Middleware
Recall from Chapter 1 that middleware is a code library that implements a solution
to a common problem. Because of the level of complexity of physics and how vast
the problem is, it is extremely common for game companies to utilize a middle-
ware package for physics in lieu of implementing it themselves.
The most popular commercial physics middleware for 3D games without question
is Havok Physics. If you go through a list of the top AAA games from the last 10
years, you'll find that a staggering number of them utilize Havok. Although Ha-
Search WWH ::




Custom Search