Game Development Reference
In-Depth Information
'
One final note on the properties of restitution and friction: You
d better have a phys-
ics SDK that can assign these materials to specific triangles of a mesh. While this isn ' t
that critical for dynamic objects, it is surely needed for your environment mesh, or
you might have to decide to make your entire world out of plastic!
The next material property is density, a measure of an object
s mass per unit of vol-
ume. This is typically represented by a floating-point number, with 1.0 representing
the density of pure water. This value is usually called specific gravity. These figures
can easily be saved in an XML file, allowing your game objects to be described with
something other than a number:
'
<DensityTable>
<!-- specific gravity -->
<air>0.0013</air>
<water>1.000</water>
<!-- Synthetics -->
<styrofoam>0.0100</styrofoam>
<!-- Woods -->
<balsa>0.0170</balsa>
<bamboo>0.3500</bamboo>
<pine>0.5000</pine>
<!-- Biologic -->
<blood>1.060</blood>
<bone>1.800</bone>
<!-- Metals and Stone -->
<silicon>2.400</silicon>
<aluminum>2.650</aluminum>
<!-- Many more can follow! -->
</DensityTable>
Collision Hulls
Your physics objects will require representations in the physical world, and these
might be very different from their visible geometry. For example, a perfect sphere is
a mathematical construct in a physical world and has only a location and a radius,
whereas a visible representation might need quite a few polygons to look good. You
should use mathematical representations in the physical world where and when you
can, and you
'
ll save memory and CPU time.
 
 
Search WWH ::




Custom Search