light.h 914 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * DoRayMe - a quick and dirty Raytracer
  3. * Light header
  4. *
  5. * Created by Manoël Trapier
  6. * Copyright (c) 2020 986-Studio.
  7. *
  8. */
  9. #ifndef DORAYME_LIGHT_H
  10. #define DORAYME_LIGHT_H
  11. #include <tuple.h>
  12. #include <colour.h>
  13. #include <renderstat.h>
  14. #include <stdio.h>
  15. enum LightType
  16. {
  17. POINT_LIGHT = 0,
  18. };
  19. class Light
  20. {
  21. public:
  22. Colour intensity;
  23. Tuple position;
  24. LightType type;
  25. public:
  26. Light(LightType type = POINT_LIGHT, Tuple position=Point(0, 0, 0),
  27. Colour intensity=Colour(1, 1, 1)) : type(type), position(position), intensity(intensity)
  28. { stats.addLight(); };
  29. bool operator==(const Light &b) const { return this->intensity == b.intensity &&
  30. this->position == b.position &&
  31. this->type == b.type; };
  32. void dumpMe(FILE *fp);
  33. };
  34. #endif /* DORAYME_LIGHT_H */