Angular Velocity


One area of rigid bodies that comes up a lot is called angular velocity. Angular velocity refers to the speed and direction that an object is spinning. When an object is moving with some linear velocity (the kind we talked about earlier) and it also has spin , or angular velocity, the linear velocity changes as a result of the angular velocity.

Due to the heavy math needed to implement angular velocity, we're not going to go into the implementation of this subject here; however, I wanted to at least bring it up, explain what it is, and show you when you would need it. If you come to a point in a game in which you need angular velocity, there are several places you can go to learn how it is done. Appendix D, "Web Resources and Further Reading," has links to books and Web sites that will help you.

The most common place to see angular velocity (sometimes called torque ) in real life and in video games is billiards (pool). An expert in pool is concerned with controlling and manipulating the spin on the cue ball. The cue ball's spin is one of the most important parts of the game. For this reason, you cannot model the physics of pool without handling the angular velocity.

On the other hand, a game like pachinko or pinball can be modeled without angular velocity. Because the ball is heavy and metal, any spin put on it is insufficient to change its linear velocity. If angular velocity doesn't affect the path of the ball (linear velocity), then it doesn't need to be part of your simulation.

The other big area in video games where you will see a great deal of complex physics, including angular velocity, is in racing simulations and flight simulations. Modeling a racecar such that a person playing your game feels like the experience is realistic requires more physics than almost any other type of game. Many forces interact to produce the behavior of the car or plane, and you must understand and model each of them to produce the required realism .

Caution  

Employing angular velocity requires an understanding of calculus. If you plan to implement something like billiards without college-level calculus (including differential equations), you will find it difficult. Even with the calculus background, it can be challenging.

If you were designing a learning track for physics in video games, you would probably want to start with something like pinball or pachinko, move on to billiards, and finish up with a racing game. That would take you deeply into the subject where you could potentially find a niche in the industry. The games of tomorrow will require more complex physics than what is being done today, and someone has to program it.

Tip  

Macromedia has a product called Director that is a competitor to Flash. Director is more powerful than Flash for several reasons but has never achieved the same plug-in penetration that Flash has due to its large size and numerous add-ons. One aspect of Director is a free plug-in (Havok) that does physics modeling for you. You can use this plug-in to create complex interactive 3D environments in which the objects all have realistic motion and collisions.

Incidentally, the Havok plug-in for Director is a small version of a product licensed to professional game development companies who use it for physics in their commercial game releases. A partial version of this professional grade software is available for $40,000 per game title that uses it. The full version's price is too high to even mention here. This should give you an idea of the complexity of physics software in modern games. The partial version contains only rigid body dynamics. The full version has soft bodies, cloth, and so on.

In any event, this is where our exploration into game physics ends and the development of our sample game begins.




Macromedia Flash MX 2004 Game Programming
Macromedia Flash MX 2004 Game Programming (Premier Press Game Development)
ISBN: 1592000363
EAN: 2147483647
Year: 2004
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net