Replaced templates by float
*Since only valid template parameters were float and double, the whole template aspect has been removed. Double precision would only be used in extremely rare occasions (applications needing high precision and slow performances), it is not relevant to template the whole module for it. Former-commit-id: fc6dd028189c608a6a7b4c312b3e5e3f53a01fd7
This commit is contained in:
parent
745b9dbbd1
commit
9fef43951b
|
|
@ -10,14 +10,12 @@
|
||||||
#include <Nazara/Prerequesites.hpp>
|
#include <Nazara/Prerequesites.hpp>
|
||||||
#include <Nazara/Noise/MappedNoiseBase.hpp>
|
#include <Nazara/Noise/MappedNoiseBase.hpp>
|
||||||
|
|
||||||
template <typename T> class NzAbstract2DNoise : public NzMappedNoiseBase<T>
|
class NAZARA_API NzAbstract2DNoise : public NzMappedNoiseBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
T GetBasicValue(T x, T y);
|
float GetBasicValue(float x, float y);
|
||||||
T GetMappedValue(T x, T y);
|
float GetMappedValue(float x, float y);
|
||||||
virtual T GetValue(T x, T y, T resolution) = 0;
|
virtual float GetValue(float x, float y, float resolution) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <Nazara/Noise/Abstract2DNoise.inl>
|
|
||||||
|
|
||||||
#endif // NAZARA_ABSTRACT2DNOISE_HPP
|
#endif // NAZARA_ABSTRACT2DNOISE_HPP
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,12 @@
|
||||||
#include <Nazara/Prerequesites.hpp>
|
#include <Nazara/Prerequesites.hpp>
|
||||||
#include <Nazara/Noise/MappedNoiseBase.hpp>
|
#include <Nazara/Noise/MappedNoiseBase.hpp>
|
||||||
|
|
||||||
template<typename T> class NzAbstract3DNoise : public NzMappedNoiseBase<T>
|
class NAZARA_API NzAbstract3DNoise : public NzMappedNoiseBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
T GetBasicValue(T x, T y, T z);
|
float GetBasicValue(float x, float y, float z);
|
||||||
T GetMappedValue(T x, T y, T z);
|
float GetMappedValue(float x, float y, float z);
|
||||||
virtual T GetValue(T x, T y, T z, T resolution) = 0;
|
virtual float GetValue(float x, float y, float z, float resolution) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <Nazara/Noise/Abstract3DNoise.inl>
|
|
||||||
|
|
||||||
#endif // NAZARA_ABSTRACT3DNOISE_HPP
|
#endif // NAZARA_ABSTRACT3DNOISE_HPP
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,12 @@
|
||||||
#include <Nazara/Prerequesites.hpp>
|
#include <Nazara/Prerequesites.hpp>
|
||||||
#include <Nazara/Noise/MappedNoiseBase.hpp>
|
#include <Nazara/Noise/MappedNoiseBase.hpp>
|
||||||
|
|
||||||
template <typename T> class NzAbstract4DNoise : public NzMappedNoiseBase<T>
|
class NAZARA_API NzAbstract4DNoise : public NzMappedNoiseBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
T GetBasicValue(T x, T y, T z, T w);
|
float GetBasicValue(float x, float y, float z, float w);
|
||||||
T GetMappedValue(T x, T y, T z, T w);
|
float GetMappedValue(float x, float y, float z, float w);
|
||||||
virtual T GetValue(T x, T y, T z, T w, T resolution) = 0;
|
virtual float GetValue(float x, float y, float z, float w, float resolution) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <Nazara/Noise/Abstract4DNoise.inl>
|
|
||||||
|
|
||||||
#endif // NAZARA_ABSTRACT4DNOISE_HPP
|
#endif // NAZARA_ABSTRACT4DNOISE_HPP
|
||||||
|
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
// Copyright (C) 2012 Rémi Bèges
|
|
||||||
// This file is part of the "Nazara Engine".
|
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
|
||||||
|
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
|
||||||
#include <Nazara/Math/Basic.hpp>
|
|
||||||
#include <Nazara/Core/Error.hpp>
|
|
||||||
#include <Nazara/Noise/Config.hpp>
|
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
T NzAbstract4DNoise<T>::GetBasicValue(T x, T y, T z, T w)
|
|
||||||
{
|
|
||||||
return this->GetValue(x,y,z,w,this->m_resolution);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
T NzAbstract4DNoise<T>::GetMappedValue(T x, T y, T z, T w)
|
|
||||||
{
|
|
||||||
return (this->GetValue(x,y,z,w,this->m_resolution) + this->m_offset) * this->m_gain ;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
|
|
@ -8,33 +8,31 @@
|
||||||
#define COMPLEXNOISEBASE_HPP
|
#define COMPLEXNOISEBASE_HPP
|
||||||
|
|
||||||
#include <Nazara/Prerequesites.hpp>
|
#include <Nazara/Prerequesites.hpp>
|
||||||
|
#include <array>
|
||||||
|
|
||||||
template <typename T>
|
class NAZARA_API NzComplexNoiseBase
|
||||||
class NzComplexNoiseBase
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzComplexNoiseBase();
|
NzComplexNoiseBase();
|
||||||
~NzComplexNoiseBase() = default;
|
~NzComplexNoiseBase() = default;
|
||||||
|
|
||||||
T GetOctaveNumber() const;
|
const std::array<float, 30>& GetExponentArray() const; //For debug purpose
|
||||||
T GetLacunarity() const;
|
float GetHurstParameter() const;
|
||||||
T GetHurstParameter() const;
|
float GetLacunarity() const;
|
||||||
void SetLacunarity(T lacunarity);
|
float GetOctaveNumber() const;
|
||||||
void SetHurstParameter(T h);
|
void SetHurstParameter(float h);
|
||||||
void SetOctavesNumber(T octaves);
|
void SetLacunarity(float lacunarity);
|
||||||
|
void SetOctavesNumber(float octaves);
|
||||||
void RecomputeExponentArray();
|
void RecomputeExponentArray();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
T m_lacunarity;
|
float m_lacunarity;
|
||||||
T m_hurst;
|
float m_hurst;
|
||||||
T m_octaves;
|
float m_octaves;
|
||||||
T exponent_array[30];
|
std::array<float, 30> exponent_array;
|
||||||
T m_sum;
|
float m_sum;
|
||||||
private:
|
private:
|
||||||
bool m_parametersModified;
|
bool m_parametersModified;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#include<Nazara/Noise/ComplexNoiseBase.inl>
|
|
||||||
|
|
||||||
#endif // COMPLEXNOISEBASE_HPP
|
#endif // COMPLEXNOISEBASE_HPP
|
||||||
|
|
|
||||||
|
|
@ -11,23 +11,18 @@
|
||||||
#include <Nazara/Noise/ComplexNoiseBase.hpp>
|
#include <Nazara/Noise/ComplexNoiseBase.hpp>
|
||||||
#include <Nazara/Noise/Abstract2DNoise.hpp>
|
#include <Nazara/Noise/Abstract2DNoise.hpp>
|
||||||
|
|
||||||
template <typename T> class NzFBM2D : public NzAbstract2DNoise<T>, public NzComplexNoiseBase<T>
|
class NAZARA_API NzFBM2D : public NzAbstract2DNoise, public NzComplexNoiseBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzFBM2D(nzNoises source, int seed);
|
NzFBM2D(nzNoises source, int seed);
|
||||||
T GetValue(T x, T y, T resolution);
|
float GetValue(float x, float y, float resolution);
|
||||||
~NzFBM2D();
|
~NzFBM2D();
|
||||||
protected:
|
protected:
|
||||||
private:
|
private:
|
||||||
NzAbstract2DNoise<T>* m_source;
|
NzAbstract2DNoise* m_source;
|
||||||
T m_value;
|
float m_value;
|
||||||
T m_remainder;
|
float m_remainder;
|
||||||
nzNoises m_noiseType;
|
nzNoises m_noiseType;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NzFBM2D<float> NzFBM2Df;
|
|
||||||
typedef NzFBM2D<double> NzFBM2Dd;
|
|
||||||
|
|
||||||
#include <Nazara/Noise/FBM2D.inl>
|
|
||||||
|
|
||||||
#endif // FBM2DNOISE_HPP
|
#endif // FBM2DNOISE_HPP
|
||||||
|
|
|
||||||
|
|
@ -10,24 +10,22 @@
|
||||||
#include <Nazara/Prerequesites.hpp>
|
#include <Nazara/Prerequesites.hpp>
|
||||||
#include <Nazara/Noise/NoiseBase.hpp>
|
#include <Nazara/Noise/NoiseBase.hpp>
|
||||||
|
|
||||||
template <typename T> class NzMappedNoiseBase : public NzNoiseBase
|
class NAZARA_API NzMappedNoiseBase : public NzNoiseBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzMappedNoiseBase();
|
NzMappedNoiseBase();
|
||||||
~NzMappedNoiseBase() = default;
|
~NzMappedNoiseBase() = default;
|
||||||
|
|
||||||
T GetGain() const;
|
float GetGain() const;
|
||||||
T GetOffset() const;
|
float GetOffset() const;
|
||||||
T GetResolution() const;
|
float GetResolution() const;
|
||||||
void SetGain(T gain);
|
void SetGain(float gain);
|
||||||
void SetOffset(T offset);
|
void SetOffset(float offset);
|
||||||
void SetResolution(T resolution);
|
void SetResolution(float resolution);
|
||||||
protected:
|
protected:
|
||||||
T m_gain;
|
float m_gain;
|
||||||
T m_offset;
|
float m_offset;
|
||||||
T m_resolution;
|
float m_resolution;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <Nazara/Noise/MappedNoiseBase.inl>
|
|
||||||
|
|
||||||
#endif // NAZARA_MAPPEDNOISEBASE_HPP
|
#endif // NAZARA_MAPPEDNOISEBASE_HPP
|
||||||
|
|
|
||||||
|
|
@ -12,28 +12,23 @@
|
||||||
#include <Nazara/Noise/Abstract2DNoise.hpp>
|
#include <Nazara/Noise/Abstract2DNoise.hpp>
|
||||||
#include <Nazara/Math/Vector2.hpp>
|
#include <Nazara/Math/Vector2.hpp>
|
||||||
|
|
||||||
template <typename T> class NzPerlin2D : public NzAbstract2DNoise<T>
|
class NAZARA_API NzPerlin2D : public NzAbstract2DNoise
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzPerlin2D();
|
NzPerlin2D();
|
||||||
T GetValue(T x, T y, T resolution);
|
float GetValue(float x, float y, float resolution);
|
||||||
virtual ~NzPerlin2D() = default;
|
~NzPerlin2D() = default;
|
||||||
protected:
|
protected:
|
||||||
private:
|
private:
|
||||||
int x0, y0;
|
int x0, y0;
|
||||||
int gi0,gi1,gi2,gi3;
|
int gi0,gi1,gi2,gi3;
|
||||||
int ii, jj;
|
int ii, jj;
|
||||||
T gradient2[8][2];
|
float gradient2[8][2];
|
||||||
T s,t,u,v;
|
float s,t,u,v;
|
||||||
T Cx,Cy;
|
float Cx,Cy;
|
||||||
T Li1, Li2;
|
float Li1, Li2;
|
||||||
NzVector2<T> temp;
|
NzVector2<float> temp;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NzPerlin2D<float> NzPerlin2Df;
|
|
||||||
typedef NzPerlin2D<double> NzPerlin2Dd;
|
|
||||||
|
|
||||||
#include <Nazara/Noise/Perlin2D.inl>
|
|
||||||
|
|
||||||
#endif // PERLIN2D_HPP
|
#endif // PERLIN2D_HPP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,30 +12,24 @@
|
||||||
#include <Nazara/Noise/Abstract3DNoise.hpp>
|
#include <Nazara/Noise/Abstract3DNoise.hpp>
|
||||||
#include <Nazara/Math/Vector3.hpp>
|
#include <Nazara/Math/Vector3.hpp>
|
||||||
|
|
||||||
template <typename T> class NzPerlin3D : public NzAbstract3DNoise<T>
|
class NAZARA_API NzPerlin3D : public NzAbstract3DNoise
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzPerlin3D();
|
NzPerlin3D();
|
||||||
T GetValue(T x, T y, T z, T resolution);
|
float GetValue(float x, float y, float z, float resolution);
|
||||||
~NzPerlin3D() = default;
|
~NzPerlin3D() = default;
|
||||||
protected:
|
protected:
|
||||||
private:
|
private:
|
||||||
int x0,y0,z0;
|
int x0,y0,z0;
|
||||||
int gi0,gi1,gi2,gi3,gi4,gi5,gi6,gi7;
|
int gi0,gi1,gi2,gi3,gi4,gi5,gi6,gi7;
|
||||||
int ii,jj,kk;
|
int ii,jj,kk;
|
||||||
int gradient3[16][3];
|
float gradient3[16][3];
|
||||||
T Li1,Li2,Li3,Li4,Li5,Li6;
|
float Li1,Li2,Li3,Li4,Li5,Li6;
|
||||||
T s[2],t[2],u[2],v[2];
|
float s[2],t[2],u[2],v[2];
|
||||||
T Cx,Cy,Cz;
|
float Cx,Cy,Cz;
|
||||||
T nx,ny,nz;
|
float nx,ny,nz;
|
||||||
T tmp;
|
float tmp;
|
||||||
NzVector3<T> temp;
|
NzVector3<float> temp;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NzPerlin3D<float> NzPerlin3Df;
|
|
||||||
typedef NzPerlin3D<double> NzPerlin3Dd;
|
|
||||||
|
|
||||||
#include <Nazara/Noise/Perlin3D.inl>
|
|
||||||
|
|
||||||
#endif // PERLIN3D_HPP
|
#endif // PERLIN3D_HPP
|
||||||
|
|
|
||||||
|
|
@ -12,29 +12,23 @@
|
||||||
#include <Nazara/Noise/Abstract4DNoise.hpp>
|
#include <Nazara/Noise/Abstract4DNoise.hpp>
|
||||||
#include <Nazara/Math/Vector4.hpp>
|
#include <Nazara/Math/Vector4.hpp>
|
||||||
|
|
||||||
template <typename T> class NzPerlin4D : public NzAbstract4DNoise<T>
|
class NAZARA_API NzPerlin4D : public NzAbstract4DNoise
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzPerlin4D();
|
NzPerlin4D();
|
||||||
T GetValue(T x, T y, T z, T w, T resolution);
|
float GetValue(float x, float y, float z, float w, float resolution);
|
||||||
~NzPerlin4D() = default;
|
~NzPerlin4D() = default;
|
||||||
protected:
|
protected:
|
||||||
private:
|
private:
|
||||||
int x0,y0,z0,w0;
|
int x0,y0,z0,w0;
|
||||||
int gi0,gi1,gi2,gi3,gi4,gi5,gi6,gi7,gi8,gi9,gi10,gi11,gi12,gi13,gi14,gi15;
|
int gi0,gi1,gi2,gi3,gi4,gi5,gi6,gi7,gi8,gi9,gi10,gi11,gi12,gi13,gi14,gi15;
|
||||||
int ii,jj,kk,ll;
|
int ii,jj,kk,ll;
|
||||||
int gradient4[32][4];
|
float gradient4[32][4];
|
||||||
T Li1,Li2,Li3,Li4,Li5,Li6,Li7,Li8,Li9,Li10,Li11,Li12,Li13,Li14;
|
float Li1,Li2,Li3,Li4,Li5,Li6,Li7,Li8,Li9,Li10,Li11,Li12,Li13,Li14;
|
||||||
T s[4],t[4],u[4],v[4];
|
float s[4],t[4],u[4],v[4];
|
||||||
T Cx,Cy,Cz,Cw;
|
float Cx,Cy,Cz,Cw;
|
||||||
T tmp;
|
float tmp;
|
||||||
NzVector4<T> temp;
|
NzVector4<float> temp;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NzPerlin4D<float> NzPerlin4Df;
|
|
||||||
typedef NzPerlin4D<double> NzPerlin4Dd;
|
|
||||||
|
|
||||||
#include <Nazara/Noise/Perlin4D.inl>
|
|
||||||
|
|
||||||
#endif // PERLIN4D_HPP
|
#endif // PERLIN4D_HPP
|
||||||
|
|
|
||||||
|
|
@ -12,33 +12,26 @@
|
||||||
#include <Nazara/Noise/Abstract2DNoise.hpp>
|
#include <Nazara/Noise/Abstract2DNoise.hpp>
|
||||||
#include <Nazara/Math/Vector2.hpp>
|
#include <Nazara/Math/Vector2.hpp>
|
||||||
|
|
||||||
template <typename T> class NzSimplex2D : public NzAbstract2DNoise<T>
|
class NAZARA_API NzSimplex2D : public NzAbstract2DNoise
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzSimplex2D();
|
NzSimplex2D();
|
||||||
T GetValue(T x, T y, T resolution);
|
float GetValue(float x, float y, float resolution);
|
||||||
virtual ~NzSimplex2D() = default;
|
virtual ~NzSimplex2D() = default;
|
||||||
protected:
|
protected:
|
||||||
private:
|
private:
|
||||||
int ii,jj;
|
int ii,jj;
|
||||||
int gi0,gi1,gi2;
|
int gi0,gi1,gi2;
|
||||||
NzVector2i skewedCubeOrigin,off1;
|
NzVector2i skewedCubeOrigin,off1;
|
||||||
T n1,n2,n3;
|
float n1,n2,n3;
|
||||||
T c1,c2,c3;
|
float c1,c2,c3;
|
||||||
T gradient2[8][2];
|
float gradient2[8][2];
|
||||||
T UnskewCoeff2D;
|
float UnskewCoeff2D;
|
||||||
T SkewCoeff2D;
|
float SkewCoeff2D;
|
||||||
T sum;
|
float sum;
|
||||||
NzVector2<T> unskewedCubeOrigin, unskewedDistToOrigin;
|
NzVector2<float> unskewedCubeOrigin, unskewedDistToOrigin;
|
||||||
NzVector2<T> d1,d2,d3;
|
NzVector2<float> d1,d2,d3;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NzSimplex2D<float> NzSimplex2Df;
|
|
||||||
typedef NzSimplex2D<double> NzSimplex2Dd;
|
|
||||||
|
|
||||||
#include <Nazara/Noise/Simplex2D.inl>
|
|
||||||
|
|
||||||
#endif // SIMPLEX2D_HPP
|
#endif // SIMPLEX2D_HPP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,33 +12,26 @@
|
||||||
#include <Nazara/Noise/Abstract3DNoise.hpp>
|
#include <Nazara/Noise/Abstract3DNoise.hpp>
|
||||||
#include <Nazara/Math/Vector3.hpp>
|
#include <Nazara/Math/Vector3.hpp>
|
||||||
|
|
||||||
template <typename T> class NzSimplex3D : public NzAbstract3DNoise<T>
|
class NAZARA_API NzSimplex3D : public NzAbstract3DNoise
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzSimplex3D();
|
NzSimplex3D();
|
||||||
T GetValue(T x, T y, T z, T resolution);
|
float GetValue(float x, float y, float z, float resolution);
|
||||||
~NzSimplex3D() = default;
|
~NzSimplex3D() = default;
|
||||||
protected:
|
protected:
|
||||||
private:
|
private:
|
||||||
int ii,jj,kk;
|
int ii,jj,kk;
|
||||||
int gi0,gi1,gi2,gi3;
|
int gi0,gi1,gi2,gi3;
|
||||||
NzVector3i skewedCubeOrigin,off1,off2;
|
NzVector3i skewedCubeOrigin,off1,off2;
|
||||||
T n1,n2,n3,n4;
|
float n1,n2,n3,n4;
|
||||||
T c1,c2,c3,c4;
|
float c1,c2,c3,c4;
|
||||||
T gradient3[12][3];
|
float gradient3[12][3];
|
||||||
T UnskewCoeff3D;
|
float UnskewCoeff3D;
|
||||||
T SkewCoeff3D;
|
float SkewCoeff3D;
|
||||||
T sum;
|
float sum;
|
||||||
NzVector3<T> unskewedCubeOrigin, unskewedDistToOrigin;
|
NzVector3<float> unskewedCubeOrigin, unskewedDistToOrigin;
|
||||||
NzVector3<T> d1,d2,d3,d4;
|
NzVector3<float> d1,d2,d3,d4;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NzSimplex3D<float> NzSimplex3Df;
|
|
||||||
typedef NzSimplex3D<double> NzSimplex3Dd;
|
|
||||||
|
|
||||||
#include <Nazara/Noise/Simplex3D.inl>
|
|
||||||
|
|
||||||
#endif // SIMPLEX3D_HPP
|
#endif // SIMPLEX3D_HPP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,35 +12,28 @@
|
||||||
#include <Nazara/Noise/Abstract4DNoise.hpp>
|
#include <Nazara/Noise/Abstract4DNoise.hpp>
|
||||||
#include <Nazara/Math/Vector4.hpp>
|
#include <Nazara/Math/Vector4.hpp>
|
||||||
|
|
||||||
template <typename T> class NzSimplex4D : public NzAbstract4DNoise<T>
|
class NAZARA_API NzSimplex4D : public NzAbstract4DNoise
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzSimplex4D();
|
NzSimplex4D();
|
||||||
T GetValue(T x, T y, T z, T w, T resolution);
|
float GetValue(float x, float y, float z, float w, float resolution);
|
||||||
~NzSimplex4D() = default;
|
~NzSimplex4D() = default;
|
||||||
protected:
|
protected:
|
||||||
private:
|
private:
|
||||||
int ii,jj,kk,ll;
|
int ii,jj,kk,ll;
|
||||||
int gi0,gi1,gi2,gi3,gi4;
|
int gi0,gi1,gi2,gi3,gi4;
|
||||||
NzVector4i skewedCubeOrigin,off1,off2,off3;
|
NzVector4i skewedCubeOrigin,off1,off2,off3;
|
||||||
T n1,n2,n3,n4,n5;
|
|
||||||
T c1,c2,c3,c4,c5,c6;
|
|
||||||
T gradient4[32][4];
|
|
||||||
int lookupTable4D[64][4];
|
int lookupTable4D[64][4];
|
||||||
int c;
|
int c;
|
||||||
T UnskewCoeff4D;
|
float n1,n2,n3,n4,n5;
|
||||||
T SkewCoeff4D;
|
float c1,c2,c3,c4,c5,c6;
|
||||||
T sum;
|
float gradient4[32][4];
|
||||||
NzVector4<T> unskewedCubeOrigin, unskewedDistToOrigin;
|
float UnskewCoeff4D;
|
||||||
NzVector4<T> d1,d2,d3,d4,d5;
|
float SkewCoeff4D;
|
||||||
|
float sum;
|
||||||
|
NzVector4<float> unskewedCubeOrigin, unskewedDistToOrigin;
|
||||||
|
NzVector4<float> d1,d2,d3,d4,d5;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NzSimplex4D<float> NzSimplex4Df;
|
|
||||||
typedef NzSimplex4D<double> NzSimplex4Dd;
|
|
||||||
|
|
||||||
#include <Nazara/Noise/Simplex4D.inl>
|
|
||||||
|
|
||||||
#endif // SIMPLEX4D_H
|
#endif // SIMPLEX4D_H
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,17 +7,14 @@
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Noise/Config.hpp>
|
#include <Nazara/Noise/Config.hpp>
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
#include <Nazara/Noise/Abstract2DNoise.hpp>
|
||||||
|
|
||||||
template <typename T>
|
float NzAbstract2DNoise::GetBasicValue(float x, float y)
|
||||||
T NzAbstract2DNoise<T>::GetBasicValue(T x, T y)
|
|
||||||
{
|
{
|
||||||
return this->GetValue(x,y,this->m_resolution);
|
return this->GetValue(x,y,m_resolution);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzAbstract2DNoise::GetMappedValue(float x, float y)
|
||||||
T NzAbstract2DNoise<T>::GetMappedValue(T x, T y)
|
|
||||||
{
|
{
|
||||||
return (this->GetValue(x,y,this->m_resolution) + this->m_offset) * this->m_gain;
|
return (this->GetValue(x,y,m_resolution) + m_offset) * m_gain;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
|
|
@ -7,17 +7,14 @@
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Noise/Config.hpp>
|
#include <Nazara/Noise/Config.hpp>
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
#include <Nazara/Noise/Abstract3DNoise.hpp>
|
||||||
|
|
||||||
template <typename T>
|
float NzAbstract3DNoise::GetBasicValue(float x, float y, float z)
|
||||||
T NzAbstract3DNoise<T>::GetBasicValue(T x, T y, T z)
|
|
||||||
{
|
{
|
||||||
return this->GetValue(x,y,z,this->m_resolution);
|
return this->GetValue(x,y,z,m_resolution);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzAbstract3DNoise::GetMappedValue(float x, float y, float z)
|
||||||
T NzAbstract3DNoise<T>::GetMappedValue(T x, T y, T z)
|
|
||||||
{
|
{
|
||||||
return (this->GetValue(x,y,z,this->m_resolution) + this->m_offset) * this->m_gain ;
|
return (this->GetValue(x,y,z,m_resolution) + m_offset) * m_gain ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
// Copyright (C) 2012 Rémi Bèges
|
||||||
|
// This file is part of the "Nazara Engine".
|
||||||
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
|
#include <Nazara/Math/Basic.hpp>
|
||||||
|
#include <Nazara/Core/Error.hpp>
|
||||||
|
#include <Nazara/Noise/Config.hpp>
|
||||||
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
#include <Nazara/Noise/Abstract4DNoise.hpp>
|
||||||
|
|
||||||
|
float NzAbstract4DNoise::GetBasicValue(float x, float y, float z, float w)
|
||||||
|
{
|
||||||
|
return this->GetValue(x,y,z,w,m_resolution);
|
||||||
|
}
|
||||||
|
|
||||||
|
float NzAbstract4DNoise::GetMappedValue(float x, float y, float z, float w)
|
||||||
|
{
|
||||||
|
return (this->GetValue(x,y,z,w,m_resolution) + m_offset) * m_gain ;
|
||||||
|
}
|
||||||
|
|
@ -6,12 +6,9 @@
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Noise/Config.hpp>
|
#include <Nazara/Noise/Config.hpp>
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
#include <Nazara/Noise/ComplexNoiseBase.hpp>
|
||||||
|
|
||||||
#include <iostream>
|
NzComplexNoiseBase::NzComplexNoiseBase()
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
NzComplexNoiseBase<T>::NzComplexNoiseBase()
|
|
||||||
{
|
{
|
||||||
m_parametersModified = true;
|
m_parametersModified = true;
|
||||||
m_lacunarity = 5.0f;
|
m_lacunarity = 5.0f;
|
||||||
|
|
@ -24,27 +21,28 @@ NzComplexNoiseBase<T>::NzComplexNoiseBase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
const std::array<float, 30>& NzComplexNoiseBase::GetExponentArray() const
|
||||||
T NzComplexNoiseBase<T>::GetLacunarity() const
|
{
|
||||||
|
return exponent_array;
|
||||||
|
}
|
||||||
|
|
||||||
|
float NzComplexNoiseBase::GetLacunarity() const
|
||||||
{
|
{
|
||||||
|
|
||||||
return m_lacunarity;
|
return m_lacunarity;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzComplexNoiseBase::GetHurstParameter() const
|
||||||
T NzComplexNoiseBase<T>::GetHurstParameter() const
|
|
||||||
{
|
{
|
||||||
return m_hurst;
|
return m_hurst;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzComplexNoiseBase::GetOctaveNumber() const
|
||||||
T NzComplexNoiseBase<T>::GetOctaveNumber() const
|
|
||||||
{
|
{
|
||||||
return m_octaves;
|
return m_octaves;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
void NzComplexNoiseBase::SetLacunarity(float lacunarity)
|
||||||
void NzComplexNoiseBase<T>::SetLacunarity(T lacunarity)
|
|
||||||
{
|
{
|
||||||
// if(lacunarity != m_lacunarity)
|
// if(lacunarity != m_lacunarity)
|
||||||
//{
|
//{
|
||||||
|
|
@ -53,8 +51,7 @@ void NzComplexNoiseBase<T>::SetLacunarity(T lacunarity)
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
void NzComplexNoiseBase::SetHurstParameter(float h)
|
||||||
void NzComplexNoiseBase<T>::SetHurstParameter(T h)
|
|
||||||
{
|
{
|
||||||
//if(h != m_hurst)
|
//if(h != m_hurst)
|
||||||
//{
|
//{
|
||||||
|
|
@ -63,8 +60,7 @@ void NzComplexNoiseBase<T>::SetHurstParameter(T h)
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
void NzComplexNoiseBase::SetOctavesNumber(float octaves)
|
||||||
void NzComplexNoiseBase<T>::SetOctavesNumber(T octaves)
|
|
||||||
{
|
{
|
||||||
if(octaves <= 30.0f)
|
if(octaves <= 30.0f)
|
||||||
m_octaves = octaves;
|
m_octaves = octaves;
|
||||||
|
|
@ -75,28 +71,22 @@ void NzComplexNoiseBase<T>::SetOctavesNumber(T octaves)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
void NzComplexNoiseBase::RecomputeExponentArray()
|
||||||
void NzComplexNoiseBase<T>::RecomputeExponentArray()
|
|
||||||
{
|
{
|
||||||
if(m_parametersModified)
|
if(m_parametersModified)
|
||||||
{
|
{
|
||||||
cout<<"Recomputing exponent array"<<endl;
|
|
||||||
float frequency = 1.0;
|
float frequency = 1.0;
|
||||||
m_sum = 0.f;
|
m_sum = 0.f;
|
||||||
for (int i(0) ; i < static_cast<int>(m_octaves) ; ++i)
|
for (int i(0) ; i < static_cast<int>(m_octaves) ; ++i)
|
||||||
{
|
{
|
||||||
|
|
||||||
exponent_array[i] = std::pow( frequency, -m_hurst );
|
exponent_array[i] = std::pow( frequency, -m_hurst );
|
||||||
cout<<"expo["<<i<<"] : "<<exponent_array[i]<<endl;
|
|
||||||
frequency *= m_lacunarity;
|
frequency *= m_lacunarity;
|
||||||
|
|
||||||
//m_sum += 1.0f/exponent_array[i];//A tester
|
//m_sum += 1.0f/exponent_array[i];//A tester
|
||||||
m_sum += exponent_array[i];
|
m_sum += exponent_array[i];
|
||||||
|
|
||||||
}
|
}
|
||||||
cout<<"sum = "<<m_sum<<endl;
|
|
||||||
m_parametersModified = false;
|
m_parametersModified = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
|
|
@ -4,25 +4,21 @@
|
||||||
|
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Noise/Config.hpp>
|
#include <Nazara/Noise/Config.hpp>
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
#include <Nazara/Noise/FBM2D.hpp>
|
||||||
|
|
||||||
#include <Nazara/Noise/Perlin2D.hpp>
|
#include <Nazara/Noise/Perlin2D.hpp>
|
||||||
#include <Nazara/Noise/Simplex2D.hpp>
|
#include <Nazara/Noise/Simplex2D.hpp>
|
||||||
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
|
||||||
#include <iostream>
|
NzFBM2D::NzFBM2D(nzNoises source, int seed)
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
NzFBM2D<T>::NzFBM2D(nzNoises source, int seed) : NzComplexNoiseBase<T>()
|
|
||||||
{
|
{
|
||||||
switch(source)
|
switch(source)
|
||||||
{
|
{
|
||||||
case PERLIN:
|
case PERLIN:
|
||||||
m_source = new NzPerlin2D<T>;
|
m_source = new NzPerlin2D();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
m_source = new NzSimplex2D<T>;
|
m_source = new NzSimplex2D();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_source->SetNewSeed(seed);
|
m_source->SetNewSeed(seed);
|
||||||
|
|
@ -30,8 +26,7 @@ NzFBM2D<T>::NzFBM2D(nzNoises source, int seed) : NzComplexNoiseBase<T>()
|
||||||
m_noiseType = source;
|
m_noiseType = source;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzFBM2D::GetValue(float x, float y, float resolution)
|
||||||
T NzFBM2D<T>::GetValue(T x, T y, T resolution)
|
|
||||||
{
|
{
|
||||||
this->RecomputeExponentArray();
|
this->RecomputeExponentArray();
|
||||||
|
|
||||||
|
|
@ -45,26 +40,23 @@ T NzFBM2D<T>::GetValue(T x, T y, T resolution)
|
||||||
//cout<<m_value<<endl;//"|"<<this->m_sum<<endl;
|
//cout<<m_value<<endl;//"|"<<this->m_sum<<endl;
|
||||||
//m_remainder = this->m_octaves - static_cast<int>(this->m_octaves);
|
//m_remainder = this->m_octaves - static_cast<int>(this->m_octaves);
|
||||||
|
|
||||||
//if(!NzNumberEquals(remainder, static_cast<T>(0.0)))
|
//if(!NzNumberEquals(remainder, static_cast<float>(0.0)))
|
||||||
// m_value += remainder * Get2DSimplexNoiseValue(x,y,resolution) * exponent_array[(int)m_octaves-1];
|
// m_value += remainder * Get2DSimplexNoiseValue(x,y,resolution) * exponent_array[(int)m_octaves-1];
|
||||||
|
|
||||||
//0.65 is an experimental value to make the noise stick closer to [-1 , 1]
|
//0.65 is an experimental value to make the noise stick closer to [-1 , 1]
|
||||||
return m_value / (this->m_sum * 0.65);
|
return m_value / (this->m_sum * 0.65);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
NzFBM2D::~NzFBM2D()
|
||||||
NzFBM2D<T>::~NzFBM2D()
|
|
||||||
{
|
{
|
||||||
switch(m_noiseType)
|
switch(m_noiseType)
|
||||||
{
|
{
|
||||||
case PERLIN:
|
case PERLIN:
|
||||||
delete dynamic_cast<NzPerlin2D<T>*>(m_source);
|
delete dynamic_cast<NzPerlin2D*>(m_source);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
delete dynamic_cast<NzSimplex2D<T>*>(m_source);
|
delete dynamic_cast<NzSimplex2D*>(m_source);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
|
|
@ -8,48 +8,41 @@
|
||||||
#include <Nazara/Noise/Config.hpp>
|
#include <Nazara/Noise/Config.hpp>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
#include <Nazara/Noise/MappedNoiseBase.hpp>
|
||||||
|
|
||||||
|
NzMappedNoiseBase::NzMappedNoiseBase() : m_gain(1.f), m_offset(0.f), m_resolution(30.f)
|
||||||
template <typename T>
|
|
||||||
NzMappedNoiseBase<T>::NzMappedNoiseBase() : m_gain(1), m_offset(0), m_resolution(30)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzMappedNoiseBase::GetGain() const
|
||||||
T NzMappedNoiseBase<T>::GetGain() const
|
|
||||||
{
|
{
|
||||||
return m_gain;
|
return m_gain;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzMappedNoiseBase::GetOffset() const
|
||||||
T NzMappedNoiseBase<T>::GetOffset() const
|
|
||||||
{
|
{
|
||||||
return m_offset;
|
return m_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzMappedNoiseBase::GetResolution() const
|
||||||
T NzMappedNoiseBase<T>::GetResolution() const
|
|
||||||
{
|
{
|
||||||
return m_resolution;
|
return m_resolution;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
void NzMappedNoiseBase::SetGain(float gain)
|
||||||
void NzMappedNoiseBase<T>::SetGain(T gain)
|
|
||||||
{
|
{
|
||||||
m_gain = gain;
|
m_gain = gain;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
void NzMappedNoiseBase::SetOffset(float offset)
|
||||||
void NzMappedNoiseBase<T>::SetOffset(T offset)
|
|
||||||
{
|
{
|
||||||
m_offset = offset;
|
m_offset = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
void NzMappedNoiseBase::SetResolution(float resolution)
|
||||||
void NzMappedNoiseBase<T>::SetResolution(T resolution)
|
|
||||||
{
|
{
|
||||||
if (NzNumberEquals(resolution, static_cast<T>(0.0)))
|
if (NzNumberEquals(resolution, 0.f))
|
||||||
{
|
{
|
||||||
NzStringStream ss;
|
NzStringStream ss;
|
||||||
ss << __FILE__ << ':' << __LINE__ << " : resolution cannot be 0.0f";
|
ss << __FILE__ << ':' << __LINE__ << " : resolution cannot be 0.0f";
|
||||||
|
|
@ -58,5 +51,3 @@ void NzMappedNoiseBase<T>::SetResolution(T resolution)
|
||||||
}
|
}
|
||||||
m_resolution = resolution;
|
m_resolution = resolution;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Noise/Config.hpp>
|
#include <Nazara/Noise/Config.hpp>
|
||||||
|
#include <Nazara/Noise/Perlin2D.hpp>
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
|
||||||
template <typename T>
|
NzPerlin2D::NzPerlin2D()
|
||||||
NzPerlin2D<T>::NzPerlin2D()
|
|
||||||
{
|
{
|
||||||
T grad2Temp[][2] = {{1,1},{-1,1},{1,-1},{-1,-1},
|
int grad2Temp[][2] = {{1,1},{-1,1},{1,-1},{-1,-1},
|
||||||
{1,0},{-1,0},{0,1},{0,-1}};
|
{1,0},{-1,0},{0,1},{0,-1}};
|
||||||
|
|
||||||
for(int i(0) ; i < 8 ; ++i)
|
for(int i(0) ; i < 8 ; ++i)
|
||||||
|
|
@ -17,22 +17,21 @@ NzPerlin2D<T>::NzPerlin2D()
|
||||||
gradient2[i][j] = grad2Temp[i][j];
|
gradient2[i][j] = grad2Temp[i][j];
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzPerlin2D::GetValue(float x, float y, float resolution)
|
||||||
T NzPerlin2D<T>::GetValue(T x, T y, T resolution)
|
|
||||||
{
|
{
|
||||||
x *= resolution;
|
x *= resolution;
|
||||||
y *= resolution;
|
y *= resolution;
|
||||||
|
|
||||||
x0 = this->fastfloor(x);
|
x0 = fastfloor(x);
|
||||||
y0 = this->fastfloor(y);
|
y0 = fastfloor(y);
|
||||||
|
|
||||||
ii = x0 & 255;
|
ii = x0 & 255;
|
||||||
jj = y0 & 255;
|
jj = y0 & 255;
|
||||||
|
|
||||||
gi0 = this->perm[ii + this->perm[jj]] & 7;
|
gi0 = perm[ii + perm[jj]] & 7;
|
||||||
gi1 = this->perm[ii + 1 + this->perm[jj]] & 7;
|
gi1 = perm[ii + 1 + perm[jj]] & 7;
|
||||||
gi2 = this->perm[ii + this->perm[jj + 1]] & 7;
|
gi2 = perm[ii + perm[jj + 1]] & 7;
|
||||||
gi3 = this->perm[ii + 1 + this->perm[jj + 1]] & 7;
|
gi3 = perm[ii + 1 + perm[jj + 1]] & 7;
|
||||||
|
|
||||||
temp.x = x-x0;
|
temp.x = x-x0;
|
||||||
temp.y = y-y0;
|
temp.y = y-y0;
|
||||||
|
|
@ -56,5 +55,3 @@ T NzPerlin2D<T>::GetValue(T x, T y, T resolution)
|
||||||
|
|
||||||
return Li1 + Cy*(Li2-Li1);
|
return Li1 + Cy*(Li2-Li1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Noise/Config.hpp>
|
#include <Nazara/Noise/Config.hpp>
|
||||||
|
#include <Nazara/Noise/Perlin3D.hpp>
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
|
||||||
template <typename T>
|
NzPerlin3D::NzPerlin3D()
|
||||||
NzPerlin3D<T>::NzPerlin3D()
|
|
||||||
{
|
{
|
||||||
int grad3Temp[][3] = {
|
float grad3Temp[][3] = {
|
||||||
{1,1,0},{-1,1,0},{1,-1,0},{-1,-1,0},
|
{1,1,0},{-1,1,0},{1,-1,0},{-1,-1,0},
|
||||||
{1,0,1},{-1,0,1},{1,0,-1},{-1,0,-1},
|
{1,0,1},{-1,0,1},{1,0,-1},{-1,0,-1},
|
||||||
{0,1,1},{0,-1,1},{0,1,-1},{0,-1,-1},
|
{0,1,1},{0,-1,1},{0,1,-1},{0,-1,-1},
|
||||||
|
|
@ -21,30 +21,29 @@ NzPerlin3D<T>::NzPerlin3D()
|
||||||
gradient3[i][j] = grad3Temp[i][j];
|
gradient3[i][j] = grad3Temp[i][j];
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzPerlin3D::GetValue(float x, float y, float z, float resolution)
|
||||||
T NzPerlin3D<T>::GetValue(T x, T y, T z, T resolution)
|
|
||||||
{
|
{
|
||||||
x /= resolution;
|
x /= resolution;
|
||||||
y /= resolution;
|
y /= resolution;
|
||||||
z /= resolution;
|
z /= resolution;
|
||||||
|
|
||||||
x0 = this->fastfloor(x);
|
x0 = fastfloor(x);
|
||||||
y0 = this->fastfloor(y);
|
y0 = fastfloor(y);
|
||||||
z0 = this->fastfloor(z);
|
z0 = fastfloor(z);
|
||||||
|
|
||||||
ii = x0 & 255;
|
ii = x0 & 255;
|
||||||
jj = y0 & 255;
|
jj = y0 & 255;
|
||||||
kk = z0 & 255;
|
kk = z0 & 255;
|
||||||
|
|
||||||
gi0 = this->perm[ii + this->perm[jj + this->perm[kk]]] & 15;
|
gi0 = perm[ii + perm[jj + perm[kk]]] & 15;
|
||||||
gi1 = this->perm[ii + 1 + this->perm[jj + this->perm[kk]]] & 15;
|
gi1 = perm[ii + 1 + perm[jj + perm[kk]]] & 15;
|
||||||
gi2 = this->perm[ii + this->perm[jj + 1 + this->perm[kk]]] & 15;
|
gi2 = perm[ii + perm[jj + 1 + perm[kk]]] & 15;
|
||||||
gi3 = this->perm[ii + 1 + this->perm[jj + 1 + this->perm[kk]]] & 15;
|
gi3 = perm[ii + 1 + perm[jj + 1 + perm[kk]]] & 15;
|
||||||
|
|
||||||
gi4 = this->perm[ii + this->perm[jj + this->perm[kk + 1]]] & 15;
|
gi4 = perm[ii + perm[jj + perm[kk + 1]]] & 15;
|
||||||
gi5 = this->perm[ii + 1 + this->perm[jj + this->perm[kk + 1]]] & 15;
|
gi5 = perm[ii + 1 + perm[jj + perm[kk + 1]]] & 15;
|
||||||
gi6 = this->perm[ii + this->perm[jj + 1 + this->perm[kk + 1]]] & 15;
|
gi6 = perm[ii + perm[jj + 1 + perm[kk + 1]]] & 15;
|
||||||
gi7 = this->perm[ii + 1 + this->perm[jj + 1 + this->perm[kk + 1]]] & 15;
|
gi7 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1]]] & 15;
|
||||||
|
|
||||||
temp.x = x-x0;
|
temp.x = x-x0;
|
||||||
temp.y = y-y0;
|
temp.y = y-y0;
|
||||||
|
|
@ -88,5 +87,3 @@ T NzPerlin3D<T>::GetValue(T x, T y, T z, T resolution)
|
||||||
|
|
||||||
return Li5 + Cz*(Li6-Li5);
|
return Li5 + Cz*(Li6-Li5);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Noise/Config.hpp>
|
#include <Nazara/Noise/Config.hpp>
|
||||||
|
#include <Nazara/Noise/Perlin4D.hpp>
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
|
||||||
template <typename T>
|
NzPerlin4D::NzPerlin4D()
|
||||||
NzPerlin4D<T>::NzPerlin4D()
|
|
||||||
{
|
{
|
||||||
int grad4Temp[][4] =
|
float grad4Temp[][4] =
|
||||||
{
|
{
|
||||||
{0,1,1,1}, {0,1,1,-1}, {0,1,-1,1}, {0,1,-1,-1},
|
{0,1,1,1}, {0,1,1,-1}, {0,1,-1,1}, {0,1,-1,-1},
|
||||||
{0,-1,1,1},{0,-1,1,-1},{0,-1,-1,1},{0,-1,-1,-1},
|
{0,-1,1,1},{0,-1,1,-1},{0,-1,-1,1},{0,-1,-1,-1},
|
||||||
|
|
@ -26,43 +26,42 @@ NzPerlin4D<T>::NzPerlin4D()
|
||||||
gradient4[i][j] = grad4Temp[i][j];
|
gradient4[i][j] = grad4Temp[i][j];
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzPerlin4D::GetValue(float x, float y, float z, float w, float resolution)
|
||||||
T NzPerlin4D<T>::GetValue(T x, T y, T z, T w, T resolution)
|
|
||||||
{
|
{
|
||||||
x *= resolution;
|
x *= resolution;
|
||||||
y *= resolution;
|
y *= resolution;
|
||||||
z *= resolution;
|
z *= resolution;
|
||||||
w *= resolution;
|
w *= resolution;
|
||||||
|
|
||||||
x0 = this->fastfloor(x);
|
x0 = fastfloor(x);
|
||||||
y0 = this->fastfloor(y);
|
y0 = fastfloor(y);
|
||||||
z0 = this->fastfloor(z);
|
z0 = fastfloor(z);
|
||||||
w0 = this->fastfloor(w);
|
w0 = fastfloor(w);
|
||||||
|
|
||||||
ii = x0 & 255;
|
ii = x0 & 255;
|
||||||
jj = y0 & 255;
|
jj = y0 & 255;
|
||||||
kk = z0 & 255;
|
kk = z0 & 255;
|
||||||
ll = w0 & 255;
|
ll = w0 & 255;
|
||||||
|
|
||||||
gi0 = this->perm[ii + this->perm[jj + this->perm[kk + this->perm[ll]]]] & 31;
|
gi0 = perm[ii + perm[jj + perm[kk + perm[ll]]]] & 31;
|
||||||
gi1 = this->perm[ii + 1 + this->perm[jj + this->perm[kk + this->perm[ll]]]] & 31;
|
gi1 = perm[ii + 1 + perm[jj + perm[kk + perm[ll]]]] & 31;
|
||||||
gi2 = this->perm[ii + this->perm[jj + 1 + this->perm[kk + this->perm[ll]]]] & 31;
|
gi2 = perm[ii + perm[jj + 1 + perm[kk + perm[ll]]]] & 31;
|
||||||
gi3 = this->perm[ii + 1 + this->perm[jj + 1 + this->perm[kk + this->perm[ll]]]] & 31;
|
gi3 = perm[ii + 1 + perm[jj + 1 + perm[kk + perm[ll]]]] & 31;
|
||||||
|
|
||||||
gi4 = this->perm[ii + this->perm[jj + + this->perm[kk + 1 + this->perm[ll]]]] & 31;
|
gi4 = perm[ii + perm[jj + + perm[kk + 1 + perm[ll]]]] & 31;
|
||||||
gi5 = this->perm[ii + 1 + this->perm[jj + + this->perm[kk + 1 + this->perm[ll]]]] & 31;
|
gi5 = perm[ii + 1 + perm[jj + + perm[kk + 1 + perm[ll]]]] & 31;
|
||||||
gi6 = this->perm[ii + this->perm[jj + 1 + this->perm[kk + 1 + this->perm[ll]]]] & 31;
|
gi6 = perm[ii + perm[jj + 1 + perm[kk + 1 + perm[ll]]]] & 31;
|
||||||
gi7 = this->perm[ii + 1 + this->perm[jj + 1 + this->perm[kk + 1 + this->perm[ll]]]] & 31;
|
gi7 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll]]]] & 31;
|
||||||
|
|
||||||
gi8 = this->perm[ii + this->perm[jj + this->perm[kk + this->perm[ll + 1]]]] & 31;
|
gi8 = perm[ii + perm[jj + perm[kk + perm[ll + 1]]]] & 31;
|
||||||
gi9 = this->perm[ii + 1 + this->perm[jj + this->perm[kk + this->perm[ll + 1]]]] & 31;
|
gi9 = perm[ii + 1 + perm[jj + perm[kk + perm[ll + 1]]]] & 31;
|
||||||
gi10 = this->perm[ii + this->perm[jj + 1 + this->perm[kk + this->perm[ll + 1]]]] & 31;
|
gi10 = perm[ii + perm[jj + 1 + perm[kk + perm[ll + 1]]]] & 31;
|
||||||
gi11 = this->perm[ii + 1 + this->perm[jj + 1 + this->perm[kk + this->perm[ll + 1]]]] & 31;
|
gi11 = perm[ii + 1 + perm[jj + 1 + perm[kk + perm[ll + 1]]]] & 31;
|
||||||
|
|
||||||
gi12 = this->perm[ii + this->perm[jj + this->perm[kk + 1 + this->perm[ll + 1]]]] & 31;
|
gi12 = perm[ii + perm[jj + perm[kk + 1 + perm[ll + 1]]]] & 31;
|
||||||
gi13 = this->perm[ii + 1 + this->perm[jj + this->perm[kk + 1 + this->perm[ll + 1]]]] & 31;
|
gi13 = perm[ii + 1 + perm[jj + perm[kk + 1 + perm[ll + 1]]]] & 31;
|
||||||
gi14 = this->perm[ii + this->perm[jj + 1 + this->perm[kk + 1 + this->perm[ll + 1]]]] & 31;
|
gi14 = perm[ii + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] & 31;
|
||||||
gi15 = this->perm[ii + 1 + this->perm[jj + 1 + this->perm[kk + 1 + this->perm[ll + 1]]]] & 31;
|
gi15 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] & 31;
|
||||||
|
|
||||||
temp.x = x-x0;
|
temp.x = x-x0;
|
||||||
temp.y = y-y0;
|
temp.y = y-y0;
|
||||||
|
|
@ -146,5 +145,3 @@ T NzPerlin4D<T>::GetValue(T x, T y, T z, T w, T resolution)
|
||||||
|
|
||||||
return Li13 + Cw*(Li14-Li13);
|
return Li13 + Cw*(Li14-Li13);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Noise/Config.hpp>
|
#include <Nazara/Noise/Config.hpp>
|
||||||
|
#include <Nazara/Noise/Simplex2D.hpp>
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
|
||||||
template <typename T>
|
NzSimplex2D::NzSimplex2D()
|
||||||
NzSimplex2D<T>::NzSimplex2D()
|
|
||||||
{
|
{
|
||||||
T grad2Temp[][2] = {{1,1},{-1,1},{1,-1},{-1,-1},
|
float grad2Temp[][2] = {{1,1},{-1,1},{1,-1},{-1,-1},
|
||||||
{1,0},{-1,0},{0,1},{0,-1}};
|
{1,0},{-1,0},{0,1},{0,-1}};
|
||||||
|
|
||||||
for(int i(0) ; i < 8 ; ++i)
|
for(int i(0) ; i < 8 ; ++i)
|
||||||
|
|
@ -20,15 +20,14 @@ NzSimplex2D<T>::NzSimplex2D()
|
||||||
UnskewCoeff2D = (3.0-sqrt(3.0))/6.;
|
UnskewCoeff2D = (3.0-sqrt(3.0))/6.;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzSimplex2D::GetValue(float x, float y, float resolution)
|
||||||
T NzSimplex2D<T>::GetValue(T x, T y, T resolution)
|
|
||||||
{
|
{
|
||||||
x *= resolution;
|
x *= resolution;
|
||||||
y *= resolution;
|
y *= resolution;
|
||||||
|
|
||||||
sum = (x + y) * SkewCoeff2D;
|
sum = (x + y) * SkewCoeff2D;
|
||||||
skewedCubeOrigin.x = this->fastfloor(x + sum);
|
skewedCubeOrigin.x = fastfloor(x + sum);
|
||||||
skewedCubeOrigin.y = this->fastfloor(y + sum);
|
skewedCubeOrigin.y = fastfloor(y + sum);
|
||||||
|
|
||||||
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y) * UnskewCoeff2D;
|
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y) * UnskewCoeff2D;
|
||||||
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
|
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
|
||||||
|
|
@ -59,9 +58,9 @@ T NzSimplex2D<T>::GetValue(T x, T y, T resolution)
|
||||||
ii = skewedCubeOrigin.x & 255;
|
ii = skewedCubeOrigin.x & 255;
|
||||||
jj = skewedCubeOrigin.y & 255;
|
jj = skewedCubeOrigin.y & 255;
|
||||||
|
|
||||||
gi0 = this->perm[ii + this->perm[jj ]] & 7;
|
gi0 = perm[ii + perm[jj ]] & 7;
|
||||||
gi1 = this->perm[ii + off1.x + this->perm[jj + off1.y]] & 7;
|
gi1 = perm[ii + off1.x + perm[jj + off1.y]] & 7;
|
||||||
gi2 = this->perm[ii + 1 + this->perm[jj + 1 ]] & 7;
|
gi2 = perm[ii + 1 + perm[jj + 1 ]] & 7;
|
||||||
|
|
||||||
c1 = 0.5 - d1.x * d1.x - d1.y * d1.y;
|
c1 = 0.5 - d1.x * d1.x - d1.y * d1.y;
|
||||||
c2 = 0.5 - d2.x * d2.x - d2.y * d2.y;
|
c2 = 0.5 - d2.x * d2.x - d2.y * d2.y;
|
||||||
|
|
@ -84,5 +83,3 @@ T NzSimplex2D<T>::GetValue(T x, T y, T resolution)
|
||||||
|
|
||||||
return (n1+n2+n3)*70;
|
return (n1+n2+n3)*70;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
|
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Noise/Config.hpp>
|
#include <Nazara/Noise/Config.hpp>
|
||||||
|
#include <Nazara/Noise/Simplex3D.hpp>
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
|
||||||
template <typename T>
|
NzSimplex3D::NzSimplex3D()
|
||||||
NzSimplex3D<T>::NzSimplex3D()
|
|
||||||
{
|
{
|
||||||
SkewCoeff3D = 1/3.;
|
SkewCoeff3D = 1/3.;
|
||||||
UnskewCoeff3D = 1/6.;
|
UnskewCoeff3D = 1/6.;
|
||||||
|
|
@ -21,17 +21,16 @@ NzSimplex3D<T>::NzSimplex3D()
|
||||||
gradient3[i][j] = grad3Temp[i][j];
|
gradient3[i][j] = grad3Temp[i][j];
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzSimplex3D::GetValue(float x, float y, float z, float resolution)
|
||||||
T NzSimplex3D<T>::GetValue(T x, T y, T z, T resolution)
|
|
||||||
{
|
{
|
||||||
x *= resolution;
|
x *= resolution;
|
||||||
y *= resolution;
|
y *= resolution;
|
||||||
z *= resolution;
|
z *= resolution;
|
||||||
|
|
||||||
sum = (x + y + z) * SkewCoeff3D;
|
sum = (x + y + z) * SkewCoeff3D;
|
||||||
skewedCubeOrigin.x = this->fastfloor(x + sum);
|
skewedCubeOrigin.x = fastfloor(x + sum);
|
||||||
skewedCubeOrigin.y = this->fastfloor(y + sum);
|
skewedCubeOrigin.y = fastfloor(y + sum);
|
||||||
skewedCubeOrigin.z = this->fastfloor(z + sum);
|
skewedCubeOrigin.z = fastfloor(z + sum);
|
||||||
|
|
||||||
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y + skewedCubeOrigin.z) * UnskewCoeff3D;
|
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y + skewedCubeOrigin.z) * UnskewCoeff3D;
|
||||||
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
|
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
|
||||||
|
|
@ -121,10 +120,10 @@ T NzSimplex3D<T>::GetValue(T x, T y, T z, T resolution)
|
||||||
jj = skewedCubeOrigin.y & 255;
|
jj = skewedCubeOrigin.y & 255;
|
||||||
kk = skewedCubeOrigin.z & 255;
|
kk = skewedCubeOrigin.z & 255;
|
||||||
|
|
||||||
gi0 = this->perm[ii + this->perm[jj + this->perm[kk ]]] % 12;
|
gi0 = perm[ii + perm[jj + perm[kk ]]] % 12;
|
||||||
gi1 = this->perm[ii + off1.x + this->perm[jj + off1.y + this->perm[kk + off1.z]]] % 12;
|
gi1 = perm[ii + off1.x + perm[jj + off1.y + perm[kk + off1.z]]] % 12;
|
||||||
gi2 = this->perm[ii + off2.x + this->perm[jj + off2.y + this->perm[kk + off2.z]]] % 12;
|
gi2 = perm[ii + off2.x + perm[jj + off2.y + perm[kk + off2.z]]] % 12;
|
||||||
gi3 = this->perm[ii + 1 + this->perm[jj + 1 + this->perm[kk + 1 ]]] % 12;
|
gi3 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 ]]] % 12;
|
||||||
|
|
||||||
c1 = 0.6 - d1.x * d1.x - d1.y * d1.y - d1.z * d1.z;
|
c1 = 0.6 - d1.x * d1.x - d1.y * d1.y - d1.z * d1.z;
|
||||||
c2 = 0.6 - d2.x * d2.x - d2.y * d2.y - d2.z * d2.z;
|
c2 = 0.6 - d2.x * d2.x - d2.y * d2.y - d2.z * d2.z;
|
||||||
|
|
@ -153,5 +152,3 @@ T NzSimplex3D<T>::GetValue(T x, T y, T z, T resolution)
|
||||||
|
|
||||||
return (n1+n2+n3+n4)*32;
|
return (n1+n2+n3+n4)*32;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
|
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Noise/Config.hpp>
|
#include <Nazara/Noise/Config.hpp>
|
||||||
|
#include <Nazara/Noise/Simplex4D.hpp>
|
||||||
#include <Nazara/Noise/Debug.hpp>
|
#include <Nazara/Noise/Debug.hpp>
|
||||||
|
|
||||||
template <typename T>
|
NzSimplex4D::NzSimplex4D()
|
||||||
NzSimplex4D<T>::NzSimplex4D()
|
|
||||||
{
|
{
|
||||||
SkewCoeff4D = (sqrt(5.) - 1.)/4.;
|
SkewCoeff4D = (sqrt(5.) - 1.)/4.;
|
||||||
UnskewCoeff4D = (5. - sqrt(5.))/20.;
|
UnskewCoeff4D = (5. - sqrt(5.))/20.;
|
||||||
|
|
@ -45,8 +45,7 @@ NzSimplex4D<T>::NzSimplex4D()
|
||||||
gradient4[i][j] = grad4Temp[i][j];
|
gradient4[i][j] = grad4Temp[i][j];
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
float NzSimplex4D::GetValue(float x, float y, float z, float w, float resolution)
|
||||||
T NzSimplex4D<T>::GetValue(T x, T y, T z, T w, T resolution)
|
|
||||||
{
|
{
|
||||||
x *= resolution;
|
x *= resolution;
|
||||||
y *= resolution;
|
y *= resolution;
|
||||||
|
|
@ -54,10 +53,10 @@ T NzSimplex4D<T>::GetValue(T x, T y, T z, T w, T resolution)
|
||||||
w *= resolution;
|
w *= resolution;
|
||||||
|
|
||||||
sum = (x + y + z + w) * SkewCoeff4D;
|
sum = (x + y + z + w) * SkewCoeff4D;
|
||||||
skewedCubeOrigin.x = this->fastfloor(x + sum);
|
skewedCubeOrigin.x = fastfloor(x + sum);
|
||||||
skewedCubeOrigin.y = this->fastfloor(y + sum);
|
skewedCubeOrigin.y = fastfloor(y + sum);
|
||||||
skewedCubeOrigin.z = this->fastfloor(z + sum);
|
skewedCubeOrigin.z = fastfloor(z + sum);
|
||||||
skewedCubeOrigin.w = this->fastfloor(w + sum);
|
skewedCubeOrigin.w = fastfloor(w + sum);
|
||||||
|
|
||||||
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y + skewedCubeOrigin.z + skewedCubeOrigin.w) * UnskewCoeff4D;
|
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y + skewedCubeOrigin.z + skewedCubeOrigin.w) * UnskewCoeff4D;
|
||||||
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
|
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
|
||||||
|
|
@ -120,11 +119,11 @@ T NzSimplex4D<T>::GetValue(T x, T y, T z, T w, T resolution)
|
||||||
kk = skewedCubeOrigin.z & 255;
|
kk = skewedCubeOrigin.z & 255;
|
||||||
ll = skewedCubeOrigin.w & 255;
|
ll = skewedCubeOrigin.w & 255;
|
||||||
|
|
||||||
gi0 = this->perm[ii + this->perm[jj + this->perm[kk + this->perm[ll]]]] & 31;
|
gi0 = perm[ii + perm[jj + perm[kk + perm[ll]]]] & 31;
|
||||||
gi1 = this->perm[ii + off1.x + this->perm[jj + off1.y + this->perm[kk + off1.z + this->perm[ll + off1.w]]]] & 31;
|
gi1 = perm[ii + off1.x + perm[jj + off1.y + perm[kk + off1.z + perm[ll + off1.w]]]] & 31;
|
||||||
gi2 = this->perm[ii + off2.x + this->perm[jj + off2.y + this->perm[kk + off2.z + this->perm[ll + off2.w]]]] & 31;
|
gi2 = perm[ii + off2.x + perm[jj + off2.y + perm[kk + off2.z + perm[ll + off2.w]]]] & 31;
|
||||||
gi3 = this->perm[ii + off3.x + this->perm[jj + off3.y + this->perm[kk + off3.z + this->perm[ll + off3.w]]]] & 31;
|
gi3 = perm[ii + off3.x + perm[jj + off3.y + perm[kk + off3.z + perm[ll + off3.w]]]] & 31;
|
||||||
gi4 = this->perm[ii + 1 + this->perm[jj + 1 + this->perm[kk + 1 + this->perm[ll + 1]]]] % 32;
|
gi4 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32;
|
||||||
|
|
||||||
c1 = 0.6 - d1.x*d1.x - d1.y*d1.y - d1.z*d1.z - d1.w*d1.w;
|
c1 = 0.6 - d1.x*d1.x - d1.y*d1.y - d1.z*d1.z - d1.w*d1.w;
|
||||||
c2 = 0.6 - d2.x*d2.x - d2.y*d2.y - d2.z*d2.z - d2.w*d2.w;
|
c2 = 0.6 - d2.x*d2.x - d2.y*d2.y - d2.z*d2.z - d2.w*d2.w;
|
||||||
|
|
@ -159,5 +158,3 @@ T NzSimplex4D<T>::GetValue(T x, T y, T z, T w, T resolution)
|
||||||
|
|
||||||
return (n1+n2+n3+n4+n5)*27.0;
|
return (n1+n2+n3+n4+n5)*27.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
|
||||||
Loading…
Reference in New Issue