sandbox
Loading...
Searching...
No Matches
scene.hpp
1// SPDX-License-Identifier: MIT
2#ifndef LIBSBX_SCENES_SCENE_HPP_
3#define LIBSBX_SCENES_SCENE_HPP_
4
5#include <filesystem>
6#include <string>
7
10#include <libsbx/math/vector3.hpp>
11
12#include <libsbx/scenes/scene_graph.hpp>
13#include <libsbx/scenes/scene_environment.hpp>
14#include <libsbx/scenes/scene_serializer.hpp>
15
16namespace sbx::scenes {
17
19 scenes::node node;
20}; // struct node_destroyed_event
21
22template<typename Component>
24 scenes::node node;
25}; // struct component_removed_event
26
27class scene {
28
29public:
30
31 scene(const std::filesystem::path& path, component_io_registry& component_io, asset_io_registry& asset_io, asset_registry& registry);
32
33 scene(component_io_registry& component_io, asset_io_registry& asset_io, asset_registry& registry, const std::string& name = "Scene");
34
35 virtual ~scene() = default;
36
37 auto graph() -> scene_graph& {
38 return _graph;
39 }
40
41 auto graph() const -> const scene_graph& {
42 return _graph;
43 }
44
45 auto environment() -> scene_environment& {
46 return _environment;
47 }
48
49 auto environment() const -> const scene_environment& {
50 return _environment;
51 }
52
53 auto name() const -> const std::string& {
54 return _name;
55 }
56
57 auto save(const std::filesystem::path& path) -> void;
58
59private:
60
61 std::string _name;
62 scene_graph _graph;
63 scene_environment _environment;
64 scene_serializer _serializer;
65
66}; // class scene
67
68} // namespace sbx::scenes
69
70#endif // LIBSBX_SCENES_SCENE_HPP_
Angle types and utilities.
Definition: tests.cpp:6
Definition: asset_io.hpp:17
Definition: asset_registry.hpp:81
Definition: component_io.hpp:27
Definition: scene_environment.hpp:26
Definition: scene_graph.hpp:32
Definition: scene_serializer.hpp:25
Definition: scene.hpp:27
RGBA color representation and utilities.
Definition: component_io.hpp:19
Definition: scene.hpp:23
Definition: scene.hpp:18