cube.h 656 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * DoRayMe - a quick and dirty Raytracer
  3. * Cube header
  4. *
  5. * Created by Manoël Trapier
  6. * Copyright (c) 2020 986-Studio.
  7. *
  8. */
  9. #ifndef DORAYME_CUBE_H
  10. #define DORAYME_CUBE_H
  11. #include <shape.h>
  12. #include <ray.h>
  13. #include <intersect.h>
  14. #include <renderstat.h>
  15. #include <stdio.h>
  16. class Cube : public Shape {
  17. protected:
  18. void checkAxis(double axeOrigin, double axeDirection, double *axeMin, double *axeMax);
  19. void localIntersect(Ray r, Intersect &xs);
  20. Tuple localNormalAt(Tuple point, Intersection *hit = nullptr);
  21. public:
  22. Cube() : Shape(Shape::CUBE) { stats.addCube(); };
  23. void dumpMe(FILE *fp);
  24. };
  25. #endif /* DORAYME_CUBE_H */