AtmosphereTestScene.hpp 1.18 KB
Newer Older
Dario Seyb's avatar
Dario Seyb committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#pragma once
#include <engine/scene/Scene.hpp>
#include <engine/scene/OrbitalSimulationSystem.hpp>
#include <engine/scene/PlayerSystem.hpp>
#include <engine/audio/SoundSource.hpp>

class AtmosphereTestScene : public Scene {
private:
  OrbitalSimulationSystem* m_orbitals;
  PlayerSystem* m_player;

  Light::Handle sunLight;
  Entity sun;
Dario Seyb's avatar
Dario Seyb committed
14 15
  Entity skybox;

Dario Seyb's avatar
Dario Seyb committed
16
  Entity earth;
Dario Seyb's avatar
Dario Seyb committed
17
  Entity cockpit;
Dario Seyb's avatar
merged  
Dario Seyb committed
18 19
  Entity cockpitSun;
  Light::Handle cockpitSunLight;
Dario Seyb's avatar
Dario Seyb committed
20

Dario Seyb's avatar
Dario Seyb committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
  Entity consoleCamera;

  Material cockpitMaterial, sunMaterial, skyboxMaterial;
  Geometry cockpitGeometry, sunGeometry, skyboxGeometry;

  bool resourceLoadingFinished = false;
  bool mainSceneRunning = false;
 
  bool isInterpolatingCamera = false;
  float interpolationTime, totalInterpolationTime;
  glm::dvec3 camStartPos;
  glm::dvec3 camTargetPos;

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

  const glm::dvec3 CAM_CONSOLE_POS = { 0, -0.05, -1.95 };
  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
42 43
public:
  CONSTRUCT_SCENE(AtmosphereTestScene) { };
Dario Seyb's avatar
Dario Seyb committed
44 45 46
  
  void switchToMainScene();
  void loadMainSceneResources();
Dario Seyb's avatar
Dario Seyb committed
47 48 49
  bool startup() override;
  void shutdown() override;
};