#pragma once #include "../Rendering/Camera.h" #include "Lighting/Environment.h" #include #include "entt/entt.hpp" #include "../Rendering/SkyboxHDR.h" #include "../Rendering/GBuffer.h" #include "../Rendering/ProceduralSky.h" #include "../Core/Core.h" #include "EditorCamera.h" #include "../Resource/Serializable.h" #include "src/UI/UserInterface.h" #include "../Core/Maths.h" #include class Entity; class Scene : public ISerializable { friend Entity; private: std::string Name; bool has_changed = true; std::vector> m_Systems; Ref m_Environement; Ref m_EditorCamera; public: entt::registry m_Registry; std::vector> m_Interfaces; std::string Path = ""; static Ref New(); Scene(); ~Scene(); std::string GetName(); bool SetName(std::string& newName); void Init(); void OnInit(); void OnExit(); void Update(Timestep ts); void FixedUpdate(Timestep ts); void EditorUpdate(Timestep ts); // TODO: Maybe move this to Renderer::DrawScene() ? void DrawShadows(); void DrawInterface(Vector2 screensize); void Draw(); void EditorDraw(); std::vector GetAllEntities(); Entity GetEntity(const std::string& name); // TODO: This shouldnt be allowed Entity CreateEmptyEntity(); Entity CreateEntity(const std::string& name); // TODO: Could be moved to transform component directly. glm::vec3 GetGlobalPosition(Entity ent); void DestroyEntity(Entity entity); // TODO: Could return bool // TODO: Add multiple camera support. Ref GetCurrentCamera(); Ref GetEnvironment(); bool Save(); bool SaveAs(const std::string& path); void ReloadInterfaces(); void AddInterface(Ref interface); json Serialize() override; bool Deserialize(const std::string& str) override; };