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
Afficher le fichier Open project: everbytes/LibNoise Class Usage Examples

Protected Properties

Свойство Type Description
_controlPoints List
_invert bool

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
SortControlPoints ( ) : void

Method Details

AddControlPoint() public méthode

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.
Résultat void

ClearControlPoints() public méthode

Deletes all the control points on the curve.
public ClearControlPoints ( ) : void
Résultat void

CountControlPoints() public méthode

Return the size of the ControlPoint list
public CountControlPoints ( ) : int
Résultat int

GetValue() public méthode

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.
Résultat float

MakeControlPoints() public méthode

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.
Résultat void

SortControlPoints() protected méthode

protected SortControlPoints ( ) : void
Résultat void

Terrace() public méthode

public Terrace ( ) : System
Résultat System

Terrace() public méthode

public Terrace ( IModule source ) : System
source IModule
Résultat System

Terrace() public méthode

public Terrace ( IModule source, bool invert ) : System
source IModule
invert bool
Résultat System

getControlPoints() public méthode

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

Property Details

_controlPoints protected_oe property

protected List _controlPoints
Résultat List

_invert protected_oe property

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