00001 00002 #ifndef Y_STD_PRIMITIVE_H 00003 #define Y_STD_PRIMITIVE_H 00004 00005 #include <core_api/primitive.h> 00006 00007 __BEGIN_YAFRAY 00008 00009 class renderEnvironment_t; 00010 class paraMap_t; 00011 class object3d_t; 00012 00013 class YAFRAYCORE_EXPORT sphere_t: public primitive_t 00014 { 00015 public: 00016 sphere_t(point3d_t centr, PFLOAT rad, const material_t *m): center(centr), radius(rad), material(m) {} 00017 virtual bound_t getBound() const; 00018 virtual bool intersectsBound(exBound_t &b) const { return true; }; 00019 //virtual bool clippingSupport() const { return false; } 00020 //virtual bool clipToBound(double bound[2][3], int axis, bound_t &clipped, void *d_old, void *d_new) const {return false;} 00021 virtual bool intersect(const ray_t &ray, PFLOAT *t, void *userdata) const; 00022 virtual void getSurface(surfacePoint_t &sp, const point3d_t &hit, void *userdata) const; 00023 virtual const material_t* getMaterial() const { return material; } 00024 protected: 00025 point3d_t center; 00026 PFLOAT radius; 00027 const material_t *material; 00028 }; 00029 00030 object3d_t* sphere_factory(paraMap_t ¶ms, renderEnvironment_t &env); 00031 00032 __END_YAFRAY 00033 00034 #endif //Y_STD_PRIMITIVE_H
1.6.1