Game Development Reference
In-Depth Information
class Explosion : public ForceGenerator,
public ParticleForceGenerator
{
/**
* Tracks how long the explosion has been in operation, used
* for time-sensitive effects.
*/
real timePassed;
public:
// ... Other Explosion code as before ...
};
Convection Chimney
The final part of the explosion is another Hollywood exaggeration of a real explosion.
As well as the pressure effects from the initial explosion, the heat generated will set
up a convection current above the blast point. In most conventional weapons this
is a minor effect and isn't very noticeable. It is significant and iconic in atomic and
nuclear weapons, however; the mushroom cloud has become a potent indicator of
explosive violence. While it should be used sparingly (big mushroom clouds after a
grenade goes off look peculiar), it can be a great way to indicate a superior weapon.
Convection chimneys provide a very small amount of upward force for a long
time after the explosion. It is not enough to lift anything but the lightest objects off
the ground. Because light objects are unlikely to be around the blast point after the
concussion wave, developers typically introduce extra particles that only respond to
the convection. These particles are light enough to be carried upward.
The convection chimney has an equation similar to that of the concussion wave,
but it doesn't move outward. The linear fall-off works fine:
f b d xz /w
when d xz <w and d y < h
f a =
0
otherwise
where w is the width of the chimney, h is the maximum height of the chimney, d xz
is the distance of the object from the blast center, in the XZ plane only (because we
want the chimney to be a cylinder shape), and d y is the height of the object above the
blast point.
The force should again be applied in a line from the blast center. If we apply the
force in just the up direction, then objects will rise up the chimney and bob at the
top. If the force is angled out, the characteristic mushroom cloud shape is formed.
The peak force is calculated in the same way as for the concussion wave: it is another
moving-air phenomenon. The code to produce this effect looks like this:
Search Nedrilad ::




Custom Search