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

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

#include <functions.hpp>

Inheritance diagram for hmap::CraterFunction:
Collaboration diagram for hmap::CraterFunction:

Public Member Functions

 CraterFunction (float radius, float depth, float lip_decay, float lip_height_ratio, Vec2< float > center)
 Construct a new Crater Function object.
 
- Public Member Functions inherited from hmap::Function
 Function ()
 Default constructor. Initializes the delegate function to a default that returns 0.
 
virtual ~Function ()=default
 Virtual destructor to ensure proper cleanup in derived classes.
 
 Function (HMAP_FCT_XY_TYPE delegate)
 Constructor to initialize with a specific delegate function.
 
HMAP_FCT_XY_TYPE get_delegate () const
 Get the current delegate function.
 
float get_value (float x, float y, float ctrl_param) const
 Call the delegate function with given arguments.
 
void set_delegate (HMAP_FCT_XY_TYPE new_delegate)
 Set a new delegate function.
 

Protected Attributes

float radius
 Radius of the crater.
 
float depth
 Depth of the crater.
 
float lip_decay
 Decay rate of the crater's lip.
 
float lip_height_ratio
 Height ratio of the crater's lip.
 
Vec2< float > center
 Primitive reference center.
 

Detailed Description

Crater (x, y) function class.

This class models a crater function with specified radius, depth, lip decay, lip height ratio, and reference center. It extends the base Function class.

Constructor & Destructor Documentation

◆ CraterFunction()

hmap::CraterFunction::CraterFunction ( float  radius,
float  depth,
float  lip_decay,
float  lip_height_ratio,
Vec2< float >  center 
)

Construct a new Crater Function object.

Parameters
radiusRadius of the crater (with respect to a unit domain).
depthDepth of the crater (with respect to a unit domain).
lip_decayDecay rate of the crater's lip (with respect to a unit domain).
lip_height_ratioHeight ratio of the crater's lip.
centerPrimitive reference center.

Member Data Documentation

◆ radius

float hmap::CraterFunction::radius
protected

Radius of the crater.

◆ depth

float hmap::CraterFunction::depth
protected

Depth of the crater.

◆ lip_decay

float hmap::CraterFunction::lip_decay
protected

Decay rate of the crater's lip.

◆ lip_height_ratio

float hmap::CraterFunction::lip_height_ratio
protected

Height ratio of the crater's lip.

◆ center

Vec2<float> hmap::CraterFunction::center
protected

Primitive reference center.


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