Phongo Clap RT
1.0
Simple Raytracing Renderer
|
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. More...
#include <Shape.h>
Public Member Functions | |
Shape () | |
Default constructor. More... | |
~Shape () | |
Frees any memory grabbed from the heap. More... | |
virtual ngl::Colour | getColour ()=0 |
Returs colour of a Shape object. More... | |
virtual ngl::Colour | getColour (ngl::Vec3 &_isect)=0 |
Returns colour depending on intersection point. More... | |
virtual float | getIntersection (geo::Ray &_ray)=0 |
Passing a ray it will calculate the intersection in the derived class, this is purely abstract method. More... | |
virtual ngl::Vec3 | getNormalAt (ngl::Vec3 _p)=0 |
Returns the normal at a given point. More... | |
void | hasRefraction (float _ior, float _transparency, float _diffuse_intensity) |
Sets parameters related to refraction, this will be given to the Material class. More... | |
void | hasReflection (float _refl_intensity, float _diffuse_intensity) |
Sets reflection attributes. More... | |
Material * | getMaterial () |
Returns the material attached to a shape object. This is useful for querying or changing private interface, that's why it is not const. More... | |
char | getType () |
Derived classes will be Spheres or Planes, I will store the type of geometry in this attribute. More... | |
Protected Attributes | |
char | m_type |
Type of geometric object it is. More... | |
ngl::Colour | m_colour |
Colour of the shape. More... | |
Material * | m_material |
Material attached to the Shape object. More... | |
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.
|
inline |
Frees any memory grabbed from the heap.
Definition at line 31 of file Shape.h.
References m_material.
|
pure virtual |
Returs colour of a Shape object.
Implemented in geo::Sphere, and geo::Plane.
|
pure virtual |
Returns colour depending on intersection point.
Implemented in geo::Sphere, and geo::Plane.
|
pure virtual |
Passing a ray it will calculate the intersection in the derived class, this is purely abstract method.
R = O + t * d
. Implemented in geo::Sphere, and geo::Plane.
|
inline |
Returns the material attached to a shape object. This is useful for querying or changing private interface, that's why it is not const.
Definition at line 77 of file Shape.h.
References m_material.
|
pure virtual |
|
inline |
|
inline |
Sets reflection attributes.
[in] | _refl_intensity | How reflective the material is. |
[in] | _diffuse_intensity | How non-reflective the material is. |
Definition at line 68 of file Shape.h.
References m_material, and Material::setReflection().
|
inline |
Sets parameters related to refraction, this will be given to the Material class.
[in] | _ior | Index of refraction. |
[in] | _transparency | Amount of refraction of the object. |
[in] | _ | diffuse_intensity This is calculated automatically, but it is the complementary of transparency, I could say this is the 'opacity'. |
Definition at line 59 of file Shape.h.
References m_material, and Material::setRefraction().
|
protected |
|
protected |
|
protected |