Add transformation to objects.

This commit is contained in:
Godzil
2020-02-17 14:15:55 +00:00
parent b799e5f819
commit 00b283053e
5 changed files with 107 additions and 4 deletions

View File

@@ -9,9 +9,23 @@
#include <ray.h>
#include <object.h>
#include <matrix.h>
#include <tuple.h>
#include <intersect.h>
Object::Object()
{
this->transformMatrix = Matrix4().identity();
this->inverseTransform = this->transformMatrix.inverse();
}
Intersect Object::intersect(Ray r)
{
return Intersect();
};
};
void Object::setTransform(Matrix transform)
{
this->transformMatrix = transform;
this->inverseTransform = transform.inverse();
}