aboutsummaryrefslogtreecommitdiff
path: root/src/scene
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-24 18:28:39 +0200
committerhachem <im@hachem.wtf>2026-08-24 18:28:39 +0200
commita34c49f103c8950a57687ea3d866c244d95b4414 (patch)
treeff268f4a7f52769a252443d6f2822c9814e3bb1c /src/scene
parent06398a7a176e123506de6e8851866a8bec0b3427 (diff)
[docs]: added a few comments cause i wont be able to read this in a week's time
Diffstat (limited to 'src/scene')
-rw-r--r--src/scene/scene.cpp6
-rw-r--r--src/scene/scene.h13
-rw-r--r--src/scene/scene_types.h12
3 files changed, 14 insertions, 17 deletions
diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp
index b8ab005..8386ca6 100644
--- a/src/scene/scene.cpp
+++ b/src/scene/scene.cpp
@@ -10,7 +10,7 @@ namespace Donut
{
Scene::Scene()
{
- // Black-hole camera: large-scale orbital viewer outside the disk.
+ // black-hole camera: large-scale orbital viewer outside the disk.
sim_camera.set_camera_mode(CameraMode::Orbital);
sim_camera.set_orbital_target(glm::vec3(0.0f));
sim_camera.set_orbital_radius(4e11); // ~31 r_s: outside the 12 r_s disk
@@ -20,7 +20,7 @@ namespace Donut
sim_camera.set_azimuth(0.0f);
sim_camera.set_elevation(1.25f);
- // Scene camera: normal-scale orbital world-builder viewer.
+ // scene camera: normal-scale orbital world-builder viewer.
scene_camera.set_camera_mode(CameraMode::Orbital);
scene_camera.set_orbital_target(glm::vec3(0.0f));
scene_camera.set_orbital_radius(30.0); // frame the hole + orbiting objects (in r_s)
@@ -46,7 +46,7 @@ namespace Donut
if (enabled == is_fps) return;
if (enabled)
{
- // Seed the fly pose from the current orbital framing so the view is continuous.
+ // seed the fly pose from the current orbital framing so the view is continuous.
glm::vec3 pos = sim_camera.get_orbital_position();
glm::vec3 fwd = glm::normalize(sim_camera.get_orbital_target() - pos);
float pitch = glm::degrees(asin(glm::clamp(fwd.y, -1.0f, 1.0f)));
diff --git a/src/scene/scene.h b/src/scene/scene.h
index 23d884f..d585a28 100644
--- a/src/scene/scene.h
+++ b/src/scene/scene.h
@@ -8,31 +8,28 @@
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
+ // the document: everything the app edits and renders, independent of any
+ // backend or UI. the UI panels 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. The default object orbits clear of the hole at the
+ // world-builder content. the default object orbits clear of the hole at the
// origin (positions are in Schwarzschild radii; see BH_SCENE_RADIUS).
std::vector<SceneObject> objects{ SceneObject{ { 18.0f, 6.0f, 0.0f }, 2.0f, { 0.85f, 0.35f, 0.2f } } };
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).
+ // 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; }
diff --git a/src/scene/scene_types.h b/src/scene/scene_types.h
index 61bea35..9ca3276 100644
--- a/src/scene/scene_types.h
+++ b/src/scene/scene_types.h
@@ -4,17 +4,17 @@
namespace Donut
{
- // Backend-agnostic scene/black-hole data shared by the Application and the
- // portable renderers (SceneRenderer, BlackHoleRenderer). The rendering itself
+ // backend-agnostic scene/black-hole data shared by the Application and the
+ // portable renderers (SceneRenderer, BlackHoleRenderer). the rendering itself
// is written once on the RHI (rendering/rhi.h); these are just the inputs.
- // The scene editor and the simulation share ONE world at this scale: this many
- // grid units == one Schwarzschild radius. The SceneRenderer draws the hole's
+ // the scene editor and the simulation share ONE world at this scale: this many
+ // grid units == one Schwarzschild radius. the SceneRenderer draws the hole's
// horizon at this radius; the BlackHoleRenderer maps scene positions into
// physical units (x SagA_rs / SCENE_UNITS_PER_RS) so placed objects line up.
constexpr float SCENE_UNITS_PER_RS = 3.0f;
- // A placeable/editable sphere in the world-builder scene view. The app owns
+ // a placeable/editable sphere in the world-builder scene view. the app owns
// the list; SceneRenderer draws it the same way on every backend.
struct SceneObject
{
@@ -23,7 +23,7 @@ namespace Donut
glm::vec3 color = { 0.85f, 0.35f, 0.2f };
};
- // Live-tunable black-hole / accretion-disk parameters. Radii are in
+ // live-tunable black-hole / accretion-disk parameters. radii are in
// Schwarzschild radii; the inner edge is clamped to the ISCO (3 r_s).
struct BlackHoleParams
{