brightnesstestlight.c 563 B

123456789101112131415161718192021222324252627282930
  1. // Test case for light sources not working during daytime as expected
  2. class BrightnessTestLight extends PointLightBase
  3. {
  4. float m_Timer = 0;
  5. void BrightnessTestLight()
  6. {
  7. SetVisibleDuringDaylight(true);
  8. SetRadiusTo( 30 );
  9. SetCastShadow(true);
  10. SetDiffuseColor(1, 1, 1);
  11. SetAmbientColor(1, 1, 1);
  12. SetBrightnessTo(10);
  13. }
  14. override void OnFrameLightSource(IEntity other, float timeSlice)
  15. {
  16. m_Timer += timeSlice;
  17. float pulse = Math.AbsFloat( Math.Cos( m_Timer) );
  18. if (pulse > 0)
  19. {
  20. Print(pulse);
  21. SetBrightnessTo(pulse);
  22. }
  23. }
  24. }