scene.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #pragma once
  2. #include <irrlicht/irrlicht.h>
  3. #include <nlohmann/json.hpp>
  4. #include "project.h"
  5. #include "scenes/camera.h"
  6. #include "scenes/projection.h"
  7. namespace wp::core
  8. {
  9. using json = nlohmann::json;
  10. class project;
  11. class scene
  12. {
  13. public:
  14. static scene* fromFile (const irr::io::path& filename);
  15. project* getProject ();
  16. const irr::video::SColorf &getAmbientColor() const;
  17. bool isBloom() const;
  18. irr::f64 getBloomStrength() const;
  19. irr::f64 getBloomThreshold() const;
  20. bool isCameraFade() const;
  21. bool isCameraParallax() const;
  22. irr::f64 getCameraParallaxAmount() const;
  23. irr::f64 getCameraParallaxDelay() const;
  24. irr::f64 getCameraParallaxMouseInfluence() const;
  25. bool isCameraPreview() const;
  26. bool isCameraShake() const;
  27. irr::f64 getCameraShakeAmplitude() const;
  28. irr::f64 getCameraShakeRoughness() const;
  29. irr::f64 getCameraShakeSpeed() const;
  30. const irr::video::SColorf &getClearColor() const;
  31. scenes::projection *getOrthogonalProjection() const;
  32. const irr::video::SColorf &getSkylightColor() const;
  33. protected:
  34. friend class project;
  35. void setProject (project* project);
  36. scenes::camera* getCamera ();
  37. scene (
  38. scenes::camera* camera,
  39. irr::video::SColorf ambientColor,
  40. bool bloom,
  41. irr::f64 bloomStrength,
  42. irr::f64 bloomThreshold,
  43. bool cameraFade,
  44. bool cameraParallax,
  45. irr::f64 cameraParallaxAmount,
  46. irr::f64 cameraParallaxDelay,
  47. irr::f64 cameraParallaxMouseInfluence,
  48. bool cameraPreview,
  49. bool cameraShake,
  50. irr::f64 cameraShakeAmplitude,
  51. irr::f64 cameraShakeRoughness,
  52. irr::f64 cameraShakeSpeed,
  53. irr::video::SColorf clearColor,
  54. scenes::projection* orthogonalProjection,
  55. irr::video::SColorf skylightColor
  56. );
  57. private:
  58. project* m_project;
  59. scenes::camera* m_camera;
  60. // data from general section on the json
  61. irr::video::SColorf m_ambientColor;
  62. bool m_bloom;
  63. irr::f64 m_bloomStrength;
  64. irr::f64 m_bloomThreshold;
  65. bool m_cameraFade;
  66. bool m_cameraParallax;
  67. irr::f64 m_cameraParallaxAmount;
  68. irr::f64 m_cameraParallaxDelay;
  69. irr::f64 m_cameraParallaxMouseInfluence;
  70. bool m_cameraPreview;
  71. bool m_cameraShake;
  72. irr::f64 m_cameraShakeAmplitude;
  73. irr::f64 m_cameraShakeRoughness;
  74. irr::f64 m_cameraShakeSpeed;
  75. irr::video::SColorf m_clearColor;
  76. scenes::projection* m_orthogonalProjection;
  77. irr::video::SColorf m_skylightColor;
  78. };
  79. };