mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-20 11:29:18 +02:00
refactoring: application mode code split
This commit is contained in:
52
simulationenvironment.h
Normal file
52
simulationenvironment.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
distributed with this file, You can
|
||||
obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "sky.h"
|
||||
#include "sun.h"
|
||||
#include "moon.h"
|
||||
#include "stars.h"
|
||||
#include "skydome.h"
|
||||
|
||||
class opengl_renderer;
|
||||
|
||||
// wrapper for environment elements -- sky, sun, stars, clouds etc
|
||||
class world_environment {
|
||||
|
||||
friend opengl_renderer;
|
||||
|
||||
public:
|
||||
// methods
|
||||
void init();
|
||||
void update();
|
||||
void time( int const Hour = -1, int const Minute = -1, int const Second = -1 );
|
||||
// switches between static and dynamic daylight calculation
|
||||
void toggle_daylight();
|
||||
// calculates current season of the year based on set simulation date
|
||||
void compute_season( int const Yearday ) const;
|
||||
// calculates current weather
|
||||
void compute_weather() const;
|
||||
|
||||
private:
|
||||
// members
|
||||
CSkyDome m_skydome;
|
||||
cStars m_stars;
|
||||
cSun m_sun;
|
||||
cMoon m_moon;
|
||||
TSky m_clouds;
|
||||
};
|
||||
|
||||
namespace simulation {
|
||||
|
||||
extern world_environment Environment;
|
||||
|
||||
} // simulation
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user