![]() |
Public API Reference |
![]() |
Noise module that applies a scaling factor and a bias to the output value from a source module. More...
#include <cstool/noise/module/scalebias.h>
Public Member Functions | |
double | GetBias () const |
Returns the bias to apply to the scaled output value from the source module. | |
double | GetScale () const |
Returns the scaling factor to apply to the output value from the source module. | |
virtual int | GetSourceModuleCount () const |
Returns the number of source modules required by this noise module. | |
virtual double | GetValue (double x, double y, double z) const |
Generates an output value given the coordinates of the specified input value. | |
ScaleBias () | |
Constructor. | |
void | SetBias (double bias) |
Sets the bias to apply to the scaled output value from the source module. | |
void | SetScale (double scale) |
Sets the scaling factor to apply to the output value from the source module. | |
Protected Attributes | |
double | m_bias |
Bias to apply to the scaled output value from the source module. | |
double | m_scale |
Scaling factor to apply to the output value from the source module. |
Noise module that applies a scaling factor and a bias to the output value from a source module.
The GetValue() method retrieves the output value from the source module, multiplies it with a scaling factor, adds a bias to it, then outputs the value.
This noise module requires one source module.
Definition at line 58 of file scalebias.h.
Constructor.
The default bias is set to CS::Math::Noise::Module::DEFAULT_BIAS.
The default scaling factor is set to CS::Math::Noise::Module::DEFAULT_SCALE.
double CS::Math::Noise::Module::ScaleBias::GetBias | ( | ) | const [inline] |
Returns the bias to apply to the scaled output value from the source module.
The GetValue() method retrieves the output value from the source module, multiplies it with the scaling factor, adds the bias to it, then outputs the value.
Definition at line 78 of file scalebias.h.
double CS::Math::Noise::Module::ScaleBias::GetScale | ( | ) | const [inline] |
Returns the scaling factor to apply to the output value from the source module.
The GetValue() method retrieves the output value from the source module, multiplies it with the scaling factor, adds the bias to it, then outputs the value.
Definition at line 91 of file scalebias.h.
virtual int CS::Math::Noise::Module::ScaleBias::GetSourceModuleCount | ( | ) | const [inline, virtual] |
Returns the number of source modules required by this noise module.
Implements CS::Math::Noise::Module::Module.
Definition at line 96 of file scalebias.h.
virtual double CS::Math::Noise::Module::ScaleBias::GetValue | ( | double | x, |
double | y, | ||
double | z | ||
) | const [virtual] |
Generates an output value given the coordinates of the specified input value.
x | The x coordinate of the input value. |
y | The y coordinate of the input value. |
z | The z coordinate of the input value. |
Before an application can call this method, it must first connect all required source modules via the SetSourceModule() method. If these source modules are not connected to this noise module, this method raises a debug assertion.
To determine the number of source modules required by this noise module, call the GetSourceModuleCount() method.
Implements CS::Math::Noise::Module::Module.
void CS::Math::Noise::Module::ScaleBias::SetBias | ( | double | bias | ) | [inline] |
Sets the bias to apply to the scaled output value from the source module.
bias | The bias to apply. |
The GetValue() method retrieves the output value from the source module, multiplies it with the scaling factor, adds the bias to it, then outputs the value.
Definition at line 111 of file scalebias.h.
void CS::Math::Noise::Module::ScaleBias::SetScale | ( | double | scale | ) | [inline] |
Sets the scaling factor to apply to the output value from the source module.
scale | The scaling factor to apply. |
The GetValue() method retrieves the output value from the source module, multiplies it with the scaling factor, adds the bias to it, then outputs the value.
Definition at line 124 of file scalebias.h.
double CS::Math::Noise::Module::ScaleBias::m_bias [protected] |
Bias to apply to the scaled output value from the source module.
Definition at line 132 of file scalebias.h.
double CS::Math::Noise::Module::ScaleBias::m_scale [protected] |
Scaling factor to apply to the output value from the source module.
Definition at line 136 of file scalebias.h.