// PerlinNoise.h: interface for the CPerlinNoise class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_PERLINNOISE_H__DF635499_ADD4_4465_901C_9064E518F452__INCLUDED_) #define AFX_PERLINNOISE_H__DF635499_ADD4_4465_901C_9064E518F452__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <3DMath.h> #include #include "StateLog.h" const long MAX_OCTAVES=128; #define B 0x100 #define BM 0xff #define NE 0x1000 #define NP 12 /* 2^N */ #define NM 0xfff class CPerlinNoise { static float m_fH,m_fLacunarity,m_fOctaves,m_fOffset,m_fGain,m_fDepth; static float m_ExponentArray[MAX_OCTAVES]; static int m_P[B + B + 2]; static vector3 m_G2[B + B + 2]; static int m_RandomSeed[B*7]; public: static void SetNoiseValue(float H,float Lac,float Oct,float Off,float Gain,float Depth) { m_fH=H; m_fLacunarity=Lac; m_fOctaves=Oct; m_fOffset=Off; m_fGain=Gain; m_fDepth=Depth; } static void LoadSeed(char *strFilename); static float Noise2(vector3 vec); static void Init(); static float HybridMultifractal(vector3 point); CPerlinNoise(); virtual ~CPerlinNoise(); }; #endif // !defined(AFX_PERLINNOISE_H__DF635499_ADD4_4465_901C_9064E518F452__INCLUDED_)