added shapes/Intersect, need to rework IntersectList

git-svn-id: svn://anubis/fart/trunk@142 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop 2009-02-23 05:51:51 +00:00
parent 29b60f346e
commit e23d5cdca4
3 changed files with 45 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#include <typeinfo>
#include <iostream> #include <iostream>
#include "Scene.h" #include "Scene.h"
#include "Light.h" #include "Light.h"

24
shapes/Intersect.cc Normal file
View File

@ -0,0 +1,24 @@
#include "Intersect.h"
Intersect::Intersect(refptr<Shape> shape1, refptr<Shape> 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);
}

20
shapes/Intersect.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef INTERSECT_H
#define INTERSECT_H INTERSECT_H
#include "Shape.h"
class Intersect : public Shape
{
public:
Intersect(refptr<Shape> shape1, refptr<Shape> shape2);
IntersectList intersect(const Ray & ray);
Vector getNormalAt(const Vector & pt);
protected:
refptr<Shape> m_shape1;
refptr<Shape> m_shape2;
};
#endif