00001 /* 00002 ** TP 4ETI CPE Lyon 00003 ** Copyright (C) 2011 Damien Rohmer 00004 ** 00005 ** This program is free software: you can redistribute it and/or modify 00006 ** it under the terms of the GNU General Public License as published by 00007 ** the Free Software Foundation, either version 3 of the License, or 00008 ** (at your option) any later version. 00009 ** 00010 ** This program is distributed in the hope that it will be useful, 00011 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 ** GNU General Public License for more details. 00014 ** 00015 ** You should have received a copy of the GNU General Public License 00016 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 00020 #ifndef _OBJECT3D_HPP_ 00021 #define _OBJECT3D_HPP_ 00022 00023 #include <v3.hpp> 00024 00025 #include <vector> 00026 00027 00028 namespace cpe 00029 { 00030 class ray; 00031 struct intersection_data; 00032 00033 00034 00036 class object3d 00037 { 00038 public: 00039 00040 // ********************************************* // 00041 // ********************************************* // 00042 // CONSTRUCTOR 00043 // ********************************************* // 00044 // ********************************************* // 00045 00047 object3d(){} 00049 virtual ~object3d(){} 00050 00051 00052 // ********************************************* // 00053 // ********************************************* // 00054 // INTERSECTION 00055 // ********************************************* // 00056 // ********************************************* // 00057 00059 virtual std::vector<intersection_data> intersect(const ray& seg) const = 0; 00060 00061 private: 00062 }; 00063 00064 00066 struct intersection_data 00067 { 00069 intersection_data(const v3& _x,const v3& _n,const double& _t):x(_x),n(_n),t(_t){} 00070 00072 v3 x; 00074 v3 n; 00076 double t; 00077 }; 00078 00079 00080 00081 00082 00083 } 00084 00085 #endif
1.6.3