flashlightlight.c 570 B

1234567891011121314151617181920212223
  1. class FlashlightLight extends SpotLightBase
  2. {
  3. private static float m_DefaultBrightness = 4;
  4. private static float m_DefaultRadius = 25;
  5. void FlashlightLight()
  6. {
  7. SetVisibleDuringDaylight( true );
  8. SetRadiusTo( m_DefaultRadius );
  9. SetSpotLightAngle( 110 );
  10. SetCastShadow( true );
  11. EnableSpecular( true );
  12. SetBrightnessTo( m_DefaultBrightness );
  13. SetFadeOutTime( 0.15 );
  14. SetAmbientColor( 0.9, 0.85, 0.75 );
  15. SetDiffuseColor( 0.9, 0.85, 0.75 );
  16. }
  17. void SetIntensity( float coef, float time )
  18. {
  19. FadeBrightnessTo(m_DefaultBrightness * coef, time);
  20. }
  21. }