DayZ
1.24
Loading...
Searching...
No Matches
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
}
m_Timer
ref Timer m_Timer
Definition
DayZGame.c:675
IEntity
Definition
EnEntity.c:164
Math
Definition
EnMath.c:7
Param3
Definition
EntityAI.c:95
PointLightBase
Definition
StaticObj_Roadblock_Wood_Small.c:26
PointLightBase::OnFrameLightSource
override void OnFrameLightSource(IEntity other, float timeSlice)
Definition
BrightnessTestLight.c:18
PointLightBase::BrightnessTestLight
void BrightnessTestLight()
Definition
BrightnessTestLight.c:7
Print
proto void Print(void var)
Prints content of variable to console/log.
Math::Cos
static proto float Cos(float angle)
Returns cosinus of angle in radians.
Math::AbsFloat
static proto float AbsFloat(float f)
Returns absolute value.
scripts
4_World
Entities
ScriptedLightBase
PointLightBase
BrightnessTestLight.c
Generated by
1.10.0