use double precision numbers in love.math.noise

This commit is contained in:
megagrump
2021-11-22 14:57:05 +01:00
parent 9cc98df218
commit 136c3cd277
7 changed files with 146 additions and 157 deletions
+4 -4
View File
@@ -132,12 +132,12 @@ private:
}; // Math
static inline float noise1(float x)
static inline float noise1(double x)
{
return SimplexNoise1234::noise(x) * 0.5f + 0.5f;
}
static inline float noise2(float x, float y)
static inline float noise2(double x, double y)
{
return SimplexNoise1234::noise(x, y) * 0.5f + 0.5f;
}
@@ -145,12 +145,12 @@ static inline float noise2(float x, float y)
// Perlin noise is used instead of Simplex noise in the 3D and 4D cases to avoid
// patent issues.
static inline float noise3(float x, float y, float z)
static inline float noise3(double x, double y, double z)
{
return Noise1234::noise(x, y, z) * 0.5f + 0.5f;
}
static inline float noise4(float x, float y, float z, float w)
static inline float noise4(double x, double y, double z, double w)
{
return Noise1234::noise(x, y, z, w) * 0.5f + 0.5f;
}