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

@@ -160,9 +160,9 @@ Group *OBJFile::groups(const char *groupName)
return nullptr;
}
Intersect OBJFile::intersect(Ray r)
void OBJFile::intersect(Ray &r, Intersect &xs)
{
return this->baseGroup->intersect(r);
this->baseGroup->intersect(r, xs);
}
bool OBJFile::includes(Shape *b)
@@ -170,9 +170,9 @@ bool OBJFile::includes(Shape *b)
return this->baseGroup->includes(b);
}
Intersect OBJFile::localIntersect(Ray r)
void OBJFile::localIntersect(Ray r, Intersect &xs)
{
return Intersect();
this->intersect(r, xs);
}
Tuple OBJFile::localNormalAt(Tuple point, Intersection *hit)