Blend

@addtogroup libnoise @{ @addtogroup modules @{ @defgroup selectormodules Selector Mods @addtogroup selectormodules @{ Noise module that outputs a weighted blend of the output values from two source modules given the output value supplied by a control module.

@image html moduleblend.png

Unlike most other noise modules, the index value assigned to a source module determines its role in the blending operation: - Source module 0 (upper left in the diagram) outputs one of the values to blend. - Source module 1 (lower left in the diagram) outputs one of the values to blend. - Source module 2 (bottom of the diagram) is known as the <i>control module</i>. The control module determines the weight of the blending operation. Negative values weigh the blend towards the output value from the source module with an index value of 0. Positive values weigh the blend towards the output value from the source module with an index value of 1.

An application can pass the control module to the SetControlMod() method instead of the SetSourceMod() method. This may make the application code easier to read.

This noise module uses linear interpolation to perform the blending operation.

This noise module requires three source modules.

Constructors

this
this()

Constructor.

Members

Functions

GetControlMod
const(Mod) GetControlMod()

Returns the control module.

GetSourceModCount
int GetSourceModCount()
Undocumented in source. Be warned that the author may not have intended to support it.
GetValue
double GetValue(double x, double y, double z)
Undocumented in source. Be warned that the author may not have intended to support it.
SetControlMod
void SetControlMod(const(Mod)* controlMod)

Sets the control module.

Inherited Members

From Mod

~this
~this()

Destructor.

GetSourceMod
const(Mod) GetSourceMod(int index)

Returns a reference to a source module connected to this noise module.

GetSourceModCount
int GetSourceModCount()

Returns the number of source modules required by this noise module.

GetValue
double GetValue(double x, double y, double z)

Generates an output value given the coordinates of the specified input value.

SetSourceMod
void SetSourceMod(int index, const(Mod)* sourceMod)

Connects a source module to this noise module.

m_pSourceMod
const(Mod)*[] m_pSourceMod;

An array containing the pointers to each source module required by this noise module.

Meta