RigsofRods
Soft-body Physics Simulation
HydraxWater.h
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2005-2012 Pierre-Michel Ricordel
4  Copyright 2007-2012 Thomas Fischer
5  Copyright 2013-2016 Petr Ohlidal
6 
7  For more information, see http://www.rigsofrods.org/
8  Rigs of Rods is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License version 3, as
10  published by the Free Software Foundation.
11 
12  Rigs of Rods is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #pragma once
22 
23 #include "Hydrax.h"
24 #include "IWater.h"
25 #include "ProjectedGrid.h"
26 
27 #include <Ogre.h>
28 
29 namespace RoR {
30 
33 
34 class HydraxWater : public IWater
35 {
36 public:
37 
38  HydraxWater(float waterHeight, Ogre::String configFile = "HydraxDefault.hdx");
39  ~HydraxWater();
40 
41  // Interface IWater
42  float GetStaticWaterHeight() override;
43  void SetStaticWaterHeight(float value) override;
44  float CalcWavesHeight(Ogre::Vector3 pos) override;
45  Ogre::Vector3 CalcWavesVelocity(Ogre::Vector3 pos) override;
46  void SetWaterVisible(bool value) override;
47  void WaterSetSunPosition(Ogre::Vector3) override;
48  bool IsUnderWater(Ogre::Vector3 pos) override;
49  void FrameStepWater(float dt) override;
50  void UpdateWater() override;
51 
53 
54 protected:
55 
56  void InitHydrax();
58  float waveHeight;
59  float waterHeight;
62  Ogre::String CurrentConfigFile;
63 };
64 
66 
67 } // namespace RoR
RoR::HydraxWater::CalcWavesVelocity
Ogre::Vector3 CalcWavesVelocity(Ogre::Vector3 pos) override
Definition: HydraxWater.cpp:138
RoR::HydraxWater::WaterSetSunPosition
void WaterSetSunPosition(Ogre::Vector3) override
Definition: HydraxWater.cpp:146
Hydrax.h
RoR::HydraxWater
Definition: HydraxWater.h:34
RoR::IWater
< TODO: Mixed gfx+physics (waves) - must be separated ~ only_a_ptr, 02/2018
Definition: IWater.h:32
RoR::HydraxWater::SetWaterVisible
void SetWaterVisible(bool value) override
Definition: HydraxWater.cpp:122
RoR::HydraxWater::GetHydrax
Hydrax::Hydrax * GetHydrax()
Definition: HydraxWater.h:52
RoR::HydraxWater::HydraxWater
HydraxWater(float waterHeight, Ogre::String configFile="HydraxDefault.hdx")
Definition: HydraxWater.cpp:39
RoR::HydraxWater::IsUnderWater
bool IsUnderWater(Ogre::Vector3 pos) override
Definition: HydraxWater.cpp:91
RoR::HydraxWater::~HydraxWater
~HydraxWater()
Definition: HydraxWater.cpp:51
RoR::HydraxWater::waternoise
Hydrax::Noise::Perlin * waternoise
Definition: HydraxWater.h:60
RoR::HydraxWater::mHydrax
Hydrax::Hydrax * mHydrax
Definition: HydraxWater.h:57
RoR::HydraxWater::waveHeight
float waveHeight
Definition: HydraxWater.h:58
RoR::HydraxWater::SetStaticWaterHeight
void SetStaticWaterHeight(float value) override
Definition: HydraxWater.cpp:117
RoR::HydraxWater::GetStaticWaterHeight
float GetStaticWaterHeight() override
Returns static water level configured in 'terrn2'.
Definition: HydraxWater.cpp:112
RoR::HydraxWater::UpdateWater
void UpdateWater() override
Definition: HydraxWater.cpp:98
Hydrax::Module::ProjectedGrid
Hydrax projected grid module.
Definition: ProjectedGrid.h:50
ProjectedGrid.h
RoR::HydraxWater::CurrentConfigFile
Ogre::String CurrentConfigFile
Definition: HydraxWater.h:62
Hydrax::Hydrax
Main Hydrax class.
Definition: Hydrax.h:56
RoR::HydraxWater::waterHeight
float waterHeight
Definition: HydraxWater.h:59
IWater.h
RoR::HydraxWater::CalcWavesHeight
float CalcWavesHeight(Ogre::Vector3 pos) override
Definition: HydraxWater.cpp:128
RoR::HydraxWater::mModule
Hydrax::Module::ProjectedGrid * mModule
Definition: HydraxWater.h:61
Hydrax::Noise::Perlin
Perlin noise module class.
Definition: Perlin.h:73
RoR
Definition: AppContext.h:36
RoR::HydraxWater::FrameStepWater
void FrameStepWater(float dt) override
Definition: HydraxWater.cpp:152
RoR::HydraxWater::InitHydrax
void InitHydrax()
Definition: HydraxWater.cpp:57