CS::Math::Noise::Model::Line Class Reference
[Models]
Model that defines the displacement of a line segment. More...
#include <cstool/noise/model/line.h>
Public Member Functions | |
bool | GetAttenuate () const |
Returns a flag indicating whether the output value is to be attenuated (moved toward 0.0) as the ends of the line segment are approached by the input value. | |
const CS::Math::Noise::Module::Module & | GetModule () const |
Returns the noise module that is used to generate the output values. | |
double | GetValue (double p) const |
Returns the output value from the noise module given the one-dimensional coordinate of the specified input value located on the line segment. | |
Line (const CS::Math::Noise::Module::Module &module) | |
Constructor. | |
Line () | |
Constructor. | |
void | SetAttenuate (bool att) |
Sets a flag indicating that the output value is to be attenuated (moved toward 0.0) as the ends of the line segment are approached. | |
void | SetEndPoint (double x, double y, double z) |
Sets the position ( x, y, z ) of the end of the line segment to choose values along. | |
void | SetModule (const CS::Math::Noise::Module::Module &module) |
Sets the noise module that is used to generate the output values. | |
void | SetStartPoint (double x, double y, double z) |
Sets the position ( x, y, z ) of the start of the line segment to choose values along. |
Detailed Description
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.
Definition at line 52 of file line.h.
Constructor & Destructor Documentation
CS::Math::Noise::Model::Line::Line | ( | ) |
Constructor.
CS::Math::Noise::Model::Line::Line | ( | const CS::Math::Noise::Module::Module & | module | ) |
Constructor.
- Parameters:
-
module The noise module that is used to generate the output values.
Member Function Documentation
bool CS::Math::Noise::Model::Line::GetAttenuate | ( | ) | const [inline] |
const CS::Math::Noise::Module::Module& CS::Math::Noise::Model::Line::GetModule | ( | ) | const [inline] |
Returns the noise module that is used to generate the output values.
- Returns:
- A reference to the noise module.
- Precondition:
- A noise module was passed to the SetModule() method.
double CS::Math::Noise::Model::Line::GetValue | ( | double | p | ) | const |
Returns the output value from the noise module given the one-dimensional coordinate of the specified input value located on the line segment.
- Parameters:
-
p The distance along the line segment (ranges from 0.0 to 1.0)
- Returns:
- The output value from the noise module.
- Precondition:
- A noise module was passed to the SetModule() method.
- The start and end points of the line segment were specified.
The output value is generated by the noise module passed to the SetModule() method. 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.
void CS::Math::Noise::Model::Line::SetAttenuate | ( | bool | att | ) | [inline] |
void CS::Math::Noise::Model::Line::SetEndPoint | ( | double | x, | |
double | y, | |||
double | z | |||
) | [inline] |
void CS::Math::Noise::Model::Line::SetModule | ( | const CS::Math::Noise::Module::Module & | module | ) | [inline] |
void CS::Math::Noise::Model::Line::SetStartPoint | ( | double | x, | |
double | y, | |||
double | z | |||
) | [inline] |
The documentation for this class was generated from the following file:
- cstool/noise/model/line.h
Generated for Crystal Space 2.0 by doxygen 1.6.1