RigsofRods
Soft-body Physics Simulation
Noise.h
Go to the documentation of this file.
1 /*
2 --------------------------------------------------------------------------------
3 This source file is part of Hydrax.
4 Visit ---
5 
6 Copyright (C) 2008 Xavier Verguín González <xavierverguin@hotmail.com>
7  <xavyiy@gmail.com>
8 
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free Software
11 Foundation; either version 2 of the License, or (at your option) any later
12 version.
13 
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public License along with
19 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21 http://www.gnu.org/copyleft/lesser.txt.
22 --------------------------------------------------------------------------------
23 */
24 
25 #ifndef _Hydrax_Noise_H_
26 #define _Hydrax_Noise_H_
27 
28 #include "Prerequisites.h"
29 #include "GPUNormalMapManager.h"
30 
33 
36 
37 namespace Hydrax{ namespace Noise
38 {
42  class Noise
43  {
44  public:
49  Noise(const Ogre::String &Name, const bool& GPUNormalMapSupported);
50 
53  virtual ~Noise();
54 
57  virtual void create();
58 
61  virtual void remove();
62 
68 
73 
77  virtual void update(const Ogre::Real &timeSinceLastFrame) = 0;
78 
82  virtual void saveCfg(Ogre::String &Data);
83 
87  virtual bool loadCfg(Ogre::ConfigFile &CfgFile);
88 
92  inline const Ogre::String& getName() const
93  {
94  return mName;
95  }
96 
100  inline const bool& isCreated() const
101  {
102  return mCreated;
103  }
104 
108  inline const bool& isGPUNormalMapSupported() const
109  {
110  return mGPUNormalMapSupported;
111  }
112 
116  inline const bool& areGPUNormalMapResourcesCreated() const
117  {
119  }
120 
126  virtual float getValue(const float &x, const float &y) = 0;
127 
128  protected:
130  Ogre::String mName;
132  bool mCreated;
133 
138  };
139 }}
140 
143 
144 #endif
Hydrax::Noise::Noise::remove
virtual void remove()
Remove.
Definition: Noise.cpp:47
y
float y
Definition: (ValueTypes) quaternion.h:6
Hydrax::Noise::Noise::createGPUNormalMapResources
virtual bool createGPUNormalMapResources(GPUNormalMapManager *g)
Create GPUNormalMap resources.
Definition: Noise.cpp:52
Hydrax::Noise::Noise::create
virtual void create()
Create.
Definition: Noise.cpp:42
Hydrax
Definition: CfgFileManager.cpp:28
Hydrax::Noise::Noise::~Noise
virtual ~Noise()
Destructor.
Definition: Noise.cpp:38
Hydrax::Noise::Noise::removeGPUNormalMapResources
virtual void removeGPUNormalMapResources(GPUNormalMapManager *g)
Remove GPUNormalMap resources.
Definition: Noise.cpp:71
Hydrax::Noise::Noise::loadCfg
virtual bool loadCfg(Ogre::ConfigFile &CfgFile)
Load config.
Definition: Noise.cpp:87
Hydrax::Noise::Noise::saveCfg
virtual void saveCfg(Ogre::String &Data)
Save config.
Definition: Noise.cpp:81
Hydrax::GPUNormalMapManager
Class to manager GPU normal maps.
Definition: GPUNormalMapManager.h:45
Hydrax::Noise::Noise::getValue
virtual float getValue(const float &x, const float &y)=0
Get the especified x/y noise value.
Hydrax::Noise::Noise::getName
const Ogre::String & getName() const
Get noise name.
Definition: Noise.h:92
Hydrax::Noise::Noise
Base noise class, Override it for create different ways of create water noise.
Definition: Noise.h:42
GPUNormalMapManager.h
Hydrax::Noise::Noise::mGPUNormalMapResourcesCreated
bool mGPUNormalMapResourcesCreated
Are GPU normal map resources created?
Definition: Noise.h:137
Hydrax::Noise::Noise::Noise
Noise(const Ogre::String &Name, const bool &GPUNormalMapSupported)
Constructor.
Definition: Noise.cpp:30
Hydrax::Noise::Noise::mGPUNormalMapSupported
bool mGPUNormalMapSupported
Is GPU normal map generation supported?
Definition: Noise.h:135
Prerequisites.h
Hydrax::Noise::Noise::mCreated
bool mCreated
Has create() been already called?
Definition: Noise.h:132
Hydrax::Noise::Noise::areGPUNormalMapResourcesCreated
const bool & areGPUNormalMapResourcesCreated() const
Are GPU normal map resources created?
Definition: Noise.h:116
Hydrax::Noise::Noise::update
virtual void update(const Ogre::Real &timeSinceLastFrame)=0
Call it each frame.
Hydrax::Noise::Noise::isCreated
const bool & isCreated() const
Is created() called?
Definition: Noise.h:100
x
float x
Definition: (ValueTypes) quaternion.h:5
Hydrax::Noise::Noise::mName
Ogre::String mName
Module name.
Definition: Noise.h:130
Hydrax::Noise::Noise::isGPUNormalMapSupported
const bool & isGPUNormalMapSupported() const
Is GPU Normal map generation supported.
Definition: Noise.h:108