]> git.mxchange.org Git - simgear.git/blob - simgear/environment/visual_enviro.cxx
ebe8f85549c625ac4d09822d7fd4d22a33ba0ccd
[simgear.git] / simgear / environment / visual_enviro.cxx
1 // Visual environment helper class
2 //
3 // Written by Harald JOHNSEN, started April 2005.
4 //
5 // Copyright (C) 2005  Harald JOHNSEN - hjohnsen@evc.net
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
20 //
21 //
22
23 #include <simgear/scene/sky/cloudfield.hxx>
24 #include <simgear/scene/sky/newcloud.hxx>
25 #include "visual_enviro.hxx"
26
27 SGEnviro sgEnviro;
28
29 SGEnviro::SGEnviro(void) :
30         view_in_cloud(false),
31         precipitation_enable_state(false),
32         precipitation_density(100.0)
33
34 {
35 }
36
37 SGEnviro::~SGEnviro(void) {
38 }
39
40 void SGEnviro::startOfFrame(void) {
41         view_in_cloud = false;
42         if(SGNewCloud::cldCache)
43                 SGNewCloud::cldCache->startNewFrame();
44 }
45
46 void SGEnviro::endOfFrame(void) {
47 }
48
49 // this can be queried to add some turbulence for example
50 bool SGEnviro::is_view_in_cloud(void) const {
51         return view_in_cloud;
52 }
53 void SGEnviro::set_view_in_cloud(bool incloud) {
54         view_in_cloud = incloud;
55 }
56
57 int SGEnviro::get_CacheResolution(void) const {
58         return SGCloudField::get_CacheResolution();
59 }
60
61 int SGEnviro::get_clouds_CacheSize(void) const {
62         return SGCloudField::get_CacheSize();
63 }
64 float SGEnviro::get_clouds_visibility(void) const {
65         return SGCloudField::get_CloudVis();
66 }
67 float SGEnviro::get_clouds_density(void) const {
68         return SGCloudField::get_density();
69 }
70 bool SGEnviro::get_clouds_enable_state(void) const {
71         return SGCloudField::get_enable3dClouds();
72 }
73
74 void SGEnviro::set_CacheResolution(int resolutionPixels) {
75         SGCloudField::set_CacheResolution(resolutionPixels);
76 }
77
78 void SGEnviro::set_clouds_CacheSize(int sizeKb) {
79         SGCloudField::set_CacheSize(sizeKb);
80 }
81 void SGEnviro::set_clouds_visibility(float distance) {
82         SGCloudField::set_CloudVis(distance);
83 }
84 void SGEnviro::set_clouds_density(float density) {
85         SGCloudField::set_density(density);
86 }
87 void SGEnviro::set_clouds_enable_state(bool enable) {
88         SGCloudField::set_enable3dClouds(enable);
89 }
90
91 // rain/snow
92 float SGEnviro::get_precipitation_density(void) const {
93         return precipitation_density;
94 }
95 bool SGEnviro::get_precipitation_enable_state(void) const {
96         return precipitation_enable_state;
97 }
98
99 void SGEnviro::set_precipitation_density(float density) {
100         precipitation_density = density;
101 }
102 void SGEnviro::set_precipitation_enable_state(bool enable) {
103         precipitation_enable_state = enable;
104 }
105
106 // others
107 bool SGEnviro::get_lightning_enable_state(void) const {
108         return false;
109 }
110
111 void SGEnviro::set_lightning_enable_state(bool enable) {
112 }
113