|
@@ -173,6 +173,7 @@ void OpenSimplexNoise::_bind_methods() {
|
|
|
ClassDB::bind_method(D_METHOD("get_image", "width", "height"), &OpenSimplexNoise::get_image);
|
|
|
ClassDB::bind_method(D_METHOD("get_seamless_image", "size"), &OpenSimplexNoise::get_seamless_image);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_noise_1d", "x"), &OpenSimplexNoise::get_noise_1d);
|
|
|
ClassDB::bind_method(D_METHOD("get_noise_2d", "x", "y"), &OpenSimplexNoise::get_noise_2d);
|
|
|
ClassDB::bind_method(D_METHOD("get_noise_3d", "x", "y", "z"), &OpenSimplexNoise::get_noise_3d);
|
|
|
ClassDB::bind_method(D_METHOD("get_noise_4d", "x", "y", "z", "w"), &OpenSimplexNoise::get_noise_4d);
|
|
@@ -187,6 +188,11 @@ void OpenSimplexNoise::_bind_methods() {
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::REAL, "lacunarity", PROPERTY_HINT_RANGE, "0.1,4.0,0.01"), "set_lacunarity", "get_lacunarity");
|
|
|
}
|
|
|
|
|
|
+float OpenSimplexNoise::get_noise_1d(float x) {
|
|
|
+
|
|
|
+ return get_noise_2d(x, 1.0);
|
|
|
+}
|
|
|
+
|
|
|
float OpenSimplexNoise::get_noise_2d(float x, float y) {
|
|
|
|
|
|
x /= period;
|