C# Класс 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.
Наследование: ModifierModule, IModule3D
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_controlPoints List
_invert bool

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
SortControlPoints ( ) : void

Описание методов

AddControlPoint() публичный Метод

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.
Результат void

ClearControlPoints() публичный Метод

Deletes all the control points on the curve.
public ClearControlPoints ( ) : void
Результат void

CountControlPoints() публичный Метод

Return the size of the ControlPoint list
public CountControlPoints ( ) : int
Результат int

GetValue() публичный Метод

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.
Результат float

MakeControlPoints() публичный Метод

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.
Результат void

SortControlPoints() защищенный Метод

protected SortControlPoints ( ) : void
Результат void

Terrace() публичный Метод

public Terrace ( ) : System
Результат System

Terrace() публичный Метод

public Terrace ( IModule source ) : System
source IModule
Результат System

Terrace() публичный Метод

public Terrace ( IModule source, bool invert ) : System
source IModule
invert bool
Результат System

getControlPoints() публичный Метод

Returns a read-only IList wrapper for the current ControlPoint list.
public getControlPoints ( ) : IList
Результат IList

Описание свойств

_controlPoints защищенное свойство

protected List _controlPoints
Результат List

_invert защищенное свойство

Enables or disables the inversion of the terrace-forming curve between the control points.
protected bool _invert
Результат bool