|
Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
|
Complete scene. More...
#include <scene.hpp>
Public Member Functions | |
| Scene (const std::string &name, const color &ambient_color=color::WHITE) | |
| Make a new scene. More... | |
| const std::string & | name () const |
| The name of the scene. | |
| Entity * | append (Entity *e) |
| Add a new root entity to the scene. More... | |
| void | remove (Entity *e) |
| Disconnect an entity from the scene. | |
| const std::list< const Object * > & | objects () const |
| Scene objects. More... | |
| const std::list< const Light * > & | lights () const |
| Scene lights. More... | |
| const photon & | ambientLight () const |
| The ambient light of the scene. | |
| void | update () |
| Update object and light lists required for the render. More... | |
Complete scene.
A scene is a set of objects, lights, etc... organised in trees. Typicaly, the scene is only connected to the root elements.
You can add an entity to a scene by passing it to Scene::append(Entity*) method (in this case it will be a root element of the scene), or by setting it as child of an other entity already in the scene.
You can set the ambient light of the scene, it will be used as the minimum amout of light for the render.
| rt::Scene::Scene | ( | const std::string & | name, |
| const color & | ambient_color = color::WHITE |
||
| ) |
Make a new scene.
| The | scene name |
| The | scene ambient light color. |
Add a new root entity to the scene.
If the entity has a parent, it will be set to null.
| const std::list< const Light * > & rt::Scene::lights | ( | ) | const |
Scene lights.
Be sure to call Scene::update() before this method in order to refresh the light list.
| const std::list< const Object * > & rt::Scene::objects | ( | ) | const |
Scene objects.
Be sure to call Scene::update() before this method in order to refresh the object list.
| void rt::Scene::update | ( | ) |
Update object and light lists required for the render.
Note that this method is automaticaly called before each render.
1.8.15