00001
00002 #ifndef Y_RAY_H
00003 #define Y_RAY_H
00004
00005 #include <yafray_config.h>
00006
00007 #include "vector3d.h"
00008
00009 __BEGIN_YAFRAY
00010
00011 class ray_t
00012 {
00013 public:
00014 ray_t(): tmin(0), tmax(-1.0), time(0.0) {}
00015 ray_t(const point3d_t &f, const vector3d_t &d, PFLOAT start=0.0, PFLOAT end=-1.0, PFLOAT ftime=0.0):
00016 from(f), dir(d), tmin(start), tmax(end), time(ftime) { }
00017
00018 point3d_t from;
00019 vector3d_t dir;
00020 mutable PFLOAT tmin, tmax;
00021 PFLOAT time;
00022 };
00023
00024 class diffRay_t: public ray_t
00025 {
00026 public:
00027 diffRay_t(): ray_t(), hasDifferentials(false) {}
00028 diffRay_t(const ray_t &r): ray_t(r), hasDifferentials(false) {}
00029 diffRay_t(const point3d_t &f, const vector3d_t &d, PFLOAT start=0.0, PFLOAT end=-1.0, PFLOAT ftime=0.0):
00030 ray_t(f, d, start, end, ftime), hasDifferentials(false) {}
00031 bool hasDifferentials;
00032 point3d_t xfrom, yfrom;
00033 vector3d_t xdir, ydir;
00034 };
00035
00036 __END_YAFRAY
00037
00038 #endif //Y_RAY_H