-
Notifications
You must be signed in to change notification settings - Fork 0
/
fn_basic_generators.cpp
101 lines (88 loc) · 2.47 KB
/
fn_basic_generators.cpp
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "fn_basic_generators.h"
FNConstant::FNConstant() {
_node = _FastNoise::New<_FastNoise::Constant>();
}
void FNConstant::_bind_methods() {
ClassDB::bind_method(
D_METHOD("set_value", "value"),
&FNConstant::set_value
);
}
FNWhite::FNWhite() {
_node = _FastNoise::New<_FastNoise::White>();
}
void FNWhite::_bind_methods() {
// No methods to bind
}
FNCheckerboard::FNCheckerboard() {
_node = _FastNoise::New<_FastNoise::Checkerboard>();
}
void FNCheckerboard::_bind_methods() {
ClassDB::bind_method(
D_METHOD("set_size", "size"),
&FNCheckerboard::set_size
);
}
FNSineWave::FNSineWave() {
_node = _FastNoise::New<_FastNoise::SineWave>();
}
void FNSineWave::_bind_methods() {
ClassDB::bind_method(
D_METHOD("set_scale", "value"),
&FNSineWave::set_scale
);
}
FNPositionOutput::FNPositionOutput() {
_node = _FastNoise::New<_FastNoise::PositionOutput>();
}
void FNPositionOutput::_bind_methods() {
ClassDB::bind_method(
D_METHOD("set_x", "multiplier", "offset"),
&FNPositionOutput::set_x
);
ClassDB::bind_method(
D_METHOD("set_y", "multiplier", "offset"),
&FNPositionOutput::set_y
);
ClassDB::bind_method(
D_METHOD("set_z", "multiplier", "offset"),
&FNPositionOutput::set_z
);
ClassDB::bind_method(
D_METHOD("set_w", "multiplier", "offset"),
&FNPositionOutput::set_w
);
}
FNDistanceToPoint::FNDistanceToPoint() {
_node = _FastNoise::New<_FastNoise::DistanceToPoint>();
}
void FNDistanceToPoint::set_distance_function(int64_t func) {
_FastNoise::DistanceFunction fn_func = static_cast<_FastNoise::DistanceFunction>(func);
_node->SetDistanceFunction(fn_func);
}
void FNDistanceToPoint::_bind_methods() {
ClassDB::bind_method(
D_METHOD("set_source", "gen"),
&FNDistanceToPoint::set_source
);
ClassDB::bind_method(
D_METHOD("set_distance_function", "func"),
&FNDistanceToPoint::set_distance_function
);
ClassDB::bind_method(
D_METHOD("set_x_scale", "value"),
&FNDistanceToPoint::set_x_scale
);
ClassDB::bind_method(
D_METHOD("set_y_scale", "value"),
&FNDistanceToPoint::set_y_scale
);
ClassDB::bind_method(
D_METHOD("set_z_scale", "value"),
&FNDistanceToPoint::set_z_scale
);
ClassDB::bind_method(
D_METHOD("set_w_scale", "value"),
&FNDistanceToPoint::set_w_scale
);
}