Triangle.h

Go to the documentation of this file.
00001 
00005 #ifndef Triangle_h
00006 #define Triangle_h
00007 
00008 #include "Vector.h"
00009 #include "Primitive.h"
00010 class HitRecord;
00011 class Point;
00012 class RenderContext;
00013 
00017 class Triangle : public Primitive {
00018  public:
00019     Triangle(Material* material, const Point &A, const Point &B, const Point &C);
00020   virtual ~Triangle();
00021 
00022   virtual void getBounds(BoundingBox& bbox) const;
00023   virtual void intersect(HitRecord& hit, const RenderContext& context, const Ray& ray) const;
00024   virtual void normal(Vector& normal, const RenderContext& context,
00025                       const Point & hitpos, const Ray& ray, const HitRecord& hit) const;
00026 
00027  private:
00028   Triangle(const Triangle&);
00029   Triangle& operator=(const Triangle&);
00030 
00031   Point a, b, c;
00032   Vector ab;
00033   Vector ac;
00034   Vector n;
00035   double d;
00036   int i1, i2;
00037 };
00038 
00039 #endif
00040 

Generated on Tue Jan 29 21:34:54 2008 for specter by  doxygen 1.4.6