Cone.h
Go to the documentation of this file.00001 /**<!--------------------------------------------------------------------> 00002 @class Cone 00003 @author Travis Fischer (fisch0920@gmail.com) 00004 @author Matthew Jacobs (jacobs.mh@gmail.com) 00005 @date Fall 2008 00006 00007 @brief 00008 Representation of a vertical 3D cone enclosed in the unit box 00009 (-.5,-.5,-.5) to (.5,.5,.5) -- the tip is at (0,.5,0) 00010 <!-------------------------------------------------------------------->**/ 00011 00012 #ifndef CONE_H_ 00013 #define CONE_H_ 00014 00015 #include <shapes/Implicit.h> 00016 00017 class Cone : public Implicit { 00018 public: 00019 inline Cone() 00020 : m_quadric(NULL) 00021 { } 00022 00023 virtual ~Cone() { 00024 if (m_quadric) { 00025 gluDeleteQuadric(m_quadric); 00026 m_quadric = NULL; 00027 } 00028 } 00029 00030 00031 ///@name Intersection routines 00032 //@{----------------------------------------------------------------- 00033 00034 virtual real_t getIntersection(const Ray &ray, SurfacePoint &pt); 00035 00036 virtual bool intersects(const Ray &ray, real_t tMax = INFINITY); 00037 00038 00039 //@}----------------------------------------------------------------- 00040 ///@name Core functionality 00041 //@{----------------------------------------------------------------- 00042 00043 virtual void preview(); 00044 00045 00046 //@}----------------------------------------------------------------- 00047 00048 protected: 00049 virtual void _getUV(SurfacePoint &pt) const; 00050 virtual void _getGeometricNormal(SurfacePoint &pt) const; 00051 00052 protected: 00053 GLUquadric *m_quadric; 00054 }; 00055 00056 #endif // CONE_H_ 00057
Generated on 28 Feb 2009 for Milton by
1.5.6