|
Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
|
Render camera. More...
#include <camera.hpp>
Public Types | |
| enum | RenderQuality { FastRender = 0, RenderLights = 1, RenderAmbientOcclusion = 2, FullRender = 3 } |
| Render quality flags. More... | |
Public Member Functions | |
| Camera (const vector &position, const vector &target, const vector &up, double near=3.0) | |
| Main constructor. More... | |
| const vector & | target () const |
| The camera focus target. | |
| void | setTarget (const vector &target) |
| set the camera focus target | |
| virtual void | render (image &img, int flags=FullRender) const |
| Process a render. 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... | |
Protected Member Functions | |
| ray | project (int ix, int iy, int width, int height) const |
| Build a new ray projected from a render target position. More... | |
Render camera.
The camera is used to compute a render from a given point of view and direction.
| rt::Camera::Camera | ( | const vector & | position, |
| const vector & | target, | ||
| const vector & | up, | ||
| double | near = 3.0 |
||
| ) |
Main constructor.
| position | The position of the camera. |
| target | A target position. The camera will look to this point. |
| up | An up vector to set the camera rotation. The bottom-top line of the render will follow this vector. |
| render_target | An image to write the render to. |
|
protected |
Build a new ray projected from a render target position.
| ix | x-axis position of the pixel (0 is left side). |
| iy | y-axis position of the pixel (0 is top side). |
| width | Size width of the render image. |
| height | Size height of the render image. |
|
virtual |
Process a render.
| img | The render target. |
| flags | Render quality flags (see Camera::RenderQuality). |
1.8.15