Curve

@addtogroup modules @{ @addtogroup modifiermodules @{ Noise module that maps the output value from a source module onto an arbitrary function curve.

@image html modulecurve.png

This noise module maps the output value from the source module onto an application-defined curve. This curve is defined by a number of <i>control points</i>; each control point has an <i>input value</i> that maps to an <i>output value</i>. Refer to the following illustration:

@image html curve.png

To add the control points to this curve, call the AddControlPoint() method.

Since this curve is a cubic spline, an application must add a minimum of four control points to the curve. If this is not done, the GetValue() method fails. Each control point can have any input and output value, although no two control points can have the same input value. There is no limit to the number of control points that can be added to the curve.

This noise module requires one source module.

Constructors

this
this()

Constructor.

Destructor

~this
~this()

Destructor.

Members

Functions

AddControlPoint
void AddControlPoint(double inputValue, double outputValue)

Adds a control point to the curve.

ClearAllControlPoints
void ClearAllControlPoints()

Deletes all the control points on the curve.

FindInsertionPos
int FindInsertionPos(double inputValue)

Determines the array index in which to insert the control point into the internal control point array.

GetControlPointArray
const(ControlPoint)[] GetControlPointArray()

Returns a pointer to the array of control points on the curve.

GetControlPointCount
int GetControlPointCount()

Returns the number of control points on the curve.

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.
InsertAtPos
void InsertAtPos(int insertionPos, double inputValue, double outputValue)

Inserts the control point at the specified position in the internal control point array.

Variables

m_controlPointCount
int m_controlPointCount;

Number of control points on the curve.

m_pControlPoints
ControlPoint[] m_pControlPoints;

Array that stores the control points.

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