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

Geometric plan. More...

#include <plan.hpp>

Inheritance diagram for rt::Plan:
rt::Geometry rt::Entity

Public Member Functions

 Plan (const vector &pos, const vector &normal)
 Make a new plan. More...
 
virtual void update ()
 Update plan coordinates.
 
const vectornormal () const
 The normal of the plan. More...
 
const vectortangent () const
 A tangent of the plan. More...
 
virtual vector uv (const element &) const
 UV-map a surface element on the plan. More...
 
virtual std::vector< rt::hithits (const euclidian &e) const
 Compute hits between the plan and an euclidian. More...
 
- Public Member Functions inherited from rt::Geometry
 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.
 
- 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
 
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

Geometric plan.

Constructor & Destructor Documentation

◆ Plan()

rt::Plan::Plan ( const vector pos,
const vector normal 
)

Make a new plan.

Parameters
posA point on the plan
normalThe normal of the plan

Member Function Documentation

◆ hits()

std::vector< rt::hit > rt::Plan::hits ( const euclidian e) const
virtual

Compute hits between the plan and an euclidian.

Parameters
eAn euclidian in the global space referential.
Returns
A list of hit. If no hit occurs, the list is empty.

Implements rt::Geometry.

◆ normal()

const vector & rt::Plan::normal ( ) const

The normal of the plan.

Returns
A normal vector in the plan referential.

◆ tangent()

const vector & rt::Plan::tangent ( ) const

A tangent of the plan.

Returns
A tangent vector in the plan referential.

◆ uv()

vector rt::Plan::uv ( const element e) const
virtual

UV-map a surface element on the plan.

Returns
The surface element coordinate on a texture for the UV-mapping.

Implements rt::Geometry.


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