Game Development Reference
In-Depth Information
The trade-off is whether things will act like they appear. In the case of the sphere
object representing a bowling ball in your game, you ' ll be quite happy. If the same
sphere were representing a box or a crate, I think you
d be a lot less happy. That
example is pretty trivial to make a point, but there are tougher problems. Before we
cover some of those, let
'
'
s talk about how collision geometry is built. You
'
ll need to
know this if you want to use a mesh editor such as Blender or 3ds Max.
Requirements of Good Collision Geometry
A collision mesh has to have a few properties to make the math in the physics SDK
efficient, or even possible. First, the mesh has to be convex. Good examples of convex
meshes are those that represent any regular solid such as a sphere, cube, or even
dodecahedron. Concave meshes, on the other hand, have valleys and holes.
The classic teapot is a good example of a concave mesh (see Figure 17.1). If I had the
actual teapot in front of me, and I had a piece of string, it would be trivial for me to
place the string on two parts of the object and observe the string cross empty space.
On a convex mesh, this can
s surface. An easier
way to remember is by using the name concave because, simply put, it has caves.
Another requirement of a collision hull is that it be manifold, a mathematical term
that describes how the triangles fit together and form edges. A manifold edge has
exactly two triangles on either side. A manifold mesh has no holes or dangling
'
t be done anywhere on the object
'
Figure 17.1
The classic teapot is concave.
 
Search WWH ::




Custom Search