28 if(_n.length() > 1.01 || _n.length() < 0.99)
39 Plane::Plane(
float _distance, ngl::Vec3 _n, ngl::Colour _c1, ngl::Colour _c2)
48 if(_n.length() > 1.01 || _n.length() < 0.99)
63 float a = ray_dir.dot(
m_n);
Material * m_material
Material attached to the Shape object.
ngl::Vec3 getOrigin()
Getter method for the origin.
This will be used to return the colour when queried from the Shape derived classes.
Implements the interface for creating a plane shape and the methods for finding its intersections...
Plane()
Default constructor for the plane. If no arguments passed it will be initialised with distance(5) n(1...
float m_distance
Distance from the origin the plane is located at.
ngl::Colour m_colour
Colour of the shape.
virtual ngl::Colour getColour()
Returns the colour for plain objects, in other words for non-checkerboard planes. ...
virtual float getIntersection(geo::Ray &_ray)
Virtual method that implements the ray-plane intersection.
virtual ngl::Vec3 getNormalAt(ngl::Vec3 _p)
Simple getter that returns the normal of the plane.
char m_type
Type of geometric object it is.
This class handles the implementation of ray: an object with an origin and a direction.
ngl::Vec3 m_n
Normal of the plane.
ngl::Colour objColour()
Returns the object colour.
ngl::Vec3 getDirection()
Getter method for the direction.
bool m_isChecker
Specifies whether it is checker or not.