-
Notifications
You must be signed in to change notification settings - Fork 0
/
fn_fractal.h
44 lines (31 loc) · 1 KB
/
fn_fractal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef gd_fastnoise2_FNFRACTAL_H
#define gd_fastnoise2_FNFRACTAL_H
#include "fn_generator.h"
namespace _FastNoise = FastNoise;
class FNFractal : public FNGenerator {
GDCLASS(FNFractal, FNGenerator)
public:
enum FractalType {
FBm = 0,
Ridged,
PingPong
};
FNFractal(int type);
static Ref<FNFractal> new_fractal(int type);
void set_source(FNGenerator* src);
void set_gain(float value) const { _frac_node->SetGain(value); }
void set_weighted_strength(float value) const { _frac_node->SetWeightedStrength(value); }
void set_octave_count(int value) const { _frac_node->SetOctaveCount(value); }
void set_lacunarity(float value) const { _frac_node->SetLacunarity(value); }
_FastNoise::SmartNode<_FastNoise::Generator> _get_smart_node() const override {
return _frac_node;
}
protected:
FNFractal() = default;
static void _bind_methods();
static void _bind_frac_type_enum();
FractalType _frac_type = FractalType::FBm;
private:
_FastNoise::SmartNode<_FastNoise::Fractal<>> _frac_node;
};
#endif