X-Git-Url: https://git.rohieb.name/MicroTrace.git/blobdiff_plain/fb7298729078489a4b3d27f5be46d664ccdad57a..0e3446ceb6fd6db0cb292671f37b46daaa2aed5b:/Ray.hxx diff --git a/Ray.hxx b/Ray.hxx index a432830..f37425c 100644 --- a/Ray.hxx +++ b/Ray.hxx @@ -3,6 +3,8 @@ #include "Vec3f.hxx" +class Primitive; + class Ray { public: @@ -15,10 +17,22 @@ public: const Vec3f& origin() const; const Vec3f& direction() const; float t() const; + Primitive* hit(); + unsigned int recursionDepth() const; + + void setOrigin(const Vec3f& o); + void setDir(const Vec3f& d); + void setT(float t); + void setRecursionDepth(unsigned int i); + private: Vec3f m_org; //!< ray origin Vec3f m_dir; //!< ray direction float m_t; //!< current/maximum hit distance + + unsigned int m_level; //!< level of recursion + + Primitive* m_hit; }; inline std::ostream &operator<<(std::ostream &o,const Ray &ray)