Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
Public Member Functions | List of all members
rt::Scene Class Reference

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.
 
Entityappend (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 photonambientLight () const
 The ambient light of the scene.
 
void update ()
 Update object and light lists required for the render. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Scene()

rt::Scene::Scene ( const std::string &  name,
const color ambient_color = color::WHITE 
)

Make a new scene.

Parameters
Thescene name
Thescene ambient light color.

Member Function Documentation

◆ append()

Entity * rt::Scene::append ( Entity e)

Add a new root entity to the scene.

If the entity has a parent, it will be set to null.

◆ lights()

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.

Returns
The list of lights connected to the scene.

◆ objects()

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.

Returns
The list of objects connected to the scene.

◆ update()

void rt::Scene::update ( )

Update object and light lists required for the render.

Note that this method is automaticaly called before each render.


The documentation for this class was generated from the following files: