00001 00002 00003 00004 // 00005 00006 #ifndef CONCENTRICBUMPMAP_H 00007 #define CONCENTRICBUMPMAP_H 00008 00009 #include "bumpmap.h" 00010 #include "pluginfactory.h" 00011 00012 class ConcentricBumpMap; 00013 00015 BumpMap * new_concentricbumpmap(xmlNode * node); 00017 void delete_concentricbumpmap(ConcentricBumpMap * bumpmap); 00018 00019 class ConcentricBumpMap : public BumpMap 00020 { 00021 protected: 00023 class StaticInit { 00024 public: 00026 StaticInit() { 00027 BumpMapFactory::get_instance()->registerPlugin("concentric", sigc::ptr_fun(new_concentricbumpmap)); 00028 } 00029 00030 }; 00032 static StaticInit m_init; 00033 00034 public: 00036 virtual Ray perturb_normal(const Ray& normal, const Point3D& intersection_point) ; 00037 }; 00038 00039 BumpMap * new_concentricbumpmap(xmlNode * node) { 00040 00041 // TODO attributes? scaling at least? 00042 00043 BumpMap * rv = new ConcentricBumpMap(); 00044 return rv; 00045 } 00046 00047 void delete_concentricbumpmap(ConcentricBumpMap * ptr) { 00048 delete ptr, ptr = NULL; 00049 } 00050 00051 #endif 00052