From 5ea6c14c0e14bacee766ce1280ab2c71564e05ec Mon Sep 17 00:00:00 2001 From: hachem Date: Sun, 23 Aug 2026 21:55:36 +0200 Subject: [feat]: implement ui layer arch --- src/scene/scene.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/scene/scene.h (limited to 'src/scene/scene.h') diff --git a/src/scene/scene.h b/src/scene/scene.h new file mode 100644 index 0000000..27d1327 --- /dev/null +++ b/src/scene/scene.h @@ -0,0 +1,39 @@ +#pragma once + +#include "scene_types.h" +#include "core/camera.h" + +#include +#include + +namespace Donut +{ + // The document: everything the app edits and renders, independent of any + // backend or UI. Workspaces (tabs) read and mutate this; the RenderPath reads + // it to draw. It owns the two viewpoints (cameras) as scene state, plus small + // camera-framing helpers, since a viewpoint is part of the document. + class Scene + { + public: + Scene(); + + // world-builder content + std::vector objects{ SceneObject{} }; + int selected_object = 0; + + // black hole / accretion disk + BlackHoleParams black_hole; + + // environment + std::string hdri_path = "assets/hdri/hdr_blue_nebulae_1.hdr"; + + // viewpoints + Camera sim_camera{ 60.0f, 16.0f / 9.0f, 0.1f, 100.0f }; // black-hole view + Camera scene_camera{ 45.0f, 16.0f / 9.0f, 0.1f, 1000.0f }; // world-builder view + + // Camera framing helpers (the sim view supports orbital + free-fly). + auto reset_sim_camera() -> void; + auto set_free_fly(bool enabled) -> void; + auto is_free_fly() const -> bool { return sim_camera.get_camera_mode() == CameraMode::FPS; } + }; +} -- cgit v1.3