00001 #ifndef PRIMITIVE_H_ 00002 #define PRIMITIVE_H_ 00003 00004 #include "../Traceable.h" 00005 #include "../math/Point3D.h" 00006 #include "../math/Point2D.h" 00007 #include "../objects/SolidObject.h" 00008 00009 namespace rcrt 00010 { 00011 00015 class Primitive : public Traceable 00016 { 00017 protected: 00021 SolidObject* parent; 00022 00023 public: 00024 Primitive(SolidObject* parent=0); 00025 virtual ~Primitive(); 00026 00032 virtual Vec3D getSNormal(float a, float b) const =0; 00033 00039 virtual Vec3D getGNormal(float a, float b) const =0; 00040 00046 Vec3D getSNormalWorld(float a, float b) const; 00047 00053 Vec3D getGNormalWorld(float a, float b) const; 00054 00060 virtual Vec3D getTangent(float a, float b) const; 00061 00067 virtual Point2D getUV(float a, float b) const =0; 00068 00073 Vec3D normalToWorld(const Vec3D& no) const; 00074 00078 SolidObject* getParent() const; 00079 00083 virtual Material* const getMaterial() const; 00084 }; 00085 00086 } 00087 00088 #endif /*PRIMITIVE_H_*/ 00089