AtmosphereTestScene.hpp 1.8 KB
Newer Older
Dario Seyb's avatar
Dario Seyb committed
1 2 3 4 5
#pragma once
#include <engine/scene/Scene.hpp>
#include <engine/scene/OrbitalSimulationSystem.hpp>
#include <engine/scene/PlayerSystem.hpp>
#include <engine/audio/SoundSource.hpp>
6 7
#include <engine/scene/scenes/Console.hpp>

Dario Seyb's avatar
Dario Seyb committed
8 9 10 11 12
class AtmosphereTestScene : public Scene {
private:
  OrbitalSimulationSystem* m_orbitals;
  PlayerSystem* m_player;

13 14
  Console m_console;

David Gilbert's avatar
David Gilbert committed
15
  Light::Handle sunLight, sunLight2;
Dario Seyb's avatar
Dario Seyb committed
16
  Entity sun;
David Gilbert's avatar
David Gilbert committed
17
  Entity sun2;
Dario Seyb's avatar
Dario Seyb committed
18 19
  Entity skybox;

Dario Seyb's avatar
Dario Seyb committed
20 21
  Entity loadingText;

David Gilbert's avatar
David Gilbert committed
22 23
  Entity mercury;
  Entity venus;
Dario Seyb's avatar
Dario Seyb committed
24
  Entity earth;
David Gilbert's avatar
David Gilbert committed
25 26 27 28 29 30
  Entity mars;
  Entity jupiter;
  Entity saturn;
  Entity uranus;
  Entity neptune;

Dario Seyb's avatar
Dario Seyb committed
31
  Entity cockpit;
Dario Seyb's avatar
merged  
Dario Seyb committed
32 33
  Entity cockpitSun;
  Light::Handle cockpitSunLight;
Dario Seyb's avatar
Dario Seyb committed
34

Dario Seyb's avatar
Dario Seyb committed
35
  Entity consoleCamera;
36
  SoundSource::Handle consoleSoundSource;
Dario Seyb's avatar
Dario Seyb committed
37
  SoundSource::Handle cockpitSoundSource;
Dario Seyb's avatar
Dario Seyb committed
38

Dario Seyb's avatar
Dario Seyb committed
39
  Material cockpitMaterial, sunMaterial, skyboxMaterial, windshieldMaterial;
Dario Seyb's avatar
Dario Seyb committed
40 41
  Geometry cockpitGeometry, sunGeometry, skyboxGeometry;

Dario Seyb's avatar
Dario Seyb committed
42 43 44 45
  Geometry consoleGeom, consoleFrontLeftGeom, consoleFrontRightGeom, consoleBackLeftGeom, consoleBackRightGeom, consoleMiddleLeftGeom, consoleMiddleRightGeom, windShieldGeom;

  std::shared_ptr<Sound> soundTrackIntro, soundTrackMain;

Dario Seyb's avatar
Dario Seyb committed
46 47 48 49 50 51 52 53 54 55 56
  bool resourceLoadingFinished = false;
  bool mainSceneRunning = false;
 
  bool isInterpolatingCamera = false;
  float interpolationTime, totalInterpolationTime;
  glm::dvec3 camStartPos;
  glm::dvec3 camTargetPos;

  glm::quat camStartRot;
  glm::quat camTargetRot;

Dario Seyb's avatar
Dario Seyb committed
57
  const glm::dvec3 CAM_CONSOLE_POS = { 0, -0.24977, -2.79714 };
Dario Seyb's avatar
Dario Seyb committed
58 59 60 61
  const glm::mat4 CAM_CONSOLE_ROT = glm::rotate(-1.05, glm::dvec3{ 1.0, 0.0, 0.0 });

  bool isFocusedOnConsole = true;

Dario Seyb's avatar
Dario Seyb committed
62 63
  bool didOneFrame = false;

Dario Seyb's avatar
Dario Seyb committed
64 65
public:
  CONSTRUCT_SCENE(AtmosphereTestScene) { };
Dario Seyb's avatar
Dario Seyb committed
66 67 68
  
  void switchToMainScene();
  void loadMainSceneResources();
Dario Seyb's avatar
Dario Seyb committed
69 70
  void switchConsole();

Dario Seyb's avatar
Dario Seyb committed
71 72
  bool startup() override;
  void shutdown() override;
Dario Seyb's avatar
Dario Seyb committed
73

Dario Seyb's avatar
Dario Seyb committed
74
};