Game Development Reference
In-Depth Information
vok is designed for commercial game engines, there is a version of it for smaller
developers.
An alternative that's considered industrial strength is PhysX, whose claim to fame
is that it was selected as the default physics system used by Unreal Engine 3 (and
newer versions of Unity). The library is available free as long as you have less
than $100,000 in yearly revenue.
For 2D physics, the most popular solution by far is the open source Box2D ( ht-
tp://box2d.org ). The core library is written in C++, but there are ports to many dif-
ferent languages, including C#, Java, and Python. It's pretty much the de facto 2D
physics engine, and many 2D physics-based games, including Angry Birds , use it.
Summary
This chapter was a lengthy overview of using physics in 2D and 3D games. Colli-
sion geometry, such as spheres and boxes, is used to simplify intersection calcula-
tions. There are many potential intersection tests, including AABB vs. AABB and
line segment vs. plane, and we looked at the implementation of many of them. Re-
member that some intersection tests, such as swept sphere, are continuous in that
they can detect intersections between frames. Finally, movement in games is most
commonly implemented through the use of linear mechanics. This means that we
must use numeric integration methods such as Euler integration to compute posi-
tion from velocity and velocity from acceleration.
Review Questions
1 . What is the difference between an axis-aligned bounding box (AABB)
and an oriented bounding box (OBB)?
2 . What plane equation is most commonly used in games? What does each
variable in said equation represent?
3 . What is a parametric equation? How can you represent a ray via a para-
metric equation?
4 . How can you efficiently determine whether or not two spheres intersect?
5 . What is the best approach to determine whether or not two 2D AABBs in-
tersect?
6 . In line segment vs. plane intersection, what does a negative t value repres-
ent?
Search WWH ::




Custom Search