Phongo Clap RT  1.0
Simple Raytracing Renderer
Plane.h
Go to the documentation of this file.
1 #ifndef _PLANE_H_
2 #define _PLANE_H_
3 
7 
8 #include "Shape.h"
9 #include "Ray.h"
10 #include <ngl/Vec3.h>
11 #include <ngl/Colour.h>
12 
13 namespace geo
14 {
15 //----------------------------------------------------------------------------------------------------------------------
21 //----------------------------------------------------------------------------------------------------------------------
22 class Plane : public Shape
23 {
24 public:
25  //--------------------------------------------------------------------------------------------------------------------
27  // -------------------------------------------------------------------------------------------------------------------
28  Plane();
29  //--------------------------------------------------------------------------------------------------------------------
31  // -------------------------------------------------------------------------------------------------------------------
32  ~Plane();
33  //--------------------------------------------------------------------------------------------------------------------
38  // -------------------------------------------------------------------------------------------------------------------
39  Plane(float _distance, ngl::Vec3 _n, ngl::Colour _c);
40  //--------------------------------------------------------------------------------------------------------------------
45  // -------------------------------------------------------------------------------------------------------------------
46  Plane(float _distance, ngl::Vec3 _n, ngl::Colour _c1, ngl::Colour _c2);
47  //--------------------------------------------------------------------------------------------------------------------
52  // -------------------------------------------------------------------------------------------------------------------
53  virtual float getIntersection(geo::Ray &_ray);
54  //--------------------------------------------------------------------------------------------------------------------
57  // -------------------------------------------------------------------------------------------------------------------
58  virtual ngl::Vec3 getNormalAt(ngl::Vec3 _p);
59  //--------------------------------------------------------------------------------------------------------------------
62  // -------------------------------------------------------------------------------------------------------------------
63  virtual ngl::Colour getColour();
64  //--------------------------------------------------------------------------------------------------------------------
69  // -------------------------------------------------------------------------------------------------------------------
70  virtual ngl::Colour getColour(ngl::Vec3 &_isect);
71 
72 private:
73  // -------------------------------------------------------------------------------------------------------------------
75  // -------------------------------------------------------------------------------------------------------------------
76  float m_distance;
77  // -------------------------------------------------------------------------------------------------------------------
79  // -------------------------------------------------------------------------------------------------------------------
80  ngl::Vec3 m_n;
81 };
82 }
83 #endif // Plane.h
Plane()
Default constructor for the plane. If no arguments passed it will be initialised with distance(5) n(1...
Definition: Plane.cpp:11
Definition: Ray.h:17
Inherits from shape. Implements functionability for plane shape and its materials. and the ray-plane intersections algorithms.
Definition: Plane.h:22
float m_distance
Distance from the origin the plane is located at.
Definition: Plane.h:76
virtual ngl::Colour getColour()
Returns the colour for plain objects, in other words for non-checkerboard planes. ...
Definition: Plane.cpp:82
Semi abstract class with virtual methods that holds all the calls for getting intersections, getting normals, also for specifying the properties of the material that will be hold by the Material member of this class.
Definition: Shape.h:21
virtual float getIntersection(geo::Ray &_ray)
Virtual method that implements the ray-plane intersection.
Definition: Plane.cpp:59
virtual ngl::Vec3 getNormalAt(ngl::Vec3 _p)
Simple getter that returns the normal of the plane.
Definition: Plane.cpp:77
This class handles the implementation of ray: an object with an origin and a direction.
Definition: Plane.cpp:9
ngl::Vec3 m_n
Normal of the plane.
Definition: Plane.h:80
~Plane()
Default destructor.