2016-12-25 21:47:28 -04:00
|
|
|
#pragma once
|
|
|
|
|
#ifndef FIGURE_HPP
|
|
|
|
|
#define FIGURE_HPP
|
|
|
|
|
|
|
|
|
|
#include <glm/vec3.hpp>
|
|
|
|
|
|
|
|
|
|
#include "ray.hpp"
|
2016-12-28 02:17:48 -04:00
|
|
|
#include "material.hpp"
|
2016-12-25 21:47:28 -04:00
|
|
|
|
2016-12-26 15:41:29 -04:00
|
|
|
using glm::vec3;
|
|
|
|
|
|
2016-12-25 21:47:28 -04:00
|
|
|
class Figure {
|
|
|
|
|
public:
|
2017-01-12 14:34:44 -04:00
|
|
|
Material * m_mat;
|
2016-12-25 21:47:28 -04:00
|
|
|
|
2017-01-18 21:46:24 -04:00
|
|
|
Figure(Material * mat = NULL) {
|
|
|
|
|
m_mat = mat == NULL ? new Material() : mat;
|
2017-01-12 14:34:44 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual ~Figure() {
|
|
|
|
|
delete m_mat;
|
|
|
|
|
}
|
2016-12-25 21:47:28 -04:00
|
|
|
|
2016-12-26 19:14:21 -04:00
|
|
|
virtual bool intersect(Ray & r, float & t) const = 0;
|
|
|
|
|
virtual vec3 normal_at_int(Ray & r, float & t) const = 0;
|
2016-12-25 21:47:28 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|