00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PERLINNOISE_H
00016 #define PERLINNOISE_H
00017
00018 #include "pandabase.h"
00019 #include "pvector.h"
00020 #include "vector_int.h"
00021 #include "luse.h"
00022 #include "randomizer.h"
00023
00024
00025
00026
00027
00028
00029
00030
00031 class EXPCL_PANDA_MATHUTIL PerlinNoise {
00032 protected:
00033 PerlinNoise(int table_size, unsigned long seed);
00034 PerlinNoise(const PerlinNoise ©);
00035 void operator = (const PerlinNoise ©);
00036
00037 INLINE static double fade(double t);
00038 INLINE static double lerp(double t, double a, double b);
00039
00040 PUBLISHED:
00041 INLINE unsigned long get_seed();
00042
00043 protected:
00044 int _table_size;
00045 int _table_size_mask;
00046
00047 Randomizer _randomizer;
00048
00049 typedef vector_int Index;
00050 Index _index;
00051 };
00052
00053 #include "perlinNoise.I"
00054
00055 #endif