summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJFonS <joan.fonssanchez@gmail.com>2018-09-19 21:00:10 +0200
committerJFonS <joan.fonssanchez@gmail.com>2018-09-19 21:00:10 +0200
commit4faa5acaa7379fa86d69cb2856edd3a990d190b1 (patch)
treed89d2ae6ab49c1e10450d47aa5b946e4e7e1551f
parent2306ec211cab87b2941d32e7b88e4bb7304e5e62 (diff)
Replace "persistance" with "persistence"
Replace "persistance" with "persistence" in the simplex code. Also made some minor fixes to the docs.
-rw-r--r--modules/opensimplex/doc_classes/SimplexNoise.xml10
-rw-r--r--modules/opensimplex/simplex_noise.cpp20
-rw-r--r--modules/opensimplex/simplex_noise.h6
3 files changed, 18 insertions, 18 deletions
diff --git a/modules/opensimplex/doc_classes/SimplexNoise.xml b/modules/opensimplex/doc_classes/SimplexNoise.xml
index 5c633492e7..1be7b5896d 100644
--- a/modules/opensimplex/doc_classes/SimplexNoise.xml
+++ b/modules/opensimplex/doc_classes/SimplexNoise.xml
@@ -47,7 +47,7 @@
<argument index="1" name="y" type="float">
</argument>
<description>
- Returns the 2D noise value [-1,1] at the given position.
+ Returns the 2D noise value [code][-1,1][/code] at the given position.
</description>
</method>
<method name="get_noise_2dv">
@@ -56,7 +56,7 @@
<argument index="0" name="pos" type="Vector2">
</argument>
<description>
- Returns the 2D noise value [-1,1] at the given position.
+ Returns the 2D noise value [code][-1,1][/code] at the given position.
</description>
</method>
<method name="get_noise_3d">
@@ -69,7 +69,7 @@
<argument index="2" name="z" type="float">
</argument>
<description>
- Returns the 3D noise value [-1,1] at the given position.
+ Returns the 3D noise value [code][-1,1][/code] at the given position.
</description>
</method>
<method name="get_noise_3dv">
@@ -78,7 +78,7 @@
<argument index="0" name="pos" type="Vector3">
</argument>
<description>
- Returns the 3D noise value [-1,1] at the given position.
+ Returns the 3D noise value [code][-1,1][/code] at the given position.
</description>
</method>
<method name="get_noise_4d">
@@ -93,7 +93,7 @@
<argument index="3" name="w" type="float">
</argument>
<description>
- Returns the 4D noise value [-1,1] at the given position.
+ Returns the 4D noise value [code][-1,1][/code] at the given position.
</description>
</method>
<method name="get_seamless_image">
diff --git a/modules/opensimplex/simplex_noise.cpp b/modules/opensimplex/simplex_noise.cpp
index 6d66c7110e..e489b7f6f0 100644
--- a/modules/opensimplex/simplex_noise.cpp
+++ b/modules/opensimplex/simplex_noise.cpp
@@ -35,7 +35,7 @@
SimplexNoise::SimplexNoise() {
seed = 0;
- persistance = 0.5;
+ persistence = 0.5;
octaves = 3;
period = 64;
lacunarity = 2.0;
@@ -81,9 +81,9 @@ void SimplexNoise::set_period(float p_period) {
emit_changed();
}
-void SimplexNoise::set_persistance(float p_persistance) {
- if (p_persistance == persistance) return;
- persistance = p_persistance;
+void SimplexNoise::set_persistence(float p_persistence) {
+ if (p_persistence == persistence) return;
+ persistence = p_persistence;
emit_changed();
}
@@ -164,8 +164,8 @@ void SimplexNoise::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_period", "period"), &SimplexNoise::set_period);
ClassDB::bind_method(D_METHOD("get_period"), &SimplexNoise::get_period);
- ClassDB::bind_method(D_METHOD("set_persistance", "persistance"), &SimplexNoise::set_persistance);
- ClassDB::bind_method(D_METHOD("get_persistance"), &SimplexNoise::get_persistance);
+ ClassDB::bind_method(D_METHOD("set_persistence", "persistence"), &SimplexNoise::set_persistence);
+ ClassDB::bind_method(D_METHOD("get_persistence"), &SimplexNoise::get_persistence);
ClassDB::bind_method(D_METHOD("set_lacunarity", "lacunarity"), &SimplexNoise::set_lacunarity);
ClassDB::bind_method(D_METHOD("get_lacunarity"), &SimplexNoise::get_lacunarity);
@@ -183,7 +183,7 @@ void SimplexNoise::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "seed"), "set_seed", "get_seed");
ADD_PROPERTY(PropertyInfo(Variant::INT, "octaves", PROPERTY_HINT_RANGE, "1,6,1"), "set_octaves", "get_octaves");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "period", PROPERTY_HINT_RANGE, "0.1,256.0,0.1"), "set_period", "get_period");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "persistance", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_persistance", "get_persistance");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "persistence", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_persistence", "get_persistence");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "lacunarity", PROPERTY_HINT_RANGE, "0.1,4.0,0.01"), "set_lacunarity", "get_lacunarity");
}
@@ -200,7 +200,7 @@ float SimplexNoise::get_noise_2d(float x, float y) {
while (++i < octaves) {
x *= lacunarity;
y *= lacunarity;
- amp *= persistance;
+ amp *= persistence;
max += amp;
sum += _get_octave_noise_2d(i, x, y) * amp;
}
@@ -223,7 +223,7 @@ float SimplexNoise::get_noise_3d(float x, float y, float z) {
x *= lacunarity;
y *= lacunarity;
z *= lacunarity;
- amp *= persistance;
+ amp *= persistence;
max += amp;
sum += _get_octave_noise_3d(i, x, y, z) * amp;
}
@@ -248,7 +248,7 @@ float SimplexNoise::get_noise_4d(float x, float y, float z, float w) {
y *= lacunarity;
z *= lacunarity;
w *= lacunarity;
- amp *= persistance;
+ amp *= persistence;
max += amp;
sum += _get_octave_noise_4d(i, x, y, z, w) * amp;
}
diff --git a/modules/opensimplex/simplex_noise.h b/modules/opensimplex/simplex_noise.h
index 59390c6172..9a48dbf809 100644
--- a/modules/opensimplex/simplex_noise.h
+++ b/modules/opensimplex/simplex_noise.h
@@ -44,7 +44,7 @@ class SimplexNoise : public Resource {
osn_context contexts[6];
int seed;
- float persistance; // Controls details, value in [0,1]. Higher increases grain, lower increases smoothness.
+ float persistence; // Controls details, value in [0,1]. Higher increases grain, lower increases smoothness.
int octaves; // Number of noise layers
float period; // Distance above which we start to see similarities. The higher, the longer "hills" will be on a terrain.
float lacunarity; // Controls period change across octaves. 2 is usually a good value to address all detail levels.
@@ -64,8 +64,8 @@ public:
void set_period(float p_period);
float get_period() const { return period; }
- void set_persistance(float p_persistance);
- float get_persistance() const { return persistance; }
+ void set_persistence(float p_persistence);
+ float get_persistence() const { return persistence; }
void set_lacunarity(float p_lacunarity);
float get_lacunarity() const { return lacunarity; }