aboutsummaryrefslogtreecommitdiff
path: root/src/scene/scene_types.h
blob: 61bea355997056782eb1d027c0824cc4886aeee7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once

#include <glm/glm.hpp>

namespace Donut
{
    // 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
    // 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
    // the list; SceneRenderer draws it the same way on every backend.
    struct SceneObject
    {
        glm::vec3 position = { 0.0f, 2.0f, 0.0f };
        float     radius   = 2.0f;
        glm::vec3 color    = { 0.85f, 0.35f, 0.2f };
    };

    // 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
    {
        float disk_inner_rs = 3.0f;      // inner edge (x r_s)
        float disk_outer_rs = 12.0f;     // outer edge (x r_s)
        float temperature   = 4800.0f;   // Kelvin at the flux peak (disk colour)
        float brightness    = 0.9f;      // disk exposure
        float turbulence    = 0.4f;      // 0 = smooth physical disk
        int   quality_steps = 15000;     // geodesic integration steps
        float fov_degrees   = 60.0f;     // camera field of view
    };
}