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:
Remi Beges
2012-10-27 18:59:39 +02:00
parent 745b9dbbd1
commit 9fef43951b
25 changed files with 239 additions and 346 deletions

View File

@@ -12,28 +12,23 @@
#include <Nazara/Noise/Abstract2DNoise.hpp>
#include <Nazara/Math/Vector2.hpp>
template <typename T> class NzPerlin2D : public NzAbstract2DNoise<T>
class NAZARA_API NzPerlin2D : public NzAbstract2DNoise
{
public:
NzPerlin2D();
T GetValue(T x, T y, T resolution);
virtual ~NzPerlin2D() = default;
float GetValue(float x, float y, float resolution);
~NzPerlin2D() = default;
protected:
private:
int x0, y0;
int gi0,gi1,gi2,gi3;
int ii, jj;
T gradient2[8][2];
T s,t,u,v;
T Cx,Cy;
T Li1, Li2;
NzVector2<T> temp;
float gradient2[8][2];
float s,t,u,v;
float Cx,Cy;
float Li1, Li2;
NzVector2<float> temp;
};
typedef NzPerlin2D<float> NzPerlin2Df;
typedef NzPerlin2D<double> NzPerlin2Dd;
#include <Nazara/Noise/Perlin2D.inl>
#endif // PERLIN2D_HPP