light.h 867 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. enum LightType
  15. {
  16. POINT_LIGHT = 0,
  17. };
  18. class Light
  19. {
  20. public:
  21. Colour intensity;
  22. Tuple position;
  23. LightType type;
  24. public:
  25. Light(LightType type = POINT_LIGHT, Tuple position=Point(0, 0, 0),
  26. Colour intensity=Colour(1, 1, 1)) : type(type), position(position), intensity(intensity)
  27. { stats.addLight(); };
  28. bool operator==(const Light &b) const { return this->intensity == b.intensity &&
  29. this->position == b.position &&
  30. this->type == b.type; };
  31. };
  32. #endif /* DORAYME_LIGHT_H */