|
Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
|
Geometric entity. More...
#include <geometry.hpp>
Public Member Functions | |
| Geometry (Entity *parent=0) | |
| Main constructor. More... | |
| Geometry (const vector &pos, Entity *parent=0) | |
| Make a new geometry from its position and parent. More... | |
| Geometry (double x, double y, double z, Entity *parent=0) | |
| Make a new geometry from its position and parent. More... | |
| virtual | ~Geometry ()=0 |
| Destructor. | |
| virtual vector | uv (const element &) const =0 |
| UV-map a surface element on a texture. More... | |
| virtual std::vector< rt::hit > | hits (const euclidian &e) const =0 |
| Compute hits between a Geometry and an euclidian. More... | |
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 matrix & | globalMatrix () const |
| The global matrix of the entity. More... | |
| const matrix & | invertedGlobalMatrix () const |
| The invert of the global matrix of the entity. More... | |
| vector | globalPosition () const |
| Global position of the entity. More... | |
| const vector & | position () const |
| Entity location. | |
| const vector & | rotation () const |
| Entity rotation. | |
| void | setPosition (const vector &pos) |
| Set the entity position. More... | |
| void | setRotation (const vector &rot) |
| Set the entity rotation. More... | |
| Entity * | parent () const |
| The parent entity. More... | |
| void | setParent (Entity *) |
| Set the parent entity. More... | |
| Scene * | scene () 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... | |
Geometric entity.
This class is used to describe geometric elements. Geometry is used by Object to draw complex objects with differents shapes and materials.
The geometry is described by its location in the local space of its parent entity, but this entity is mainly an Object instance.
The main purpose of a Geometry is to compute hits between itself and some euclidian in the global space referential.
| rt::Geometry::Geometry | ( | Entity * | parent = 0 | ) |
Main constructor.
| parent | The parent entity of the geometry. To be able to draw the geometry during the render, this parent must be an Object. |
Make a new geometry from its position and parent.
| pos | The location of the geometry in its parent local space. |
| parent | The parent entity of the geometry. To be able to draw the geometry during the render, this parent must be an Object. |
| rt::Geometry::Geometry | ( | double | x, |
| double | y, | ||
| double | z, | ||
| Entity * | parent = 0 |
||
| ) |
Make a new geometry from its position and parent.
| x | Position of the geometry along x-axis. |
| y | Position of the geometry along y-axis. |
| z | Position of the geometry along z-axis. |
| parent | The parent entity of the geometry. To be able to draw the geometry during the render, this parent must be an Object. |
Compute hits between a Geometry and an euclidian.
| e | An euclidian in the global space referential. |
Implemented in rt::Sphere, rt::Plan, and rt::Mesh.
UV-map a surface element on a texture.
Implemented in rt::Sphere, rt::Plan, and rt::Mesh.
1.8.15