Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
light.hpp
1 
15 #pragma once
16 
17 #include "entity.hpp"
18 #include "physics/photon.hpp"
19 
20 namespace rt{
21 
28 class Light : public Entity{
29 public:
30  enum Type{
31  Constant,
32  Sinus,
33  Quadratic
34  };
40  Light(const vector & pos, Type type = Quadratic);
41 
47  virtual double distance(const vector & from) const = 0;
48 
52  virtual const rt::photon & photon(const vector & from) const = 0;
53 
54  double energy(double distance) const;
55 
56 private:
57  Type _type;
58 };
59 
60 }
Basic space entity.
Definition: entity.hpp:50
Definition: bitmap.cpp:4
Light(const vector &pos, Type type=Quadratic)
Let there be light !
Definition: light.cpp:5
Light source class representation.
Definition: light.hpp:28
virtual double distance(const vector &from) const =0
Global distance between the light and a position.
3D vector
Definition: vector.hpp:28
virtual const rt::photon & photon(const vector &from) const =0
Get a photon from a global space location.
Light photon class.
Definition: photon.hpp:28