HighMap library (C++)
Loading...
Searching...
No Matches
hmap::ArrayFunction Class Reference

Array (x, y) function class. More...

#include <functions.hpp>

Public Member Functions

float operator() (float x, float y, float ctrl_param=0.f) const
 ArrayFunction (Array array, glm::vec2 kw, bool periodic=true)
 Construct a new ArrayFunction object.
void set_array (Array new_array)
 Set the array object.

Protected Attributes

glm::vec2 kw
 Frequency scaling vector.
bool periodic
 Flag indicating whether the domain is periodic or not.

Detailed Description

Array (x, y) function class.

This class functions like an image sampler with normalized coordinates found on a GPU. It is based on a 2D array, allowing interpolation of any value at a given (x, y) coordinate. Specific boundary conditions, such as periodicity, can also be used.

Constructor & Destructor Documentation

◆ ArrayFunction()

hmap::ArrayFunction::ArrayFunction ( hmap::Array array,
glm::vec2 kw,
bool periodic = true )

Construct a new ArrayFunction object.

Parameters
arrayData array.
kwNoise wavenumbers {kx, ky} for each direction, with respect to a unit domain.
periodicWhether the domain is periodic or not.

Member Function Documentation

◆ operator()()

float hmap::ArrayFunction::operator() ( float x,
float y,
float ctrl_param = 0.f ) const

◆ set_array()

void hmap::ArrayFunction::set_array ( Array new_array)
inline

Set the array object.

Parameters
new_arrayNew data array.

Member Data Documentation

◆ kw

glm::vec2 hmap::ArrayFunction::kw
protected

Frequency scaling vector.

◆ periodic

bool hmap::ArrayFunction::periodic
protected

Flag indicating whether the domain is periodic or not.


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