added make clean, make all to .cproject
[MicroTrace.git] / Ray.hxx
1 #ifndef RAY_HXX
2 #define RAY_HXX
3
4 #include "Vec3f.hxx"
5
6 class Primitive;
7
8 class Ray
9 {
10 public:
11 Ray();
12 Ray(const Vec3f& org, const Vec3f& dir);
13 ~Ray();
14 Ray(const Ray& r);
15 Ray& operator=(const Ray& r);
16
17 const Vec3f& origin() const;
18 const Vec3f& direction() const;
19 float t() const;
20 Primitive* hit();
21 unsigned int recursionDepth() const;
22
23 void setOrigin(const Vec3f& o);
24 void setDir(const Vec3f& d);
25 void setT(float t);
26 void setRecursionDepth(unsigned int i);
27
28 private:
29 Vec3f m_org; //!< ray origin
30 Vec3f m_dir; //!< ray direction
31 float m_t; //!< current/maximum hit distance
32
33 unsigned int m_level; //!< level of recursion
34
35 Primitive* m_hit;
36 };
37
38 inline std::ostream &operator<<(std::ostream &o,const Ray &ray)
39 { o << "Ray [" << ray.origin() << "+t*" << ray.direction() << "]"; return o; }
40
41 #endif
This page took 0.0462 seconds and 5 git commands to generate.