C4 Engine
C4 Engine API Documentation

class FlashController

Defined in:  C4Controller.h
The FlashController class manages a light that flashes momentarily.
Definition

class FlashController final : public Controller

Member Functions
FlashController::GetFlashFlags Returns the flash flags.
FlashController::SetFlashFlags Sets the flash flags.
Constructor

FlashController(const ColorRGB& color, float start, int32 duration);

Parameters
color The brightest color that the light will attain.
start The starting intensity of the light (in the range 0.0 to 1.0).
duration The duration of the flash, in milliseconds.
Description
The FlashController class is assigned to a Light node to make it flash brightly and then return to a darkened state. The color specified by the color parameter represents the brightest color that will be attained by the light. The value of the start parameter represents the fraction of this brightest color at which the flash effect starts. The flash effect increases in intensity from the starting value to 100% brightness and then decreases to an intensity of zero.

A flash controller created with the above constructor is initially in the awake state and starts running immediately. A flash controller created this way is also in the nonpersistent state, meaning that it deletes its target node when the intensity reaches zero. The controller can be made persistent by calling the FlashController::SetFlashFlags function.

A flash controller created in the World Editor is initially in the sleeping state, and it is persistent. The flash effect starts running when the controller is awakened.

A flash controller is capable of driving a ShaderParameterController attached to another node. The alpha channel of the flash controller's output contains the current brightness factor of the flash effect.
Base Classes
Controller A FlashController is a specific type of controller.
See Also

StrobeController

FlickerController

ShaderParameterController