C# Class LibNoise.Model.Line

Model that defines the displacement of a line segment. This model returns an output value from a noise module given the one-dimensional coordinate of an input value located on a line segment, which can be used as displacements. This class is useful for creating: - roads and rivers - disaffected college students To generate an output value, pass an input value between 0.0 and 1.0 to the GetValue() method. 0.0 represents the start position of the line segment and 1.0 represents the end position of the line segment.
Inheritance: AbstractModel
Datei anzeigen Open project: everbytes/LibNoise

Public Methods

Method Description
GetValue ( float p ) : float

Returns the output value from the noise module given the one-dimensional coordinate of the specified input value located on the line segment. This value may be attenuated (moved toward 0.0) as p approaches either end of the line segment; this is the default behavior. If the value is not to be attenuated, p can safely range outside the 0.0 to 1.0 range; the output value will be extrapolated along the line that this segment is part of.

Line ( )

Initializes a new instance of the Line class. Default constructor

Line ( IModule module )

Initializes a new instance of the Line class. Constructor

SetEndPoint ( float x, float y, float z ) : void

Sets the position ( x, y, z ) of the end of the line segment to choose values along.

SetStartPoint ( float x, float y, float z ) : void

Sets the position ( x, y, z ) of the start of the line segment to choose values along.

Method Details

GetValue() public method

Returns the output value from the noise module given the one-dimensional coordinate of the specified input value located on the line segment. This value may be attenuated (moved toward 0.0) as p approaches either end of the line segment; this is the default behavior. If the value is not to be attenuated, p can safely range outside the 0.0 to 1.0 range; the output value will be extrapolated along the line that this segment is part of.
public GetValue ( float p ) : float
p float The distance along the line segment (ranges from 0.0 to 1.0)
return float

Line() public method

Initializes a new instance of the Line class. Default constructor
public Line ( )

Line() public method

Initializes a new instance of the Line class. Constructor
public Line ( IModule module )
module IModule The noise module that is used to generate the output values

SetEndPoint() public method

Sets the position ( x, y, z ) of the end of the line segment to choose values along.
public SetEndPoint ( float x, float y, float z ) : void
x float x coordinate of the end position
y float y coordinate of the end position
z float z coordinate of the end position
return void

SetStartPoint() public method

Sets the position ( x, y, z ) of the start of the line segment to choose values along.
public SetStartPoint ( float x, float y, float z ) : void
x float x coordinate of the start position
y float y coordinate of the start position
z float z coordinate of the start position
return void