Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
Noise.h
Go to the documentation of this file.
1/*
2--------------------------------------------------------------------------------
3This source file is part of Hydrax.
4Visit ---
5
6Copyright (C) 2008 Xavier Vergu�n Gonz�lez <xavierverguin@hotmail.com>
7 <xavyiy@gmail.com>
8
9This program is free software; you can redistribute it and/or modify it under
10the terms of the GNU Lesser General Public License as published by the Free Software
11Foundation; either version 2 of the License, or (at your option) any later
12version.
13
14This program is distributed in the hope that it will be useful, but WITHOUT
15ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public License along with
19this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21http://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
37namespace 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 {
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;
133
138 };
139}}
140
143
144#endif
Class to manager GPU normal maps.
Base noise class, Override it for create different ways of create water noise.
Definition Noise.h:43
virtual void remove()
Remove.
Definition Noise.cpp:47
const Ogre::String & getName() const
Get noise name.
Definition Noise.h:92
virtual ~Noise()
Destructor.
Definition Noise.cpp:38
const bool & areGPUNormalMapResourcesCreated() const
Are GPU normal map resources created?
Definition Noise.h:116
virtual bool createGPUNormalMapResources(GPUNormalMapManager *g)
Create GPUNormalMap resources.
Definition Noise.cpp:52
virtual float getValue(const float &x, const float &y)=0
Get the especified x/y noise value.
virtual bool loadCfg(Ogre::ConfigFile &CfgFile)
Load config.
Definition Noise.cpp:87
bool mCreated
Has create() been already called?
Definition Noise.h:132
bool mGPUNormalMapResourcesCreated
Are GPU normal map resources created?
Definition Noise.h:137
virtual void update(const Ogre::Real &timeSinceLastFrame)=0
Call it each frame.
const bool & isGPUNormalMapSupported() const
Is GPU Normal map generation supported.
Definition Noise.h:108
virtual void removeGPUNormalMapResources(GPUNormalMapManager *g)
Remove GPUNormalMap resources.
Definition Noise.cpp:71
virtual void saveCfg(Ogre::String &Data)
Save config.
Definition Noise.cpp:81
Ogre::String mName
Module name.
Definition Noise.h:130
virtual void create()
Create.
Definition Noise.cpp:42
const bool & isCreated() const
Is created() called?
Definition Noise.h:100
bool mGPUNormalMapSupported
Is GPU normal map generation supported?
Definition Noise.h:135