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.cpp
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#include "Noise.h"
26#include "Application.h"
27
28namespace Hydrax{namespace Noise
29{
30 Noise::Noise(const Ogre::String &Name, const bool& GPUNormalMapSupported)
31 : mName(Name)
32 , mCreated(false)
33 , mGPUNormalMapSupported(GPUNormalMapSupported)
34 , mGPUNormalMapResourcesCreated(false)
35 {
36 }
37
39 {
40 }
41
43 {
44 mCreated = true;
45 }
46
48 {
49 mCreated = false;
50 }
51
53 {
55 {
57 {
59 }
60
62
63 g->remove();
64
65 return true;
66 }
67
68 return false;
69 }
70
80
81 void Noise::saveCfg(Ogre::String &Data)
82 {
83 Data += "#Noise options\n";
84 Data += "Noise="+mName+"\n\n";
85 }
86
87 bool Noise::loadCfg(Ogre::ConfigFile &CfgFile)
88 {
89 if (CfgFile.getSetting("Noise") == mName)
90 {
91 HydraxLOG(mName + " options entry found.");
92 return true;
93 }
94
95 HydraxLOG("Error (Noise::loadCfg):\t" + mName + " options entry can not be found.");
96 return false;
97 }
98}}
Central state/object manager and communications hub.
#define HydraxLOG(msg)
Definition Application.h:60
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
virtual ~Noise()
Destructor.
Definition Noise.cpp:38
virtual bool createGPUNormalMapResources(GPUNormalMapManager *g)
Create GPUNormalMap resources.
Definition Noise.cpp:52
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 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
bool mGPUNormalMapSupported
Is GPU normal map generation supported?
Definition Noise.h:135