3#include "scene/Object.hpp"
4#include "scene/Material.hpp"
5#include "scene/LightProbe.hpp"
6#include "lights/Light.hpp"
8#include "resources/ResourcesManager.hpp"
9#include "input/Camera.hpp"
10#include "system/Codable.hpp"
25 explicit Scene(
const std::string & name);
37 void update(
double fullTime,
double frameTime);
42 std::vector<KeyValues>
encode()
const;
67 std::vector<std::shared_ptr<Light>>
lights;
Represent the smallest axis-aligne box containing a given object or region of space.
Definition: Bounds.hpp:28
This class represents a camera as used in real-time rendering APIs. It provides a view and projection...
Definition: Camera.hpp:11
Represent a surface material, including textures describing the surface parameters.
Definition: Material.hpp:72
Represents a 3D environment composed of objects, a background and additional environment lighting inf...
Definition: Scene.hpp:18
Camera _camera
The initial viewpoint on the scene.
Definition: Scene.hpp:153
bool _loaded
Has the scene already been loaded from disk.
Definition: Scene.hpp:157
bool loadMaterial(const KeyValues ¶ms, Storage options)
Definition: Scene.cpp:138
Material _backgroundMaterial
Background material, containing the optional textures to use.
Definition: Scene.hpp:152
void update(double fullTime, double frameTime)
Definition: Scene.cpp:309
std::vector< KeyValues > encode() const
Definition: Scene.cpp:224
Background backgroundMode
The background mode (see enum).
Definition: Scene.hpp:76
std::vector< LightProbe > probes
Reflection probes.
Definition: Scene.hpp:78
Background
The background mode to use for a scene.
Definition: Scene.hpp:70
@ COLOR
Use a unique color as background.
@ IMAGE
Use a 2D texture image as background (will be stretched).
@ ATMOSPHERE
Use a realtime atmospheric scattering simulation.
@ SKYBOX
Use a skybox/cubemap as background.
void computeBoundingBoxes(BoundingBox &globalBox, BoundingBox &casterBox)
Definition: Scene.cpp:287
bool loadScene(const KeyValues ¶ms, Storage options)
Definition: Scene.cpp:218
std::unique_ptr< Object > background
Background object, containing the geometry to use.
Definition: Scene.hpp:77
bool loadProbe(const KeyValues ¶ms, Storage options)
Definition: Scene.cpp:213
bool animated() const
Definition: Scene.hpp:60
void setViewpoint(const Camera &cam)
Definition: Scene.hpp:57
BoundingBox _bbox
The scene bounding box.
Definition: Scene.hpp:154
const Camera & viewpoint() const
Definition: Scene.hpp:52
std::vector< Material > materials
The materials in the scene.
Definition: Scene.hpp:66
bool transparent() const
Definition: Scene.hpp:63
Scene(const Scene &)=delete
bool loadLight(const KeyValues ¶ms, Storage options)
Definition: Scene.cpp:143
const BoundingBox & boundingBox() const
Definition: Scene.hpp:47
Scene & operator=(Scene &&)=delete
std::vector< Object > objects
The objects in the scene.
Definition: Scene.hpp:65
Scene & operator=(const Scene &)=delete
bool loadCamera(const KeyValues ¶ms, Storage options)
Definition: Scene.cpp:152
bool loadObject(const KeyValues ¶ms, Storage options)
Definition: Scene.cpp:133
std::vector< std::shared_ptr< Light > > lights
Lights present in the scene.
Definition: Scene.hpp:67
glm::mat4 _sceneModel
The scene global transformation.
Definition: Scene.hpp:155
bool _transparent
Is the scene containing transparent objects.
Definition: Scene.hpp:159
bool _animated
Is the scene using animations.
Definition: Scene.hpp:158
bool init(Storage options)
Definition: Scene.cpp:31
bool loadBackground(const KeyValues ¶ms, Storage options)
Definition: Scene.cpp:156
std::string _name
The scene file name.
Definition: Scene.hpp:156
Storage
Storage and loading options.
Definition: ResourcesManager.hpp:14
Represent a key-values tuple.
Definition: Config.hpp:9