open_toontown_panda3d/panda/src/mathutil/perlinNoise.h

60 lines
1.7 KiB
C++

// Filename: perlinNoise.h
// Created by: drose (05Oct05)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////
#ifndef PERLINNOISE_H
#define PERLINNOISE_H
#include "pandabase.h"
#include "pvector.h"
#include "vector_int.h"
#include "luse.h"
#include "randomizer.h"
////////////////////////////////////////////////////////////////////
// Class : PerlinNoise
// Description : This is the base class for PerlinNoise2 and
// PerlinNoise3, different dimensions of Perlin noise
// implementation. The base class just collects the
// common functionality.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA_MATHUTIL PerlinNoise {
protected:
PerlinNoise(int table_size, unsigned long seed);
PerlinNoise(const PerlinNoise &copy);
void operator = (const PerlinNoise &copy);
INLINE static double fade(double t);
INLINE static double lerp(double t, double a, double b);
PUBLISHED:
INLINE unsigned long get_seed();
protected:
int _table_size;
int _table_size_mask;
Randomizer _randomizer;
typedef vector_int Index;
Index _index;
};
#include "perlinNoise.I"
#endif