RigsofRods
Soft-body Physics Simulation
GeometryManager.h
Go to the documentation of this file.
1 /*
2 --------------------------------------------------------------------------------
3 This source file is part of SkyX.
4 Visit http://www.paradise-studios.net/products/skyx/
5 
6 Copyright (C) 2009-2012 Xavier Verguín González <xavyiy@gmail.com>
7 
8 This program is free software; you can redistribute it and/or modify it under
9 the terms of the GNU Lesser General Public License as published by the Free Software
10 Foundation; either version 2 of the License, or (at your option) any later
11 version.
12 
13 This program is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License along with
18 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20 http://www.gnu.org/copyleft/lesser.txt.
21 --------------------------------------------------------------------------------
22 */
23 
24 #ifndef _SkyX_VClouds_GeometryManager_H_
25 #define _SkyX_VClouds_GeometryManager_H_
26 
27 #include "Prerequisites.h"
28 
29 #include "GeometryBlock.h"
30 
31 namespace SkyX { namespace VClouds{
32 
33  class VClouds;
34 
36  {
37  public:
42 
46 
57  void create(const Ogre::Vector2& Height, const float& Radius,
58  const Ogre::Radian& Alpha, const Ogre::Radian& Beta,
59  const int& NumberOfBlocks, const int& Na, const int& Nb, const int& Nc);
60 
63  void remove();
64 
68  void update(const Ogre::Real& timeSinceLastFrame);
69 
74  void updateGeometry(Ogre::Camera* c, const Ogre::Real& timeSinceLastCameraFrame);
75 
79  inline const bool& isCreated() const
80  {
81  return mCreated;
82  }
83 
87  inline Ogre::SceneNode* getSceneNode()
88  {
89  return mSceneNode;
90  }
91 
95  inline const Ogre::Vector2 getHeight() const
96  {
97  return mHeight;
98  }
99 
104  void _setMaterialName(const Ogre::String& mn);
105 
110  void _updateRenderQueueGroup(const Ogre::uint8& rqg);
111 
116  inline const Ogre::Vector3 _getCurrentDistance() const
117  {
118  return mCurrentDistance;
119  }
120 
121  private:
124  void _createGeometry();
125 
130  void _updateGeometry(Ogre::Camera* c, const Ogre::Real& timeSinceLastFrame);
131 
133  bool mCreated;
134 
136  Ogre::Vector2 mHeight;
138  Ogre::Radian mAlpha, mBeta;
140  float mRadius;
142  Ogre::Radian mPhi;
146  int mNa, mNb, mNc;
148  float mA, mB, mC;
149 
151  Ogre::Vector2 mWorldOffset;
152 
154  std::vector<GeometryBlock*> mGeometryBlocks;
155 
157  Ogre::SceneNode *mSceneNode;
158 
160  Ogre::Vector3 mCurrentDistance;
161 
164  };
165 
166 
167 }}
168 
169 #endif
SkyX::VClouds::GeometryManager::mB
float mB
Definition: GeometryManager.h:148
SkyX::VClouds::GeometryManager::mAlpha
Ogre::Radian mAlpha
Angles.
Definition: GeometryManager.h:138
SkyX::VClouds::GeometryManager::_updateRenderQueueGroup
void _updateRenderQueueGroup(const Ogre::uint8 &rqg)
Update render queue group.
Definition: GeometryManager.cpp:125
SkyX::VClouds::GeometryManager::mCurrentDistance
Ogre::Vector3 mCurrentDistance
Current camera-clouds distance.
Definition: GeometryManager.h:160
SkyX::VClouds::GeometryManager::_getCurrentDistance
const Ogre::Vector3 _getCurrentDistance() const
Get current camera to cloud field distance.
Definition: GeometryManager.h:116
SkyX::VClouds::GeometryManager::mGeometryBlocks
std::vector< GeometryBlock * > mGeometryBlocks
Geometry blocks.
Definition: GeometryManager.h:154
SkyX::VClouds::GeometryManager::getHeight
const Ogre::Vector2 getHeight() const
Get height (x = Altitude over the camera, y: Field height (both in world coordinates))
Definition: GeometryManager.h:95
SkyX::VClouds::GeometryManager
Definition: GeometryManager.h:35
SkyX::VClouds::GeometryManager::mHeight
Ogre::Vector2 mHeight
Height: x = Altitude over the camera, y: Field height (both in world coordinates)
Definition: GeometryManager.h:136
SkyX
Definition: AtmosphereManager.cpp:30
SkyX::VClouds::GeometryManager::create
void create(const Ogre::Vector2 &Height, const float &Radius, const Ogre::Radian &Alpha, const Ogre::Radian &Beta, const int &NumberOfBlocks, const int &Na, const int &Nb, const int &Nc)
Create.
Definition: GeometryManager.cpp:52
SkyX::VClouds::GeometryManager::getSceneNode
Ogre::SceneNode * getSceneNode()
Get scene node.
Definition: GeometryManager.h:87
SkyX::VClouds::GeometryManager::GeometryManager
GeometryManager(VClouds *vc)
Constructor.
Definition: GeometryManager.cpp:31
SkyX::VClouds::GeometryManager::mNb
int mNb
Definition: GeometryManager.h:146
SkyX::VClouds::GeometryManager::mA
float mA
A, B and C radius.
Definition: GeometryManager.h:148
SkyX::VClouds::GeometryManager::~GeometryManager
~GeometryManager()
Destructor.
Definition: GeometryManager.cpp:47
SkyX::VClouds::GeometryManager::mNa
int mNa
Number of slices per geometry zone.
Definition: GeometryManager.h:146
SkyX::VClouds::GeometryManager::update
void update(const Ogre::Real &timeSinceLastFrame)
Update, to be invoked per frame.
Definition: GeometryManager.cpp:94
SkyX::VClouds::GeometryManager::isCreated
const bool & isCreated() const
Has been create() already called?
Definition: GeometryManager.h:79
SkyX::VClouds::GeometryManager::mSceneNode
Ogre::SceneNode * mSceneNode
Scene node.
Definition: GeometryManager.h:157
SkyX::VClouds::GeometryManager::mNc
int mNc
Definition: GeometryManager.h:146
SkyX::VClouds::GeometryManager::_createGeometry
void _createGeometry()
Create geometry.
Definition: GeometryManager.cpp:133
SkyX::VClouds::GeometryManager::mBeta
Ogre::Radian mBeta
Definition: GeometryManager.h:138
SkyX::VClouds::VClouds
Definition: VClouds.h:35
SkyX::VClouds::GeometryManager::remove
void remove()
Remove.
Definition: GeometryManager.cpp:72
SkyX::VClouds::GeometryManager::mCreated
bool mCreated
Has been create() already called?
Definition: GeometryManager.h:133
SkyX::VClouds::GeometryManager::mNumberOfBlocks
int mNumberOfBlocks
Number of blocks.
Definition: GeometryManager.h:144
GeometryBlock.h
SkyX::VClouds::GeometryManager::mC
float mC
Definition: GeometryManager.h:148
SkyX::VClouds::GeometryManager::mVClouds
VClouds * mVClouds
VClouds pointer.
Definition: GeometryManager.h:163
SkyX::VClouds::GeometryManager::mWorldOffset
Ogre::Vector2 mWorldOffset
World coords offset.
Definition: GeometryManager.h:151
SkyX::VClouds::GeometryManager::updateGeometry
void updateGeometry(Ogre::Camera *c, const Ogre::Real &timeSinceLastCameraFrame)
Update geoemtry.
Definition: GeometryManager.cpp:104
SkyX::VClouds::GeometryManager::mRadius
float mRadius
Radius.
Definition: GeometryManager.h:140
SkyX::VClouds::GeometryManager::mPhi
Ogre::Radian mPhi
Azimutal angle per block.
Definition: GeometryManager.h:142
SkyX::VClouds::GeometryManager::_setMaterialName
void _setMaterialName(const Ogre::String &mn)
Set material name.
Definition: GeometryManager.cpp:117
SkyX::VClouds::GeometryManager::_updateGeometry
void _updateGeometry(Ogre::Camera *c, const Ogre::Real &timeSinceLastFrame)
Update geometry.
Definition: GeometryManager.cpp:149