#pragma once #ifndef FIGURE_HPP #define FIGURE_HPP #include #include "ray.hpp" #include "material.hpp" using glm::vec3; class Figure { public: Material * m_mat; Figure(Material * mat = NULL) { m_mat = mat == NULL ? new Material() : mat; } virtual ~Figure() { delete m_mat; } virtual bool intersect(Ray & r, float & t) const = 0; virtual vec3 normal_at_int(Ray & r, float & t) const = 0; }; #endif