00001 00002 #ifndef __geometry_hpp__ 00003 #define __geometry_hpp__ 00004 00005 #include <crbn/basic/basic.h> 00006 #include <crbn/basic/vec3.hpp> 00007 #include <crbn/basic/bbox.hpp> 00008 #include <crbn/basic/bsphere.hpp> 00009 #include <crbn/basic/ray.hpp> 00010 #include <crbn/basic/intersection.hpp> 00011 #include <crbn/basic/packed.h> 00012 00028 class Geometry 00029 { 00030 public: 00031 Geometry() {} 00032 virtual ~Geometry() {} 00033 00034 inline uint32 memory() { return sizeof( Geometry ); } 00035 inline bool is_ok() { return true; } 00036 00042 virtual void bbox_get( bbox& bb ) = 0; 00048 virtual void bsphere_get( bsphere& bs ) = 0; 00049 00059 virtual bool intersect( ray& r, float& distance, packed& data ) = 0; 00060 00068 virtual void compute_intersection( ray& r, intersection& inter, packed& data ) = 0; 00069 00077 virtual void surface_sample( const uint32 number, vec3* vtab, vec3* ntab ) = 0; 00078 }; 00079 00080 #endif // __geometry_hpp__