plane.hpp
Go to the documentation of this file.
1 /*
2 ** TP CPE Lyon
3 ** Copyright (C) 2013 Damien Rohmer
4 **
5 ** This program is free software: you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation, either version 3 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef PLANE_HPP
20 #define PLANE_HPP
21 
22 
23 #include <object3d.hpp>
24 #include <vec3.hpp>
25 
26 namespace cpe
27 {
28 
30  class plane : public object3d
31  {
32  public:
33 
34  // ********************************************* //
35  // ********************************************* //
36  // CONSTRUCTOR
37  // ********************************************* //
38  // ********************************************* //
39 
41  plane(const vec3& x0=vec3(),const vec3& normal=vec3(0,0,1));
42 
44  virtual ~plane();
45 
46  // ********************************************* //
47  // ********************************************* //
48  // Accessor
49  // ********************************************* //
50  // ********************************************* //
51 
53  const vec3& normal() const;
54 
56  const vec3& position() const;
57 
58 
59  // ********************************************* //
60  // ********************************************* //
61  // INTERSECTION
62  // ********************************************* //
63  // ********************************************* //
64 
66  virtual bool intersect(const ray& ray_data,intersection& intersection_data) const;
67 
68  private:
69 
70  // ********************************************* //
71  // ********************************************* //
72  // INTERNAL DATA
73  // ********************************************* //
74  // ********************************************* //
75 
76 
78  const vec3 x0;
80  const vec3 n;
81  };
82 }
83 
84 #endif