Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
brightnesstestlight.c
Go to the documentation of this file.
1 // Test case for light sources not working during daytime as expected
2 
3 class BrightnessTestLight extends PointLightBase
4 {
5  float m_Timer = 0;
6 
7  void BrightnessTestLight()
8  {
9  SetVisibleDuringDaylight(true);
10  SetRadiusTo( 30 );
11  SetCastShadow(true);
12  SetDiffuseColor(1, 1, 1);
13  SetAmbientColor(1, 1, 1);
14 
15  SetBrightnessTo(10);
16  }
17 
18  override void OnFrameLightSource(IEntity other, float timeSlice)
19  {
20  m_Timer += timeSlice;
21 
22  float pulse = Math.AbsFloat( Math.Cos( m_Timer) );
23 
24  if (pulse > 0)
25  {
26  Print(pulse);
27  SetBrightnessTo(pulse);
28  }
29  }
30 }
PointLightBase
Definition: staticobj_roadblock_wood_small.c:27
m_Timer
ref Timer m_Timer
Definition: dayzgame.c:690
Print
proto void Print(void var)
Prints content of variable to console/log.
IEntity
Definition: enentity.c:164
Math
Definition: enmath.c:6