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

Visibles objects in a scene. More...

#include <object.hpp>

Inheritance diagram for rt::Object:
rt::Entity

Public Member Functions

 Object (const vector &pos, Entity *parent=0)
 Construct an object from its position vector and its parent.
 
 Object (double x, double y, double z, Entity *parent=0)
 Construct an object from its position coordinates and its parent.
 
rt::hit hit (const euclidian &) const
 Perform a hit with an euclidian. More...
 
void addGeometry (Geometry *geometry, Material *material=Material::defaultMaterial())
 Add a geometric element to the object. More...
 
void setMaterial (Geometry *, Material *)
 Set the material of a geometric element.
 
Materialmaterial (Geometry *) const
 Get the material of a geometric element.
 
- Public Member Functions inherited from rt::Entity
 Entity (Entity *parent=0)
 Default entity constructor. More...
 
 Entity (const vector &pos, Entity *parent=0)
 Make a new entity from its position and parent. More...
 
 Entity (double x, double y, double z, Entity *parent=0)
 Make a new entity from its position coordinates and parent. More...
 
virtual ~Entity ()=0
 Destructor. More...
 
void soil ()
 Make an entity dirty. More...
 
bool isDirty () const
 
virtual void update ()
 Update the global matrix of the entity and its children.
 
const matrixglobalMatrix () const
 The global matrix of the entity. More...
 
const matrixinvertedGlobalMatrix () const
 The invert of the global matrix of the entity. More...
 
vector globalPosition () const
 Global position of the entity. More...
 
const vectorposition () const
 Entity location.
 
const vectorrotation () const
 Entity rotation.
 
void setPosition (const vector &pos)
 Set the entity position. More...
 
void setRotation (const vector &rot)
 Set the entity rotation. More...
 
Entityparent () const
 The parent entity. More...
 
void setParent (Entity *)
 Set the parent entity. More...
 
Scenescene () const
 The scene of the entity.
 
void setScene (Scene *)
 Set the scene of the entity. More...
 
const std::unordered_set< Entity * > & children () const
 Entity children.
 
void addChild (Entity *)
 Add a child. More...
 
void removeChild (Entity *)
 Remove a child. More...
 
template<class T >
void queryAll (std::list< const T *> &list) const
 Get the list of a specific type of entity. More...
 

Detailed Description

Visibles objects in a scene.

An object is an entitie with geometric elements and materials. An object can be hit by an euclidian.

Member Function Documentation

◆ addGeometry()

void rt::Object::addGeometry ( Geometry geometry,
Material material = Material::defaultMaterial() 
)

Add a geometric element to the object.

Parameters
geometryThe geometric element.
materialThe material used to render this element. If material is null, the default material will be used.

◆ hit()

rt::hit rt::Object::hit ( const euclidian e) const

Perform a hit with an euclidian.

If the hit between the euclidian and the object never occurs, the hit time will be set to infinity.


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