Files
NazaraEngine/include/Nazara/Noise/NoiseBase.hpp
Remi Beges a72d388c05 Merge remote-tracking branch 'upstream/master'
Conflicts:
	include/Nazara/Noise/NoiseMachine.hpp
	src/Nazara/Noise/ComplexNoiseBase.cpp
	src/Nazara/Noise/NoiseMachine.cpp

Former-commit-id: 54af2e19e336cfacee63cabe785d7b05fa392b53
2012-10-05 17:53:41 +02:00

41 lines
787 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 NOISEBASE_HPP
#define NOISEBASE_HPP
#include <Nazara/Prerequesites.hpp>
enum nzNoises
{
PERLIN,
SIMPLEX,
CELL
};
class NAZARA_API NzNoiseBase
{
public:
NzNoiseBase(int seed = 0);
~NzNoiseBase() = default;
void SetNewSeed(int seed);
int GetUniformRandomValue();
void ShufflePermutationTable();
int fastfloor(float n);
int JenkinsHash(int a, int b, int c);
protected:
int perm[512];
private:
int Ua, Uc, Um;
int UcurrentSeed;
int Uprevious, Ulast;
};
#endif // NOISEBASE_HPP