Rise
The Vieneo Province
weather.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <WinSock2.h>
4 #include <WS2tcpip.h>
5 #include <Windows.h>
6 #include "DXUT.h"
7 #include "../Logger.h"
8 
9 class Viewscreen;
10 
11 // Highest peak wind Thule Air Base, Greenland 333 kph/207 mph
12 // Highest average wind speed in 24 hours Port Martin, Antarctica 174 kph/108 mph
13 // Highest peak wind gust Mt. Washington (NH) 372 kph/231 mph
14 // Highest monthly average wind speed Port Martin, Antarctica 105 kph/65 mph
15 
16 // Gusts/turbulence, turbulence variable is 0-1
17 
18 class weather
19 {
20  Viewscreen* viewscreen = nullptr;
21  Logger* logger = nullptr;
22 
23  char msg[199] = { 0 };
24  short r = 0, s = 0, t = 0;
25 
26  bool hullionization = false;
27 
28  float turbulence = 0.0f; // turbulence 0.0f-1.0f
29  float windspeed = 0.0f; // kms
30 
31  float turbidity = 2.0f; // turbidity scale 1 is practical lowest clear, 8 is saturated
32  float smoothTurbidity = -1.0f; // init
33  float winddir = 0.0f; // radians 0-6.282
34  float smoothwinddir = -1.0f;
35  float temperature = 20.0f;
36  float smoothTemperature = -1.0f;
37 
38  float cloudCeilingTargetKm = 1.8f;
39  float cloudSurfaceTargetKm = 0.0f;
40  float cloudCeilingSmoothAglKm = -1.0f;
41  float cloudSurfaceSmoothKm = -1.0f;
42 
43 
44 public:
45  weather(Viewscreen* ptr);
46 
47  void FrameMove(float fElapsedTime);
48  void SetWindDirectionRadians(float prmWinddir);
49  void SetTurbulenceScalar(float prmTurbulence);
50  void SetTemperatureCelsius(float prmTemperature);
51  void SetWindspeedKms(float prmWindspeed);
52  void SetTurbidity(float prmTurbidity);
53  void SetCloudSurfaceTargetKm(float prmCloudSurfaceTargetKm);
54  void SetCloudCeilingTargetKm(float prmCloudCeilingTargetKm);
56  float GetWindspeedKms() const;
57  float GetTurbidity() const;
58  float GetWindDirectionRadians() const;
59  float GetTurbulence() const;
60  float GetTemperatureCelsius() const;
61  float GetCloudCeilingMslKm() const;
62 
63  D3DXCOLOR dwFogColorZenith = 0UL;
64  D3DXCOLOR dwFogFactorZenith = 0UL;
65  D3DXCOLOR dwFogColorHorizon = 0UL;
67  float elevation = 0.0f;
68  D3DXCOLOR colorhorizon = 0UL;
69  D3DXCOLOR betascreen = 0UL;
70  float cloudVisSmooth = 1.0f, cloudVisTarget = 1.0f; // scalar for alphascreen
71  float shearRate = 0.0f;
72 
73  //Needed in render cities
74  float fFogEndHorizon = 0.0f;
75 
76  //Needed for radar
77  //unsigned char weathergrid[64][64] = {};
78 
79  // Block light from sun by Vieneo
80  float shadow = 0.0f;
81  float cloudThickness = 0.0f;
82 
83  float daylightOverride = -1.0f; // admin override
84  float alphascreenOverride = -1.0f; // admin override
85  float gammascreenOverride = -1.0f; // admin override
86  bool elmoOverride = false;
87 };
void SetCloudCeilingTargetKm(float prmCloudCeilingTargetKm)
Definition: weather.cpp:887
bool elmoOverride
Definition: weather.h:86
float cloudVisTarget
Definition: weather.h:70
float GetCloudCeilingMslKm() const
Definition: weather.cpp:945
float cloudSurfaceSmoothKm
Definition: weather.h:41
float cloudVisSmooth
Definition: weather.h:70
weather(Viewscreen *ptr)
Definition: weather.cpp:5
float daylightOverride
Definition: weather.h:83
float GetWindDirectionRadians() const
Definition: weather.cpp:921
D3DXCOLOR colorhorizon
Definition: weather.h:68
Definition: Logger.h:9
short t
Definition: weather.h:24
bool hullionization
Definition: weather.h:26
float cloudThickness
Definition: weather.h:81
float alphascreenOverride
Definition: weather.h:84
void SetTurbidity(float prmTurbidity)
Definition: weather.cpp:867
float cloudCeilingTargetKm
Definition: weather.h:38
float cloudHorizonDistance
Definition: weather.h:66
void SetTurbulenceScalar(float prmTurbulence)
Definition: weather.cpp:845
float gammascreenOverride
Definition: weather.h:85
float fFogEndHorizon
Definition: weather.h:74
float GetWindspeedKms() const
Definition: weather.cpp:905
float GetTemperatureCelsius() const
Definition: weather.cpp:937
float smoothwinddir
Definition: weather.h:34
void FrameMove(float fElapsedTime)
Definition: weather.cpp:11
void InitializeSmoothValues()
Definition: weather.cpp:897
void SetWindDirectionRadians(float prmWinddir)
Definition: weather.cpp:835
float cloudSurfaceTargetKm
Definition: weather.h:39
short s
Definition: weather.h:24
Logger * logger
Definition: weather.h:21
float cloudHorizonAngle
Definition: weather.h:66
D3DXCOLOR betascreen
Definition: weather.h:69
Viewscreen * viewscreen
Definition: weather.h:20
D3DXCOLOR dwFogColorHorizon
Definition: weather.h:65
D3DXCOLOR dwFogColorZenith
Definition: weather.h:63
void SetTemperatureCelsius(float prmTemperature)
Definition: weather.cpp:851
float turbulence
Definition: weather.h:28
float turbidity
Definition: weather.h:31
float shearRate
Definition: weather.h:71
float GetTurbulence() const
Definition: weather.cpp:929
float smoothTemperature
Definition: weather.h:36
float shadow
Definition: weather.h:80
void SetWindspeedKms(float prmWindspeed)
Definition: weather.cpp:861
float GetTurbidity() const
Definition: weather.cpp:913
float temperature
Definition: weather.h:35
void SetCloudSurfaceTargetKm(float prmCloudSurfaceTargetKm)
Definition: weather.cpp:877
float smoothTurbidity
Definition: weather.h:32
float winddir
Definition: weather.h:33
char msg[199]
Definition: weather.h:23
float windspeed
Definition: weather.h:29
D3DXCOLOR dwFogFactorZenith
Definition: weather.h:64
float elevation
Definition: weather.h:67
float cloudCeilingSmoothAglKm
Definition: weather.h:40
short r
Definition: weather.h:24