12 Ray(const Vec3f& org, const Vec3f& dir, unsigned int recursion_level = 0);
15 Ray& operator=(const Ray& r);
17 const Vec3f& origin() const;
18 const Vec3f& direction() const;
21 unsigned int recursionDepth() const;
22 float indexOfRefraction() const;
24 void setOrigin(const Vec3f& o);
25 void setDir(const Vec3f& d);
27 void setHit(Primitive* p);
28 void setRecursionDepth(unsigned int i);
29 void setIndexOfRefraction(float ior);
32 Vec3f m_org; //!< ray origin
33 Vec3f m_dir; //!< ray direction
34 float m_t; //!< current/maximum hit distance
36 unsigned int m_level; //!< level of recursion
37 float m_density; //!< index of refraction
42 inline std::ostream &operator<<(std::ostream &o,const Ray &ray)
43 { o << "Ray [" << ray.origin() << "+t*" << ray.direction() << "]"; return o; }