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
Module.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_Module_H_
26#define _Hydrax_Module_H_
27
28#include "Prerequisites.h"
29#include "Application.h"
30#include "Noise.h"
31#include "Mesh.h"
32#include "MaterialManager.h"
33#include "GPUNormalMapManager.h"
34
37
40
41namespace Hydrax{ namespace Module
42{
46 class Module
47 {
48 public:
55 Module(const Ogre::String &Name,
56 Noise::Noise *n,
57 const Mesh::Options &MeshOptions,
58 const MaterialManager::NormalMode &NormalMode);
59
62 virtual ~Module();
63
67 virtual void create();
68
72 virtual void remove();
73
79 void setNoise(Noise::Noise* Noise, GPUNormalMapManager* g = 0, const bool& DeleteOldNoise = true);
80
84 virtual void update(const Ogre::Real &timeSinceLastFrame);
85
89 virtual void saveCfg(Ogre::String &Data);
90
94 virtual bool loadCfg(Ogre::ConfigFile &CfgFile);
95
99 inline const Ogre::String& getName() const
100 {
101 return mName;
102 }
103
107 inline const bool& isCreated() const
108 {
109 return mCreated;
110 }
111
117 inline virtual const bool _createGeometry(Mesh *mMesh) const
118 {
119 return false;
120 }
121
126 {
127 return mNormalMode;
128 }
129
133 inline const Mesh::Options& getMeshOptions() const
134 {
135 return mMeshOptions;
136 }
137
142 {
143 return mNoise;
144 }
145
150 virtual float getHeigth(const Ogre::Vector2 &Position);
151
152 protected:
154 Ogre::String mName;
163 };
164}}
165
168
169#endif
Central state/object manager and communications hub.
Class to manager GPU normal maps.
NormalMode
Normal generation mode.
Class wich contains all funtions/variables related to Hydrax water mesh.
Definition Mesh.h:47
Base module class, Override it for create different ways of create water noise.
Definition Module.h:47
virtual ~Module()
Destructor.
Definition Module.cpp:41
virtual void update(const Ogre::Real &timeSinceLastFrame)
Call it each frame.
Definition Module.cpp:94
virtual void remove()
Remove.
Definition Module.cpp:53
bool mCreated
Is create() called?
Definition Module.h:162
const Ogre::String & getName() const
Get module name.
Definition Module.h:99
virtual void create()
Create.
Definition Module.cpp:46
Noise::Noise * getNoise()
Get the Hydrax::Noise module pointer.
Definition Module.h:141
const bool & isCreated() const
Is created() called?
Definition Module.h:107
Noise::Noise * mNoise
Noise generator pointer.
Definition Module.h:156
MaterialManager::NormalMode mNormalMode
Normal map generation mode.
Definition Module.h:160
virtual void saveCfg(Ogre::String &Data)
Save config.
Definition Module.cpp:99
Mesh::Options mMeshOptions
Module mesh options.
Definition Module.h:158
Ogre::String mName
Module name.
Definition Module.h:154
const MaterialManager::NormalMode & getNormalMode() const
Get the normal generation mode.
Definition Module.h:125
virtual const bool _createGeometry(Mesh *mMesh) const
Create geometry in module(If special geometry is needed)
Definition Module.h:117
virtual bool loadCfg(Ogre::ConfigFile &CfgFile)
Load config.
Definition Module.cpp:105
virtual float getHeigth(const Ogre::Vector2 &Position)
Get the current heigth at a especified world-space point.
Definition Module.cpp:117
const Mesh::Options & getMeshOptions() const
Get the mesh options for this module.
Definition Module.h:133
void setNoise(Noise::Noise *Noise, GPUNormalMapManager *g=0, const bool &DeleteOldNoise=true)
Set noise.
Definition Module.cpp:60
Base noise class, Override it for create different ways of create water noise.
Definition Noise.h:43
Base Hydrax mesh options.
Definition Mesh.h:94