*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
36 lines
925 B
C++
36 lines
925 B
C++
// Copyright (C) 2012 Rémi Bèges
|
|
// This file is part of the "Nazara Engine - Noise module"
|
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
|
|
|
#pragma once
|
|
|
|
#ifndef PERLIN3D_HPP
|
|
#define PERLIN3D_HPP
|
|
|
|
#include <Nazara/Prerequesites.hpp>
|
|
#include <Nazara/Noise/NoiseBase.hpp>
|
|
#include <Nazara/Noise/Abstract3DNoise.hpp>
|
|
#include <Nazara/Math/Vector3.hpp>
|
|
|
|
class NAZARA_API NzPerlin3D : public NzAbstract3DNoise
|
|
{
|
|
public:
|
|
NzPerlin3D();
|
|
float GetValue(float x, float y, float z, float resolution);
|
|
~NzPerlin3D() = default;
|
|
protected:
|
|
private:
|
|
int x0,y0,z0;
|
|
int gi0,gi1,gi2,gi3,gi4,gi5,gi6,gi7;
|
|
int ii,jj,kk;
|
|
float gradient3[16][3];
|
|
float Li1,Li2,Li3,Li4,Li5,Li6;
|
|
float s[2],t[2],u[2],v[2];
|
|
float Cx,Cy,Cz;
|
|
float nx,ny,nz;
|
|
float tmp;
|
|
NzVector3<float> temp;
|
|
};
|
|
|
|
#endif // PERLIN3D_HPP
|