24 lines
477 B
C++
24 lines
477 B
C++
|
|
#ifndef SHAPE_H
|
|
#define SHAPE_H SHAPE_H
|
|
|
|
#include "util/Solver.h"
|
|
#include "util/Ray.h"
|
|
#include "util/Vector.h"
|
|
#include "util/Transform.h"
|
|
|
|
class Shape
|
|
{
|
|
public:
|
|
virtual Solver::Result intersect(const Ray & ray) = 0;
|
|
void setTransform(const Transform & t) { m_transform = t; }
|
|
Transform & getTransform() { return m_transform; }
|
|
virtual Vector getNormalAt(const Vector & pt) = 0;
|
|
|
|
protected:
|
|
Transform m_transform;
|
|
};
|
|
|
|
#endif
|
|
|