-
Notifications
You must be signed in to change notification settings - Fork 0
/
fn_cellular.h
86 lines (61 loc) · 1.97 KB
/
fn_cellular.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef gd_fastnoise2_FNCELLULAR_H
#define gd_fastnoise2_FNCELLULAR_H
#include "fn_generator.h"
namespace _FastNoise = FastNoise;
class FNCellular : public FNGenerator {
GDCLASS(FNCellular, FNGenerator)
public:
enum CellularType {
Cellular = 0,
CellularValue,
CellularDistance,
CellularLookup,
};
FNCellular() = default;
void set_jitter_modifier(float value) { _cell_node->SetJitterModifier(value); }
void set_distance_func(int value);
_FastNoise::SmartNode<_FastNoise::Generator> _get_smart_node() const override {
return _cell_node;
}
protected:
static void _bind_methods();
static void _bind_cellular_type_enum();
static void _bind_distance_func_enum();
CellularType _cell_type = CellularType::Cellular;
_FastNoise::SmartNode<_FastNoise::Cellular> _cell_node;
};
class FNCellularValue : public FNCellular {
GDCLASS(FNCellularValue, FNCellular)
public:
FNCellularValue();
void set_value_index(int value);
protected:
static void _bind_methods();
private:
_FastNoise::SmartNode<_FastNoise::CellularValue> _casted_node;
};
class FNCellularDistance : public FNCellular {
GDCLASS(FNCellularDistance, FNCellular)
public:
FNCellularDistance();
void set_distance_index0(int value) { _casted_node->SetDistanceIndex0(value); }
void set_distance_index1(int value) { _casted_node->SetDistanceIndex1(value); }
void set_return_type(int type);
protected:
static void _bind_methods();
static void _bind_return_type_enum();
private:
_FastNoise::SmartNode<_FastNoise::CellularDistance> _casted_node;
};
class FNCellularLookup : public FNCellular {
GDCLASS(FNCellularLookup, FNCellular)
public:
FNCellularLookup();
void set_lookup(FNGenerator* gen);
void set_lookup_frequency(float freq) { _casted_node->SetLookupFrequency(freq); }
protected:
static void _bind_methods();
private:
_FastNoise::SmartNode<_FastNoise::CellularLookup> _casted_node;
};
#endif