C4 Engine
C4 Engine API Documentation

class ShockwaveEffect

Defined in:  C4Effects.h
The ShockwaveEffect class represents a shockwave effect node in a world.

class ShockwaveEffect : public Effect


ShockwaveEffect(const char *textureName, float radius, float width, float speed);

textureName The name of the distortion texture to use for the effect.
radius The maximum radius to which the effect will grow in size.
width The width of the shockwave ring, the difference between the outer radius and inner radius.
speed The speed at which the shockwave radius increases, in units per millisecond.
The ShockwaveEffect class produces the effect of an expanding shockwave ring that is rendered into the distortion buffer. The shockwave begins with a radius of zero and expands at the rate specified by the speed parameter until the radius exceeds the maximum size given by the radius parameter. When the maximum radius is reached, the shockwave effect is automatically destroyed.

The texture map specified by the textureName parameter should contain a distortion pattern in the red and green channels. The shockwave effect uses the center pixel of the texture for the entire inner edge of the expanding ring, and the boundary of an inscribed circle in the texture image corresponds to the outer edge of the ring.
Base Classes
Effect A shockwave effect is a specific type of effect.