ray_tracer.hpp
Go to the documentation of this file.
00001 /*
00002 **    TP 4ETI CPE Lyon
00003 **    Copyright (C) 2012 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 RAY_TRACER_HPP
00021 #define RAY_TRACER_HPP
00022 
00023 #include <vector>
00024 
00025 
00026 namespace cpe
00027 {
00028 
00029     struct intersection_object;
00030     struct render_parameters;
00031     class image;
00032     class color;
00033     class ray;
00034     class scene3d;
00035     class v3;
00036 
00037 
00039     class ray_tracer
00040     {
00041     public:
00042 
00043         // ********************************************* //
00044         // ********************************************* //
00045         //  RAY-TRACING
00046         // ********************************************* //
00047         // ********************************************* //
00048 
00050         static void trace(const scene3d& scene,const render_parameters& render_param,image* pic);
00051 
00052 
00053     //private:
00054 
00055         // ********************************************* //
00056         // ********************************************* //
00057         //  HELPER-METHOD
00058         // ********************************************* //
00059         // ********************************************* //
00060 
00064         static color throw_ray(const scene3d& scene,const ray& ray_current,const render_parameters& render_param);
00065 
00067         static intersection_object find_inter(const ray& ray_current,const scene3d& scene);
00068 
00072         static std::vector<double> ray_to_light(const v3& current_position,const scene3d& scene);
00074         static color compute_color(const std::vector<double>& t_light,const intersection_object& inter,const scene3d& scene,const render_parameters& render_param);
00075 
00077         static color find_intersection_color(const intersection_object& inter,const scene3d& scene,const render_parameters& render_param);
00078 
00079 
00080     };
00081 
00082 }
00083 
00084 #endif