Game Development Reference
In-Depth Information
'
'
Maybe you can visualize this, but I certainly can
t necessarily match a
reasonable orientation for the object for programmers and artists, such as orienting a
gun with the barrel pointed straight down one of the X-, Y-, or Z-axes. Therefore,
you
t, and it won
ll probably need to apply a transformation to get from the orientation and posi-
tion of your physics object to find the correct position and orientation for your visible
geometry.
'
Asymmetric Objects Are Great for Testing
One test object you should definitely create is a completely asymmetric object.
A good example is a cube with three corner vertices pulled or pushed around,
as long as the shape is still convex. This will help you if you think your
physical and visible coordinate systems are out of whack.
If they are, the
wireframe for the physical geometry won
t match the visible geometry. If you
integrate a new physics SDK with your game engine, and you use only balls or
cubes as test objects, there
'
'
s almost no way to tell
if your transforms are
correct. Use a crazy, convex object, and you
'
ll notice problems right away.
If the collision and visible geometry are different, and they usually are, there are a
couple of things you
'
ll want to keep in mind:
n If you can simplify the physical geometry without sacrificing too much in the
way of geometrical accuracy, go for it.
n Lean on the side of making physical geometry a little smaller than the visible
geometry for objects and static environment meshes. This will create some
graphical errors, but the objects that move won
'
t get stuck so much or appear to
hit something that isn
'
t there.
Collision Hulls for Human Characters
You might think that you
d want to represent a human character by a rag doll. If the
character is unconscious or dead and is therefore under complete control of the
physics system, that is probably okay. However, while the character is under kine-
matic control, in other words under control of the animation system, you may want
something a lot simpler, trading accuracy in the simulation for some CPU cycles. The
same thing goes for the player character as human AIs. Take a look at Figure 17.3,
which is a simple capsule shape.
This simple shape has some great advantages and just a few disadvantages. First, the
rounded hemisphere at the top keeps most objects from stacking on top of a charac-
ter. The rounded hemisphere at the bottom allows for fairly natural looking ascent or
descent of stairs and curbs. The cylinder that makes up the torso creates a convenient
'
 
 
Search WWH ::




Custom Search