object.cpp 584 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * DoRayMe - a quick and dirty Raytracer
  3. * Object implementation
  4. *
  5. * Created by Manoël Trapier
  6. * Copyright (c) 2020 986-Studio.
  7. *
  8. */
  9. #include <ray.h>
  10. #include <object.h>
  11. #include <matrix.h>
  12. #include <tuple.h>
  13. #include <intersect.h>
  14. Object::Object()
  15. {
  16. this->transformMatrix = Matrix4().identity();
  17. this->inverseTransform = this->transformMatrix.inverse();
  18. }
  19. Intersect Object::intersect(Ray r)
  20. {
  21. return Intersect();
  22. };
  23. void Object::setTransform(Matrix transform)
  24. {
  25. this->transformMatrix = transform;
  26. this->inverseTransform = transform.inverse();
  27. }