diff --git a/main/Scene-load.cc b/main/Scene-load.cc index 03f864e..3762e07 100644 --- a/main/Scene-load.cc +++ b/main/Scene-load.cc @@ -1,4 +1,5 @@ +#include #include #include "Scene.h" #include "Light.h" diff --git a/shapes/Intersect.cc b/shapes/Intersect.cc new file mode 100644 index 0000000..b1e9393 --- /dev/null +++ b/shapes/Intersect.cc @@ -0,0 +1,24 @@ + +#include "Intersect.h" + +Intersect::Intersect(refptr shape1, refptr shape2) +{ + m_shape1 = shape1; + m_shape2 = shape2; +} + +Shape::IntersectList Intersect::intersect(const Ray & ray) +{ + IntersectList res; + IntersectList res1 = m_shape1->intersect(ray); + IntersectList res2 = m_shape2->intersect(ray); + + + return res; +} + +Vector Intersect::getNormalAt(const Vector & pt) +{ + /* TODO: finish */ + return Vector(0, 0, 0); +} diff --git a/shapes/Intersect.h b/shapes/Intersect.h new file mode 100644 index 0000000..d20581e --- /dev/null +++ b/shapes/Intersect.h @@ -0,0 +1,20 @@ + +#ifndef INTERSECT_H +#define INTERSECT_H INTERSECT_H + +#include "Shape.h" + +class Intersect : public Shape +{ + public: + Intersect(refptr shape1, refptr shape2); + IntersectList intersect(const Ray & ray); + Vector getNormalAt(const Vector & pt); + + protected: + refptr m_shape1; + refptr m_shape2; +}; + +#endif +