Started working on boundingboxes.

This commit is contained in:
Godzil
2020-02-24 18:03:25 +00:00
parent d1965caf8d
commit 3011544e8f
13 changed files with 114 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ class Shape;
#include <matrix.h>
#include <intersect.h>
#include <material.h>
#include <boundingbox.h>
enum ShapeType
{
@@ -51,13 +52,15 @@ public:
public:
Shape(ShapeType = SHAPE_NONE);
Intersect intersect(Ray r);
virtual Intersect intersect(Ray r);
Tuple normalAt(Tuple point);
//virtual Bounds getBounds();
/* Bouding box points are always world value */
virtual BoundingBox getBounds();
void updateTransform();
Tuple worldToObject(Tuple point) { return this->inverseTransform * point; };
Tuple objectToWorld(Tuple point) { return this->transformMatrix * point; };
Tuple normalToWorld(Tuple normalVector);
void setTransform(Matrix transform);