Game Development Reference
In-Depth Information
through the wall, you may want the character's action to switch, perhaps
this collision triggers another character's action or it may cause program
navigation to switch.
The most complex collisions occur between two characters and you are
advised to read Chapter 13, which covers collisions in detail.
Application-dependent resources
There are other resources a scene may need to handle which are
application dependent. The use of physics in the real-time environment is
becoming more common. If you are using physics in a scene then the
most common use of physics is to have a value for gravity. The classic
definition of the location of a projectile under gravity is
)- 2 gt 2
x = ut cos(
y = ut sin(
where u is the launch speed in m s -1 (metres per second), t is the time in
seconds since the launch began and g is a value for gravity that is
commonly set to 9.81 m s -2 . To use this simple physics device in your
scene will involve defining a value for g in the scene and informing the
transformation engine that physics is active. When your central character
begins to fall, then gravity can kick in to take over the control. For the
effect to look realistic with the value for gravity indicated, the character's
scale must be in metres; that is, the height of a human biped must be
around 1.8 m.
Physics can be as simple as this or complex enough to include flowing
hair. If you want to include physical simulations in your code then most
developers adopt some variant on a mass-spring network. The principle
here is to regard each vertex as a point mass. That is a mass that has no
Figure 17.7 Projectile motion.
Search Nedrilad ::

Custom Search