testshape.cpp 461 B

123456789101112131415161718192021222324
  1. /*
  2. * DoRayMe - a quick and dirty Raytracer
  3. * Test shape implementation
  4. *
  5. * Created by Manoël Trapier
  6. * Copyright (c) 2020 986-Studio.
  7. *
  8. */
  9. #include <shape.h>
  10. #include <testshape.h>
  11. TestShape::TestShape() : localRay(Point(0, 0, 0), Vector(0, 0, 0))
  12. {
  13. }
  14. void TestShape::localIntersect(Ray r, Intersect &xs)
  15. {
  16. this->localRay = r;
  17. }
  18. Tuple TestShape::localNormalAt(Tuple point, Intersection *hit)
  19. {
  20. return Vector(point.x, point.y, point.z);
  21. }