X-Git-Url: https://git.rohieb.name/MicroTrace.git/blobdiff_plain/9e556ed5343384fcf9258fe0f37af3c1fb9b9b3d..0db0dec898ba811c966267d4cb12dad33a1e3545:/Ray.hxx diff --git a/Ray.hxx b/Ray.hxx index a432830..0ec9f76 100644 --- a/Ray.hxx +++ b/Ray.hxx @@ -3,11 +3,13 @@ #include "Vec3f.hxx" +class Primitive; + class Ray { public: Ray(); - Ray(const Vec3f& org, const Vec3f& dir); + Ray(const Vec3f& org, const Vec3f& dir, unsigned int recursion_level = 0); ~Ray(); Ray(const Ray& r); Ray& operator=(const Ray& r); @@ -15,10 +17,26 @@ public: const Vec3f& origin() const; const Vec3f& direction() const; float t() const; + Primitive* hit(); + unsigned int recursionDepth() const; + float indexOfRefraction() const; + + void setOrigin(const Vec3f& o); + void setDir(const Vec3f& d); + void setT(float t); + void setHit(Primitive* p); + void setRecursionDepth(unsigned int i); + void setIndexOfRefraction(float ior); + 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 + float m_density; //!< index of refraction + + Primitive* m_hit; }; inline std::ostream &operator<<(std::ostream &o,const Ray &ray)