C# Class LibNoise.Modifier.Terrace

Noise module that maps the output value from a source module onto a terrace-forming curve. This noise module maps the output value from the source module onto a terrace-forming curve. The start of this curve has a slope of zero; its slope then smoothly increases. This curve also contains control points which resets the slope to zero at that point, producing a "terracing" effect. Refer to the following illustration: To add a control point to this noise module, call the AddControlPoint() method. An application must add a minimum of two control points to the curve. If this is not done, the GetValue() method fails. The control points can have any value, although no two control points can have the same value. There is no limit to the number of control points that can be added to the curve. This noise module clamps the output value from the source module if that value is less than the value of the lowest control point or greater than the value of the highest control point. This noise module is often used to generate terrain features such as your stereotypical desert canyon.
Inheritance: ModifierModule, IModule3D
ファイルを表示 Open project: everbytes/LibNoise Class Usage Examples

Protected Properties

Property Type Description
_controlPoints List
_invert bool

Public Methods

Method Description
AddControlPoint ( float input ) : void

Adds a control point to the curve. No two control points have the same input value. @throw System.ArgumentException if two control points have the same input value. It does not matter which order these points are added.

ClearControlPoints ( ) : void

Deletes all the control points on the curve.

CountControlPoints ( ) : int

Return the size of the ControlPoint list

GetValue ( float x, float y, float z ) : float

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

MakeControlPoints ( int controlPointCount ) : void

Creates a number of equally-spaced control points that range from -1 to +1. The number of control points must be greater than or equal to 2 The previous control points on the terrace-forming curve are deleted. Two or more control points define the terrace-forming curve. The start of this curve has a slope of zero; its slope then smoothly increases. At the control points, its slope resets to zero. @throw ArgumentException if an invalid parameter was specified

Terrace ( ) : System
Terrace ( IModule source ) : System
Terrace ( IModule source, bool invert ) : System
getControlPoints ( ) : IList

Returns a read-only IList wrapper for the current ControlPoint list.

Protected Methods

Method Description
SortControlPoints ( ) : void

Method Details

AddControlPoint() public method

Adds a control point to the curve. No two control points have the same input value. @throw System.ArgumentException if two control points have the same input value. It does not matter which order these points are added.
public AddControlPoint ( float input ) : void
input float The input value stored in the control point.
return void

ClearControlPoints() public method

Deletes all the control points on the curve.
public ClearControlPoints ( ) : void
return void

CountControlPoints() public method

Return the size of the ControlPoint list
public CountControlPoints ( ) : int
return int

GetValue() public method

Generates an output value given the coordinates of the specified input value.
public GetValue ( float x, float y, float z ) : float
x float The input coordinate on the x-axis.
y float The input coordinate on the y-axis.
z float The input coordinate on the z-axis.
return float

MakeControlPoints() public method

Creates a number of equally-spaced control points that range from -1 to +1. The number of control points must be greater than or equal to 2 The previous control points on the terrace-forming curve are deleted. Two or more control points define the terrace-forming curve. The start of this curve has a slope of zero; its slope then smoothly increases. At the control points, its slope resets to zero. @throw ArgumentException if an invalid parameter was specified
public MakeControlPoints ( int controlPointCount ) : void
controlPointCount int The number of control points to generate.
return void

SortControlPoints() protected method

protected SortControlPoints ( ) : void
return void

Terrace() public method

public Terrace ( ) : System
return System

Terrace() public method

public Terrace ( IModule source ) : System
source IModule
return System

Terrace() public method

public Terrace ( IModule source, bool invert ) : System
source IModule
invert bool
return System

getControlPoints() public method

Returns a read-only IList wrapper for the current ControlPoint list.
public getControlPoints ( ) : IList
return IList

Property Details

_controlPoints protected_oe property

protected List _controlPoints
return List

_invert protected_oe property

Enables or disables the inversion of the terrace-forming curve between the control points.
protected bool _invert
return bool