Select

Noise module that outputs the value selected from one of two source modules chosen by the output value from a control module.

@image html moduleselect.png

Unlike most other noise modules, the index value assigned to a source module determines its role in the selection operation: - Source module 0 (upper left in the diagram) outputs a value. - Source module 1 (lower left in the diagram) outputs a value. - Source module 2 (bottom of the diagram) is known as the <i>control module</i>. The control module determines the value to select. If the output value from the control module is within a range of values known as the <i>selection range</i>, this noise module outputs the value from the source module with an index value of 1. Otherwise, this noise module outputs the value from the source module with an index value of 0.

To specify the bounds of the selection range, call the SetBounds() method.

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.

By default, there is an abrupt transition between the output values from the two source modules at the selection-range boundary. To smooth the transition, pass a non-zero value to the SetEdgeFalloff() method. Higher values result in a smoother transition.

This noise module requires three source modules.

Constructors

this
this()

Constructor.

this
this(double edgeFalloff, double lowerBound, double upperBound)
Undocumented in source.

Members

Functions

GetControlMod
const(Mod) GetControlMod()

Returns the control module.

GetEdgeFalloff
double GetEdgeFalloff()

Returns the falloff value at the edge transition.

GetLowerBound
double GetLowerBound()

Returns the lower bound of the selection range.

GetSourceModCount
int GetSourceModCount()
Undocumented in source. Be warned that the author may not have intended to support it.
GetUpperBound
double GetUpperBound()

Returns the upper bound of the selection range.

GetValue
double GetValue(double x, double y, double z)
Undocumented in source. Be warned that the author may not have intended to support it.
SetBounds
void SetBounds(double lowerBound, double upperBound)

Sets the lower and upper bounds of the selection range.

SetControlMod
void SetControlMod(const(Mod)* controlMod)

Sets the control module.

SetEdgeFalloff
void SetEdgeFalloff(double edgeFalloff)

Sets the falloff value at the edge transition.

Variables

m_edgeFalloff
double m_edgeFalloff;

Edge-falloff value.

m_lowerBound
double m_lowerBound;

Lower bound of the selection range.

m_upperBound
double m_upperBound;

Upper bound of the selection range.

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