Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
hit.hpp
1 
15 #pragma once
16 
17 #include "element.hpp"
18 
19 namespace rt{
20 
39 class hit{
40 public:
46  hit();
50  hit(const hit &);
54  hit(double t, const element &);
55 
61  inline double date() const{
62  return _t;
63  }
64 
68  inline const element & surface() const{
69  return _e;
70  }
71 
75  inline void setMaterial(Material *m){
76  _e.setMaterial(m);
77  }
78 
82  bool operator<(const hit & h) const;
83 
87  bool operator>(const hit & h) const;
88 
89 private:
90  element _e;
91  double _t;
92 };
93 
94 }
Object material.
Definition: material.hpp:39
bool operator<(const hit &h) const
Compare the date of two hits.
Definition: hit.cpp:20
void setMaterial(Material *m)
Attach a material to the element.
Definition: element.hpp:148
void setMaterial(Material *m)
Set the material associated with the surface element.
Definition: hit.hpp:75
Definition: bitmap.cpp:4
const element & surface() const
Surface element attached to the hit.
Definition: hit.hpp:68
bool operator>(const hit &h) const
Compare the date of two hits.
Definition: hit.cpp:24
The result of a collistion between a Geometry and an euclidian.
Definition: hit.hpp:39
double date() const
Date of the hit.
Definition: hit.hpp:61
Geometric surface element unit.
Definition: element.hpp:43
hit()
Default constructor.
Definition: hit.cpp:6