#include class obj_t { public: obj_t(); obj_t(int, int); double (*hits)(void); void (*uninorm)(void); void dump(FILE *); /* Optional plugins for retrieval of reflectivity */ /* useful for the ever-popular tiled floor */ void (*getamb)(void); void (*getdiff)(void); void (*getspec)(void); private: int objid; int objtype; double ambient[3]; /* Reflectivity for materials */ double diffuse[3]; double specular[3]; double emissivity[3]; /* For lights */ void *priv; /* Private type-dependent data */ double hitloc[3]; /* Last hit point */ double normal[3]; /* Normal at hit point */ }; obj_t::obj_t( int otype, int oid) { objid = oid; objtype = otype; } void obj_t::dump(FILE *out) { fprintf(out, "Type = %d and ID = %d \n", objtype, objid); } #if 1 class sphere_t: public obj_t { public: sphere_t(); sphere_t(int, int); double center[3]; double radius; } sphere_t; #endif sphere_t::sphere_t() { } sphere_t::sphere_t(int a, int b) { } main() {}