Huge speed up by changing how Intersect are shared.

This commit is contained in:
Godzil
2020-03-12 00:11:26 +00:00
parent 0aa949c60b
commit b00bb75189
38 changed files with 116 additions and 153 deletions

View File

@@ -25,9 +25,9 @@ Shape::Shape(ShapeType type)
this->updateTransform();
}
Intersect Shape::intersect(Ray r)
void Shape::intersect(Ray &r, Intersect &xs)
{
return this->localIntersect(this->invTransform(r));
this->localIntersect(this->invTransform(r), xs);
};
Tuple Shape::normalToWorld(Tuple normalVector)