Game Development Reference
In-Depth Information
Implosion
When the explosion first occurs, the heat in the explosion consumes the oxygen in a
ball around the explosion point and can ionize the air (this is what causes the flash).
A sudden, dramatic drop in pressure results, and nearby air rushes into the gap. This
is the implosion stage, and it is the same process that occurs in a lightning strike.
There is a military technology called “thermobaric weapons” that does its dam-
age in this way, using very high temperatures to cause a huge pressure change and
a powerful compression wave (see the next section) that can destroy buildings and
devastate life.
In a real explosion of modest size this effect is barely noticeable, and can even
be completely lost in the concussion phase. For games and movies, however, it looks
good and gives the explosion an added sense of power. A longer concussion, particu-
larly when associated with a geometry-stretching graphical effect, can add tension to
the explosion and even suggest some kind of alien technology.
Theimplosionstageoftheforcegeneratorappliesaforcetoallobjectswithin
some threshold radius, in the direction of the point of explosion. We'll put all three
stages of the explosion into one force generator. So far it looks like this:
Excerpt from src/demos/fracture/fracture.cpp
/**
* A force generator showing a three-component explosion effect.
* This force generator is intended to represent a single
* explosion effect for multiple rigid bodies. The force generator
* can also act as a particle force generator.
*/
class Explosion : public ForceGenerator,
public ParticleForceGenerator
{
/**
* Tracks how long the explosion has been in operation, used
* for time-sensitive effects.
*/
real timePassed;
public:
// Properties of the explosion: these are public because
// there are so many and providing a suitable constructor
// would be cumbersome.
/**
* The location of the detonation of the weapon.
*/
Vector3 detonation;
Search Nedrilad ::




Custom Search