|
lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
|
Represents a 3D scene graph with a root node. More...
#include <scene.hpp>
Public Member Functions | |
| Scene (const std::string &name="Scene") | |
| Constructor for the Scene class. | |
| std::shared_ptr< Node > | get_root () const |
| Getter for the root node. | |
| void | update () |
| Update the scene. | |
| const std::string & | get_name () const |
| Getters and setters for the scene's name. | |
| void | set_name (const std::string &name) |
| Set the name of the scene. | |
| std::vector< std::shared_ptr< Light > > | get_lights () const |
| Returns all the lights in the scene. | |
| void | add_light (std::shared_ptr< Light > light) |
| Adds a light in the scene. | |
| void | remove_light (std::shared_ptr< Light > light) |
| Removes a light from the scene. | |
| void | clear_lights () |
| Removes all lights from the scene. | |
| void | set_skybox (std::shared_ptr< Skybox > skybox) |
| Set the skybox for the scene. | |
| std::shared_ptr< Skybox > | get_skybox () const |
| Get the skybox of the scene. | |
Represents a 3D scene graph with a root node.
The Scene class encapsulates a 3D scene graph, providing a root node from which all other nodes in the scene can be accessed. It also provides methods to update the scene.
| lmgl::scene::Scene::Scene | ( | const std::string & | name = "Scene" | ) |
| void lmgl::scene::Scene::add_light | ( | std::shared_ptr< Light > | light | ) |
Adds a light in the scene.
| light | the light to add. |
|
inline |
Returns all the lights in the scene.
|
inline |
Getters and setters for the scene's name.
Provides access to the scene's name property.
|
inline |
Getter for the root node.
Provides access to the root node of the scene graph.
|
inline |
Get the skybox of the scene.
| void lmgl::scene::Scene::remove_light | ( | std::shared_ptr< Light > | light | ) |
Removes a light from the scene.
| light | the light to remove. |
|
inline |
Set the name of the scene.
Updates the scene's name property.
| name | New name for the scene. |
|
inline |
Set the skybox for the scene.
| skybox | The skybox to set (or nullptr to remove). |
| void lmgl::scene::Scene::update | ( | ) |
Update the scene.
This method updates the scene, typically by updating the root node and propagating changes through the scene graph.