chemlightlight.c 990 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. class ChemlightLight extends PointLightBase
  2. {
  3. private static float m_DefaultBrightness = 1.5;
  4. private static float m_DefaultRadius = 7.5;
  5. void ChemlightLight()
  6. {
  7. SetVisibleDuringDaylight(false);
  8. SetRadiusTo(m_DefaultRadius);
  9. SetBrightnessTo(m_DefaultBrightness);
  10. FadeIn(1);
  11. SetFadeOutTime(2);
  12. SetFlareVisible(false);
  13. }
  14. void SetIntensity( float coef, float time )
  15. {
  16. FadeBrightnessTo(m_DefaultBrightness * coef, time);
  17. FadeRadiusTo(m_DefaultRadius * coef, time);
  18. }
  19. void SetColorToWhite()
  20. {
  21. SetAmbientColor(0.9, 0.9, 1.0);
  22. SetDiffuseColor(0.9, 0.9, 1.0);
  23. }
  24. void SetColorToRed()
  25. {
  26. SetAmbientColor(1.0, 0.3, 0.2);
  27. SetDiffuseColor(1.0, 0.3, 0.2);
  28. }
  29. void SetColorToGreen()
  30. {
  31. SetAmbientColor(0.3, 1.0, 0.2);
  32. SetDiffuseColor(0.3, 1.0, 0.2);
  33. }
  34. void SetColorToBlue()
  35. {
  36. SetAmbientColor(0.3, 0.3, 1.0);
  37. SetDiffuseColor(0.3, 0.3, 1.0);
  38. }
  39. void SetColorToYellow()
  40. {
  41. SetAmbientColor(1.0, 1.0, 0.3);
  42. SetDiffuseColor(1.0, 1.0, 0.3);
  43. }
  44. }