Represents a 3D environment composed of objects, a background and additional environment lighting informations, along with serialization support.
More...
#include <Scene.hpp>
|
std::vector< Object > | objects |
| The objects in the scene.
|
|
std::vector< Material > | materials |
| The materials in the scene.
|
|
std::vector< std::shared_ptr< Light > > | lights |
| Lights present in the scene.
|
|
Background | backgroundMode = Background::COLOR |
| The background mode (see enum).
|
|
std::unique_ptr< Object > | background |
| Background object, containing the geometry to use.
|
|
std::vector< LightProbe > | probes |
| Reflection probes.
|
|
|
Material | _backgroundMaterial |
| Background material, containing the optional textures to use.
|
|
Camera | _camera |
| The initial viewpoint on the scene.
|
|
BoundingBox | _bbox |
| The scene bounding box.
|
|
glm::mat4 | _sceneModel = glm::mat4(1.0f) |
| The scene global transformation.
|
|
std::string | _name |
| The scene file name.
|
|
bool | _loaded = false |
| Has the scene already been loaded from disk.
|
|
bool | _animated = false |
| Is the scene using animations.
|
|
bool | _transparent = false |
| Is the scene containing transparent objects.
|
|
Represents a 3D environment composed of objects, a background and additional environment lighting informations, along with serialization support.
◆ Background
The background mode to use for a scene.
Enumerator |
---|
COLOR | Use a unique color as background.
|
IMAGE | Use a 2D texture image as background (will be stretched).
|
SKYBOX | Use a skybox/cubemap as background.
|
ATMOSPHERE | Use a realtime atmospheric scattering simulation.
|
◆ Scene() [1/3]
Scene::Scene |
( |
const std::string & |
name | ) |
|
|
explicit |
Constructor from a scene description file.
- Parameters
-
name | the name of the scene description file |
◆ Scene() [2/3]
Scene::Scene |
( |
const Scene & |
| ) |
|
|
delete |
◆ Scene() [3/3]
Scene::Scene |
( |
Scene && |
| ) |
|
|
delete |
◆ animated()
bool Scene::animated |
( |
| ) |
const |
|
inline |
- Returns
- true if the scene contains animations
◆ boundingBox()
Get the scene bounding box.
- Returns
- the bounding box
◆ computeBoundingBoxes()
Compute the bounding box of the scene, including and excluding objects that do not cast shadows.
- Parameters
-
globalBox | the bounding box encompassing all objects in the scene |
casterBox | the bounding box encompassing shadow casting objects only |
◆ encode()
std::vector< KeyValues > Scene::encode |
( |
| ) |
const |
Convert a scene to a Codable-compliant list of key-values tuples. Can be used for serialization.
- Returns
- a list of tuples
◆ init()
bool Scene::init |
( |
Storage |
options | ) |
|
Performs initialization against the graphics API, loading data.
- Parameters
-
options | data loading and storage options. |
- Returns
- the initialization success
◆ loadBackground()
Load the scene background informations from its serialized representation.
- Parameters
-
params | the background parameters |
options | data loading and storage options |
- Returns
- the loading status
◆ loadCamera()
Load the scene camera informations from its serialized representation.
- Parameters
-
params | the camera parameters |
options | data loading and storage options (unused) |
- Returns
- the loading status
◆ loadLight()
Load a point light in the scene from its serialized representation.
- Parameters
-
params | the point light parameters |
options | data loading and storage options (unused) |
- Returns
- the loading status
◆ loadMaterial()
Load a material in the scene from its serialized representation.
- Parameters
-
params | the material parameters |
options | data loading and storage options |
- Returns
- the loading status
◆ loadObject()
Load an object in the scene from its serialized representation.
- Parameters
-
params | the object parameters |
options | data loading and storage options |
- Returns
- the loading status
◆ loadProbe()
Load the scene environment informations from its serialized representation.
- Parameters
-
params | the probe parameters |
options | data loading and storage options |
- Returns
- the loading status
◆ loadScene()
Load the scene informations from its serialized representation.
- Parameters
-
params | the scene parameters |
options | data loading and storage options |
- Returns
- the loading status
◆ operator=() [1/2]
Copy assignment.
- Returns
- a reference to the object assigned to
◆ operator=() [2/2]
Move assignment.
- Returns
- a reference to the object assigned to
◆ setViewpoint()
void Scene::setViewpoint |
( |
const Camera & |
cam | ) |
|
|
inline |
Set the initial viewpoint on the scene.
- Parameters
-
◆ transparent()
bool Scene::transparent |
( |
| ) |
const |
|
inline |
- Returns
- true if the scene contains transparent objects
◆ update()
void Scene::update |
( |
double |
fullTime, |
|
|
double |
frameTime |
|
) |
| |
Update the animations in the scene.
- Parameters
-
fullTime | the time elapsed since the beginning of the render loop |
frameTime | the duration of the last frame |
◆ viewpoint()
const Camera & Scene::viewpoint |
( |
| ) |
const |
|
inline |
Get the initial viewpoint on the scene.
- Returns
- the viewpoint camera
The documentation for this class was generated from the following files:
- src/engine/scene/Scene.hpp
- src/engine/scene/Scene.cpp