HighMap library (C++)
Loading...
Searching...
No Matches
hmap::FbmIqFunction< BaseFn > Class Template Reference

IQ layering function class. More...

#include <functions.hpp>

Inheritance diagram for hmap::FbmIqFunction< BaseFn >:
Collaboration diagram for hmap::FbmIqFunction< BaseFn >:

Public Member Functions

float operator() (float x, float y, float ctrl_param=0.f) const
 FbmIqFunction (BaseFn base, int octaves, float weight, float persistence, float lacunarity, float gradient_scale)
 Construct a new Fbm Iq Function object.
void set_gradient_scale (float new_gradient_scale)
 Set the gradient scale.
Public Member Functions inherited from hmap::GenericFractalFunction< BaseFn >
 GenericFractalFunction (BaseFn base, int octaves, float weight, float persistence, float lacunarity)
 Construct a new GenericFractalFunction object.
void set_kw (glm::vec2 new_kw)
 Set the frequency scaling vector.
void set_lacunarity (float new_lacunarity)
 Set the lacunarity of the fractal noise.
void set_octaves (int new_octaves)
 Set the number of octaves in the fractal noise.
void set_persistence (float new_persistence)
 Set the persistence of the fractal noise.
void set_seed (std::uint32_t new_seed)
 Set a new random seed for the noise generation.
void scale_amp0 (float scale)
 Scale the initial amplitude of the fractal noise.
void set_stretch (float new_angle, float new_stretch, float new_stretch_decay=0.f)
 Configure directional stretching for the fractal noise.
float get_lacunarity () const
 Get the lacunarity of the fractal noise.
int get_octaves () const
 Get the number of octaves in the fractal noise.
float get_persistence () const
 Get the persistence of the fractal noise.
float get_weight () const
 Get the weight of the fractal noise.
Public Member Functions inherited from hmap::NoiseFunction
 NoiseFunction ()
 Default constructor. Initializes with default frequency scaling and seed.
 NoiseFunction (glm::vec2 kw)
 Constructor to initialize with specific frequency scaling.
 NoiseFunction (glm::vec2 kw, std::uint32_t seed)
 Constructor to initialize with specific frequency scaling and seed.
glm::vec2 get_kw () const
 Get the frequency scaling vector.
std::uint32_t get_seed () const
 Get the random seed.
void set_seed (std::uint32_t new_seed)
 Set a new random seed for noise generation.
void set_kw (glm::vec2 new_kw)
 Set a new frequency scaling vector.

Protected Attributes

float gradient_scale
 Gradient scale influence.
Protected Attributes inherited from hmap::GenericFractalFunction< BaseFn >
BaseFn base
 Unique pointer to the base noise function.
int octaves
 Number of octaves in the fractal noise.
float weight
 Weight of the base noise function.
float persistence
 Persistence of the fractal noise.
float lacunarity
 Lacunarity of the fractal noise.
float amp0
 Initial amplitude of the fractal noise.
float angle = 0.f
 Direction angle in degrees.
float stretch = 1.f
 Stretching factor along the direction.
float stretch_decay = 0.f
 Stretching decay across octaves.
float cos_a = 1.f
 Cosine of direction angle.
float sin_a = 0.f
 Sine of direction angle.
Protected Attributes inherited from hmap::NoiseFunction
glm::vec2 kw
 Frequency scaling vector.
std::uint32_t seed
 Random seed for noise generation.

Additional Inherited Members

Protected Member Functions inherited from hmap::GenericFractalFunction< BaseFn >
void update_amp0 ()
 Update the initial amplitude (amp0) based on the current octaves and persistence.
void apply_stretch (float &x, float &y, int octave) const
 Apply directional stretching to coordinates for a given octave.

Detailed Description

template<typename BaseFn>
class hmap::FbmIqFunction< BaseFn >

IQ layering function class.

Constructor & Destructor Documentation

◆ FbmIqFunction()

template<typename BaseFn>
hmap::FbmIqFunction< BaseFn >::FbmIqFunction ( BaseFn base,
int octaves,
float weight,
float persistence,
float lacunarity,
float gradient_scale )

Construct a new Fbm Iq Function object.

Parameters
p_baseUnique pointer to the base noise function.
octavesNumber of octaves.
weightOctave weighting.
persistenceOctave persistence.
lacunarityDefines the wavenumber ratio between each octave.
gradient_scaleGradient scale influence.

Member Function Documentation

◆ operator()()

template<typename BaseFn>
float hmap::FbmIqFunction< BaseFn >::operator() ( float x,
float y,
float ctrl_param = 0.f ) const

◆ set_gradient_scale()

template<typename BaseFn>
void hmap::FbmIqFunction< BaseFn >::set_gradient_scale ( float new_gradient_scale)
inline

Set the gradient scale.

Parameters
new_gradient_scaleNew gradient scale.

Member Data Documentation

◆ gradient_scale

template<typename BaseFn>
float hmap::FbmIqFunction< BaseFn >::gradient_scale
protected

Gradient scale influence.


The documentation for this class was generated from the following files: