Minor fixes
*Seed is uint instead of int *Permutation table is uint instead of int, could lead before to program crash with negative seeds Former-commit-id: 49ad04987a09a5f5b4bcab6ee3916db9818172b6
This commit is contained in:
@@ -16,7 +16,6 @@ class NAZARA_API NzComplexNoiseBase
|
||||
NzComplexNoiseBase();
|
||||
~NzComplexNoiseBase() = default;
|
||||
|
||||
const std::array<float, 30>& GetExponentArray() const; //For debug purpose
|
||||
float GetHurstParameter() const;
|
||||
float GetLacunarity() const;
|
||||
float GetOctaveNumber() const;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class NAZARA_API NzFBM2D : public NzAbstract2DNoise, public NzComplexNoiseBase
|
||||
{
|
||||
public:
|
||||
NzFBM2D(nzNoises source, int seed);
|
||||
NzFBM2D(nzNoises source, unsigned int seed);
|
||||
float GetValue(float x, float y, float resolution);
|
||||
~NzFBM2D();
|
||||
protected:
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class NAZARA_API NzFBM3D : public NzAbstract3DNoise, public NzComplexNoiseBase
|
||||
{
|
||||
public:
|
||||
NzFBM3D(nzNoises source, int seed);
|
||||
NzFBM3D(nzNoises source, unsigned int seed);
|
||||
float GetValue(float x, float y, float z, float resolution);
|
||||
~NzFBM3D();
|
||||
protected:
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class NAZARA_API NzFBM4D : public NzAbstract4DNoise, public NzComplexNoiseBase
|
||||
{
|
||||
public:
|
||||
NzFBM4D(nzNoises source, int seed);
|
||||
NzFBM4D(nzNoises source, unsigned int seed);
|
||||
float GetValue(float x, float y, float z, float w, float resolution);
|
||||
~NzFBM4D();
|
||||
protected:
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class NAZARA_API NzHybridMultiFractal3D : public NzAbstract3DNoise, public NzComplexNoiseBase
|
||||
{
|
||||
public:
|
||||
NzHybridMultiFractal3D(nzNoises source, int seed);
|
||||
NzHybridMultiFractal3D(nzNoises source, unsigned int seed);
|
||||
float GetValue(float x, float y, float z, float resolution);
|
||||
~NzHybridMultiFractal3D();
|
||||
protected:
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class NAZARA_API NzHybridMultiFractal4D : public NzAbstract4DNoise, public NzComplexNoiseBase
|
||||
{
|
||||
public:
|
||||
NzHybridMultiFractal4D(nzNoises source, int seed);
|
||||
NzHybridMultiFractal4D(nzNoises source, unsigned int seed);
|
||||
float GetValue(float x, float y, float z, float w, float resolution);
|
||||
~NzHybridMultiFractal4D();
|
||||
protected:
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class NAZARA_API NzHybridMultiFractal2D : public NzAbstract2DNoise, public NzComplexNoiseBase
|
||||
{
|
||||
public:
|
||||
NzHybridMultiFractal2D(nzNoises source, int seed);
|
||||
NzHybridMultiFractal2D(nzNoises source, unsigned int seed);
|
||||
float GetValue(float x, float y, float resolution);
|
||||
~NzHybridMultiFractal2D();
|
||||
protected:
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
// 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 NAZARA_NOISE_HPP
|
||||
#define NAZARA_NOISE_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/Initializer.hpp>
|
||||
|
||||
class NAZARA_API NzNoise
|
||||
{
|
||||
public:
|
||||
NzNoise() = delete;
|
||||
~NzNoise() = delete;
|
||||
|
||||
static bool Initialize();
|
||||
|
||||
static bool IsInitialized();
|
||||
|
||||
static void Uninitialize();
|
||||
|
||||
private:
|
||||
static unsigned int s_moduleReferenceCouter;
|
||||
};
|
||||
|
||||
#endif // NAZARA_NOISE_HPP
|
||||
@@ -19,21 +19,23 @@ enum nzNoises
|
||||
class NAZARA_API NzNoiseBase
|
||||
{
|
||||
public:
|
||||
NzNoiseBase(int seed = 0);
|
||||
NzNoiseBase(unsigned int seed = 0);
|
||||
~NzNoiseBase() = default;
|
||||
|
||||
void SetNewSeed(int seed);
|
||||
int GetUniformRandomValue();
|
||||
void SetNewSeed(unsigned int seed);
|
||||
|
||||
void ShufflePermutationTable();
|
||||
|
||||
unsigned int GetUniformRandomValue();
|
||||
|
||||
int fastfloor(float n);
|
||||
int JenkinsHash(int a, int b, int c);
|
||||
protected:
|
||||
int perm[512];
|
||||
unsigned int perm[512];
|
||||
private:
|
||||
int Ua, Uc, Um;
|
||||
int UcurrentSeed;
|
||||
int Uprevious, Ulast;
|
||||
unsigned int Ua, Uc, Um;
|
||||
unsigned int UcurrentSeed;
|
||||
unsigned int Uprevious, Ulast;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class NAZARA_API NzPerlin2D : public NzAbstract2DNoise
|
||||
{
|
||||
public:
|
||||
NzPerlin2D();
|
||||
NzPerlin2D(int seed);
|
||||
NzPerlin2D(unsigned int seed);
|
||||
float GetValue(float x, float y, float resolution);
|
||||
~NzPerlin2D() = default;
|
||||
protected:
|
||||
|
||||
@@ -16,7 +16,7 @@ class NAZARA_API NzPerlin3D : public NzAbstract3DNoise
|
||||
{
|
||||
public:
|
||||
NzPerlin3D();
|
||||
NzPerlin3D(int seed);
|
||||
NzPerlin3D(unsigned int seed);
|
||||
float GetValue(float x, float y, float z, float resolution);
|
||||
~NzPerlin3D() = default;
|
||||
protected:
|
||||
|
||||
@@ -16,7 +16,7 @@ class NAZARA_API NzPerlin4D : public NzAbstract4DNoise
|
||||
{
|
||||
public:
|
||||
NzPerlin4D();
|
||||
NzPerlin4D(int seed);
|
||||
NzPerlin4D(unsigned int seed);
|
||||
float GetValue(float x, float y, float z, float w, float resolution);
|
||||
~NzPerlin4D() = default;
|
||||
protected:
|
||||
|
||||
@@ -16,7 +16,7 @@ class NAZARA_API NzSimplex2D : public NzAbstract2DNoise
|
||||
{
|
||||
public:
|
||||
NzSimplex2D();
|
||||
NzSimplex2D(int seed);
|
||||
NzSimplex2D(unsigned int seed);
|
||||
float GetValue(float x, float y, float resolution);
|
||||
virtual ~NzSimplex2D() = default;
|
||||
protected:
|
||||
|
||||
@@ -16,7 +16,7 @@ class NAZARA_API NzSimplex3D : public NzAbstract3DNoise
|
||||
{
|
||||
public:
|
||||
NzSimplex3D();
|
||||
NzSimplex3D(int seed);
|
||||
NzSimplex3D(unsigned int seed);
|
||||
float GetValue(float x, float y, float z, float resolution);
|
||||
~NzSimplex3D() = default;
|
||||
protected:
|
||||
|
||||
@@ -16,7 +16,7 @@ class NAZARA_API NzSimplex4D : public NzAbstract4DNoise
|
||||
{
|
||||
public:
|
||||
NzSimplex4D();
|
||||
NzSimplex4D(int seed);
|
||||
NzSimplex4D(unsigned int seed);
|
||||
float GetValue(float x, float y, float z, float w, float resolution);
|
||||
~NzSimplex4D() = default;
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user