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
GPUNormalMapManager.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_GPUNormalMapManager_H_
26#define _Hydrax_GPUNormalMapManager_H_
27
28#include "Prerequisites.h"
29
30#include "Enums.h"
31#include "RttManager.h"
32
35
38
39namespace Hydrax
40{
41 class Hydrax;
42
46 {
47 public:
52
56
60 void create();
61
64 void remove();
65
69 inline void setActive(const bool& Active)
70 {
71 if (Active)
72 {
74 }
75 else
76 {
78 }
79 }
80
84 inline const bool& isCreated() const
85 {
86 return mCreated;
87 }
88
94 inline Hydrax* getHydrax()
95 {
96 return mHydrax;
97 }
98
102 inline Ogre::MaterialPtr &getNormalMapMaterial()
103 {
104 return mNormalMapMaterial;
105 }
106
111 inline Ogre::TexturePtr &getTexture(const int& Index)
112 {
113 return mTextures.at(Index);
114 }
115
119 void addTexture(Ogre::TexturePtr &Texture)
120 {
121 mTextures.push_back(Texture);
122 }
123
127 inline void removeTexture(const int& Index)
128 {
129 Ogre::TextureManager::getSingleton().remove(mTextures.at(Index)->getName());
130
131 std::vector<Ogre::TexturePtr>::iterator TexIt = mTextures.begin() + Index;
132
133 mTextures.erase(TexIt);
134 }
135
136 private:
137
142
145
151 Ogre::MaterialPtr mNormalMapMaterial;
152
157 std::vector<Ogre::TexturePtr> mTextures;
158 };
159}
160
163
164#endif
Class to manager GPU normal maps.
void removeTexture(const int &Index)
Remove a texture.
Ogre::TexturePtr & getTexture(const int &Index)
Get a texture.
Hydrax * getHydrax()
Get the Hydrax parent pointer.
void addTexture(Ogre::TexturePtr &Texture)
Create a texture.
std::vector< Ogre::TexturePtr > mTextures
The normal map material needs some textures wich will be filled by code.
Ogre::MaterialPtr & getNormalMapMaterial()
Get the normal map material.
Ogre::MaterialPtr mNormalMapMaterial
This material must be created in the noise module, in order to be according with the Hydrax modulable...
void setActive(const bool &Active)
Set active.
Hydrax * mHydrax
Hydrax main pointer.
RttManager * mRttManager
Rtt manager pointer.
bool mCreated
Has been create() already called?
const bool & isCreated() const
Has been created() already called?
Rtt's manager class.
Definition RttManager.h:46
void remove(const RttType &Rtt)
Removes a RTT.
void initialize(const RttType &Rtt)
Initialize a RTT.