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

Wave square (x, y) function class. More...

#include <functions.hpp>

Public Member Functions

float operator() (float x, float y, float ctrl_param=0.f) const
 WaveSquareFunction (glm::vec2 kw, float angle, float phase_shift, glm::vec2 center={0.5f, 0.5f})
 Construct a new Wave Square Function object.
void set_angle (float new_angle)
 Set the angle.

Protected Attributes

glm::vec2 kw
 Frequency scaling vector.
float angle
 Overall rotation angle (in degrees).
float phase_shift
 Phase shift (in radians).
glm::vec2 center
 Primitive reference center.

Detailed Description

Wave square (x, y) function class.

This class models a wave square function with specific noise wavenumbers, rotation angle, and phase shift. It extends the base Function class.

Constructor & Destructor Documentation

◆ WaveSquareFunction()

hmap::WaveSquareFunction::WaveSquareFunction ( glm::vec2 kw,
float angle,
float phase_shift,
glm::vec2 center = {0.5f, 0.5f} )

Construct a new Wave Square Function object.

Parameters
kwNoise wavenumbers {kx, ky} for each direction, with respect to a unit domain.
angleOverall rotation angle (in degrees).
phase_shiftPhase shift (in radians).
centerPrimitive reference center.

Member Function Documentation

◆ operator()()

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

◆ set_angle()

void hmap::WaveSquareFunction::set_angle ( float new_angle)
inline

Set the angle.

Parameters
new_angleNew angle.

Member Data Documentation

◆ kw

glm::vec2 hmap::WaveSquareFunction::kw
protected

Frequency scaling vector.

◆ angle

float hmap::WaveSquareFunction::angle
protected

Overall rotation angle (in degrees).

◆ phase_shift

float hmap::WaveSquareFunction::phase_shift
protected

Phase shift (in radians).

◆ center

glm::vec2 hmap::WaveSquareFunction::center
protected

Primitive reference center.


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