Noise: Refresh module using ZNoise
https://github.com/Overdrivr/ZNoise Former-commit-id: 3f7be1c8fd14e074826ca667676412ea4989621c [formerly 882d0bdad12c264766dc00869ac07bbecbee7306] Former-commit-id: b12a4654bb5b9ff3fdd474704d66aa10fd2d756d
This commit is contained in:
43
include/Nazara/Noise/Simplex.hpp
Normal file
43
include/Nazara/Noise/Simplex.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright (C) 2016 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
|
||||
|
||||
#ifndef SIMPLEX_HPP
|
||||
#define SIMPLE_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Noise/Config.hpp>
|
||||
#include <Nazara/Noise/NoiseBase.hpp>
|
||||
#include <initializer_list>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_NOISE_API Simplex : public NoiseBase
|
||||
{
|
||||
public:
|
||||
Simplex();
|
||||
Simplex(unsigned int seed);
|
||||
~Simplex() = default;
|
||||
|
||||
float Get(std::initializer_list<float> coordinates, float scale) const;
|
||||
|
||||
protected:
|
||||
float _2D(std::initializer_list<float> coordinates, float scale) const;
|
||||
float _3D(std::initializer_list<float> coordinates, float scale) const;
|
||||
float _4D(std::initializer_list<float> coordinates, float scale) const;
|
||||
|
||||
private:
|
||||
const float gradient2[8][2];
|
||||
const float gradient3[16][3];
|
||||
const float gradient4[32][4];
|
||||
const float UnskewCoeff2D;
|
||||
const float SkewCoeff2D;
|
||||
const float UnskewCoeff3D;
|
||||
const float SkewCoeff3D;
|
||||
const float UnskewCoeff4D;
|
||||
const float SkewCoeff4D;
|
||||
const int lookupTable4D[64][4];
|
||||
};
|
||||
}
|
||||
|
||||
#endif // SIMPLEX_HPP
|
||||
Reference in New Issue
Block a user