Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
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
}
IEntity
Internal ancestor of all Entity implementations.
Definition
enentity.c:165
Math
Definition
enmath.c:7
PointLightBase
Definition
staticobj_roadblock_wood_small.c:28
PointLightBase::OnFrameLightSource
override void OnFrameLightSource(IEntity other, float timeSlice)
Definition
brightnesstestlight.c:18
PointLightBase::m_Timer
float m_Timer
Definition
brightnesstestlight.c:5
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.
Games
Dayz
scripts
4_world
entities
scriptedlightbase
pointlightbase
brightnesstestlight.c
Generated by
1.17.0