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
GeometryManager.h
Go to the documentation of this file.
1/*
2--------------------------------------------------------------------------------
3This source file is part of SkyX.
4Visit http://www.paradise-studios.net/products/skyx/
5
6Copyright (C) 2009-2012 Xavier Vergu�n Gonz�lez <xavyiy@gmail.com>
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://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
31namespace 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
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
VClouds * mVClouds
VClouds pointer.
bool mCreated
Has been create() already called?
Ogre::Vector2 mWorldOffset
World coords offset.
const Ogre::Vector2 getHeight() const
Get height (x = Altitude over the camera, y: Field height (both in world coordinates))
Ogre::Vector2 mHeight
Height: x = Altitude over the camera, y: Field height (both in world coordinates)
Ogre::Vector3 mCurrentDistance
Current camera-clouds distance.
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.
const Ogre::Vector3 _getCurrentDistance() const
Get current camera to cloud field distance.
void update(const Ogre::Real &timeSinceLastFrame)
Update, to be invoked per frame.
Ogre::SceneNode * mSceneNode
Scene node.
std::vector< GeometryBlock * > mGeometryBlocks
Geometry blocks.
Ogre::Radian mPhi
Azimutal angle per block.
void _setMaterialName(const Ogre::String &mn)
Set material name.
Ogre::SceneNode * getSceneNode()
Get scene node.
void _updateGeometry(Ogre::Camera *c, const Ogre::Real &timeSinceLastFrame)
Update geometry.
const bool & isCreated() const
Has been create() already called?
void updateGeometry(Ogre::Camera *c, const Ogre::Real &timeSinceLastCameraFrame)
Update geoemtry.
void _updateRenderQueueGroup(const Ogre::uint8 &rqg)
Update render queue group.
int mNumberOfBlocks
Number of blocks.
float mA
A, B and C radius.
int mNa
Number of slices per geometry zone.
void _createGeometry()
Create geometry.