|
RigsofRods
Soft-body Physics Simulation
|
Go to the documentation of this file.
29 #ifndef _Hydrax_Noise_Perlin_H_
30 #define _Hydrax_Noise_Perlin_H_
41 #define n_size (1<<(n_bits-1))
42 #define n_size_m1 (n_size - 1)
43 #define n_size_sq (n_size*n_size)
44 #define n_size_sq_m1 (n_size_sq - 1)
48 #define np_bits (n_bits+n_packsize-1)
49 #define np_size (1<<(np_bits-1))
50 #define np_size_m1 (np_size-1)
51 #define np_size_sq (np_size*np_size)
52 #define np_size_sq_m1 (np_size_sq-1)
55 #define n_dec_magn 4096
56 #define n_dec_magn_m1 4095
58 #define max_octaves 32
60 #define noise_frames 256
61 #define noise_frames_m1 (noise_frames-1)
63 #define noise_decimalbits 15
64 #define noise_magnitude (1<<(noise_decimalbits-1))
66 #define scale_decimalbits 15
67 #define scale_magnitude (1<<(scale_decimalbits-1))
69 namespace Hydrax{
namespace Noise
127 const float &_Falloff,
128 const float &_Animspeed,
129 const float &_Timemulti)
151 const float &_Falloff,
152 const float &_Animspeed,
153 const float &_Timemulti,
154 const float &_GPU_Strength,
155 const Ogre::Vector3 &_GPU_LODParameters)
174 Perlin(
const Options &Options);
197 void update(
const Ogre::Real &timeSinceLastFrame);
202 void saveCfg(Ogre::String &Data);
207 bool loadCfg(Ogre::ConfigFile &CfgFile);
215 float getValue(
const float &
x,
const float &
y);
266 int _mapSample(
const int &u,
const int &v,
const int &upsamplepower,
const int &octave);
float getValue(const float &x, const float &y)
Get the especified x/y noise value.
int o_noise[n_size_sq *max_octaves]
int noise[n_size_sq *noise_frames]
Perlin noise variables.
const Options & getOptions() const
Get current Perlin noise options.
float _getHeigthDual(float u, float v)
Read texel linear.
bool createGPUNormalMapResources(GPUNormalMapManager *g)
Create GPUNormalMap resources.
Options(const int &_Octaves, const float &_Scale, const float &_Falloff, const float &_Animspeed, const float &_Timemulti)
Constructor.
Class to manager GPU normal maps.
void saveCfg(Ogre::String &Data)
Save config.
Options(const int &_Octaves, const float &_Scale, const float &_Falloff, const float &_Animspeed, const float &_Timemulti, const float &_GPU_Strength, const Ogre::Vector3 &_GPU_LODParameters)
Constructor.
float GPU_Strength
GPU Normal map generator parameters Only if GPU normal map generation is active.
void _initNoise()
Initialize noise.
float Timemulti
Timemulti.
Base noise class, Override it for create different ways of create water noise.
void _calculeNoise()
Calcule noise.
int _mapSample(const int &u, const int &v, const int &upsamplepower, const int &octave)
Map sample.
GPUNormalMapManager * mGPUNormalMapManager
GPUNormalMapManager pointer.
float Animspeed
Animspeed.
void _updateGPUNormalMapResources()
Update gpu normal map resources.
void update(const Ogre::Real &timeSinceLastFrame)
Call it each frame.
Options()
Default constructor.
Perlin()
Default constructor.
Options mOptions
Perlin noise options.
int _readTexelLinearDual(const int &u, const int &v, const int &o)
Read texel linear dual.
bool loadCfg(Ogre::ConfigFile &CfgFile)
Load config.
Ogre::Vector3 GPU_LODParameters
LOD Parameters, in order to obtain a smooth normal map we need to decrease the detail level when the ...
Struct wich contains Perlin noise module options.
int p_noise[np_size_sq *(max_octaves >>(n_packsize-1))]
void setOptions(const Options &Options)
Set/Update perlin noise options.
Perlin noise module class.