DayZ
1.29
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
PersonalLight.c
См. документацию.
1
class
PersonalLight
extends
PointLightBase
2
{
3
void
PersonalLight
()
4
{
5
SetVisibleDuringDaylight(
false
);
6
SetRadiusTo( 3 );
7
SetBrightnessTo(0.38);
8
SetDiffuseColor(0.2, 0.23, 0.25);
9
SetCastShadow(
false
);
10
EnableSpecular(
false
);
11
EnableLinear(
true
);
12
SetFlareVisible(
false
);
13
}
14
15
override
void
OnFrameLightSource
(
IEntity
other,
float
timeSlice)
16
{
17
if
(
g_Game
&&
IsEnabled
() )
18
{
19
vector
pos =
g_Game
.GetCurrentCameraPosition();
20
pos +=
Vector
( 0, -0.4, 0 );
21
22
SetPosition
( pos );
23
}
24
}
25
26
// Experiment with dynamic range of Personal Light based on distance between camera and player's character.
27
/*override void OnFrameLightSource(IEntity other, float timeSlice)
28
{
29
if ( g_Game && IsEnabled() )
30
{
31
vector pos = g_Game.GetCurrentCameraPosition();
32
vector dir = g_Game.GetCurrentCameraDirection();
33
34
SetPosition(pos);
35
36
DayZPlayer plr = g_Game.GetPlayer();
37
if (plr)
38
{
39
vector pos_plr = plr.GetPosition() + Vector(0, 1.64, 0);
40
float distance = vector.Distance( pos_plr, pos );
41
//Print(distance);
42
float radius = 20.0 + distance;
43
SetRadiusTo( radius );
44
}
45
}
46
}*/
47
}
g_Game
DayZGame g_Game
Определения
DayZGame.c:3942
IEntity
Определения
EnEntity.c:165
PointLightBase::OnFrameLightSource
override void OnFrameLightSource(IEntity other, float timeSlice)
Определения
PersonalLight.c:15
PointLightBase::PersonalLight
void PersonalLight()
Определения
PersonalLight.c:3
PointLightBase
Определения
StaticObj_Roadblock_Wood_Small.c:28
vector
Определения
EnConvert.c:119
SetPosition
proto native void SetPosition(vector position)
Set the world position of the Effect.
Определения
Effect.c:463
Vector
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
IsEnabled
proto native bool IsEnabled()
Enabled flag getter.
Ishodniki
scripts
4_World
DayZ
Entities
ScriptedLightBase
PointLightBase
PersonalLight.c
Создано системой
1.13.2