2
0

LightEvent.h 849 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef ANKI_EVENT_LIGHT_EVENT_H
  2. #define ANKI_EVENT_LIGHT_EVENT_H
  3. #include "anki/event/Event.h"
  4. #include "anki/Math.h"
  5. namespace anki {
  6. // Forward
  7. class Light;
  8. /// @addtogroup Events
  9. /// @{
  10. /// Helper class
  11. struct LightEventData
  12. {
  13. F32 radiusMultiplier = 0.0;
  14. Vec4 intensityMultiplier = Vec4(0.0);
  15. Vec4 specularIntensityMultiplier = Vec4(0.0);
  16. };
  17. /// An event for light animation
  18. class LightEvent: public Event, private LightEventData
  19. {
  20. public:
  21. /// @name Constructors/Destructor
  22. /// @{
  23. /// Constructor
  24. LightEvent(EventManager* manager, F32 startTime, F32 duration,
  25. Light* light, const LightEventData& data);
  26. /// @}
  27. /// Implements Event::update
  28. void update(F32 prevUpdateTime, F32 crntTime);
  29. private:
  30. Light* light;
  31. F32 originalRadius;
  32. Vec4 originalDiffColor;
  33. Vec4 originalSpecColor;
  34. };
  35. /// @}
  36. } // end namespace anki
  37. #endif