DayZ 1.24
Loading...
Searching...
No Matches
SpotLightBase Class Reference
Collaboration diagram for SpotLightBase:
[legend]

Private Member Functions

void CarLightBase ()
 
void AggregateLight ()
 
void SegregateLight ()
 
void FlashlightLight ()
 
void SetIntensity (float coef, float time)
 
void HeadtorchLight ()
 
void SetColorToWhite ()
 
void SetColorToRed ()
 
void SetIntensity (float coef, float time)
 
void PerformVisibilityCheck (EntityAI owner)
 
void PistollightLight ()
 
void SetIntensity (float coef, float time)
 
override void UpdateLightMode (string slotName)
 
void SpotlightLight ()
 
void UniversallightLight ()
 
void SetIntensity (float coef, float time)
 
override void UpdateLightMode (string slotName)
 

Private Attributes

float m_SegregatedBrightness = 20
 
float m_SegregatedRadius = 66
 
float m_SegregatedAngle = 90
 
vector m_SegregatedColorRGB = Vector(1.0, 0.8, 0.6)
 
float m_AggregatedBrightness = 30
 
float m_AggregatedRadius = 100
 
float m_AggregatedAngle = 100
 
vector m_AggregatedColorRGB = Vector(1.0, 0.8, 0.6)
 

Static Private Attributes

static float m_DefaultBrightness = 4
 
static float m_DefaultRadius = 25
 
static float m_DefaultAngle = 100
 

Detailed Description

Definition at line 1 of file CarLightBase.c.

Member Function Documentation

◆ AggregateLight()

void SpotLightBase::AggregateLight ( )
inlineprivate

Definition at line 28 of file CarLightBase.c.

29 {
30 SetRadiusTo(m_AggregatedRadius);
31 SetSpotLightAngle(m_AggregatedAngle);
32 SetBrightnessTo(m_AggregatedBrightness);
35 SetFlareVisible(false);
36 }
vector m_AggregatedColorRGB
float m_AggregatedRadius
float m_AggregatedAngle
float m_AggregatedBrightness

◆ CarLightBase()

void SpotLightBase::CarLightBase ( )
inlineprivate

Definition at line 18 of file CarLightBase.c.

19 {
20 SetVisibleDuringDaylight(true);
21 SetCastShadow(true);
22 SetFlareVisible(true);
23 FadeIn(0.3);
24 SetFadeOutTime(0.25);
25
26 }

◆ FlashlightLight()

void SpotLightBase::FlashlightLight ( )
inlineprivate

Definition at line 6 of file FlashlightLight.c.

7 {
8 SetVisibleDuringDaylight(true);
9 SetRadiusTo(m_DefaultRadius);
10 SetSpotLightAngle(110);
11 SetCastShadow(true);
12 EnableSpecular(true);
13 SetBrightnessTo(m_DefaultBrightness);
14 SetFadeOutTime(0.15);
15 SetAmbientColor(0.9, 0.85, 0.75);
16 SetDiffuseColor(0.9, 0.85, 0.75);
17 }
static float m_DefaultRadius
static float m_DefaultBrightness

References m_DefaultBrightness, and m_DefaultRadius.

◆ HeadtorchLight()

void SpotLightBase::HeadtorchLight ( )
inlineprivate

Definition at line 6 of file HeadtorchLight.c.

7 {
8 SetVisibleDuringDaylight(true);
9 SetRadiusTo(m_DefaultRadius);
10 SetSpotLightAngle(95);
11 SetCastShadow(true);
12 FadeIn(0.06);
13 SetBrightnessTo(m_DefaultBrightness);
14 SetAmbientColor(0.92, 0.85, 0.58);
15 SetDiffuseColor(0.92, 0.85, 0.58);
16 SetFadeOutTime(0.1);
17 //SetDisableShadowsWithinRadius(0.25); // Idea for optimization: Uncomment this to disable shadows from Headtorch while it's on player's head during 1P view.
18 }

References m_DefaultBrightness, and m_DefaultRadius.

◆ PerformVisibilityCheck()

void SpotLightBase::PerformVisibilityCheck ( EntityAI owner)
inlineprivate

Definition at line 38 of file HeadtorchLight.c.

39 {
40 if (!owner.IsFlagSet(EntityFlags.VISIBLE) && IsEnabled())
41 SetEnabled(false);
42 else if (owner.IsFlagSet(EntityFlags.VISIBLE) && !IsEnabled())
43 SetEnabled(true);
44 }
void SetEnabled()
prevents insider adding in the wrong position, HOTFIX
EntityFlags
Entity flags.
Definition EnEntity.c:114

References SetEnabled().

◆ PistollightLight()

void SpotLightBase::PistollightLight ( )
inlineprivate

Definition at line 8 of file PistollightLight.c.

9 {
10 SetVisibleDuringDaylight(true);
11 SetRadiusTo(m_DefaultRadius);
12 SetSpotLightAngle(m_DefaultAngle);
13 SetCastShadow(true);
14 SetBrightnessTo(m_DefaultBrightness);
15 SetFadeOutTime(0.05);
16 SetAmbientColor(0.92, 0.88, 0.82);
17 SetDiffuseColor(0.92, 0.88, 0.82);
18 SetDisableShadowsWithinRadius(1.2);
19 }
static float m_DefaultAngle

References m_DefaultBrightness, and m_DefaultRadius.

◆ SegregateLight()

void SpotLightBase::SegregateLight ( )
inlineprivate

Definition at line 38 of file CarLightBase.c.

39 {
40 SetRadiusTo(m_SegregatedRadius);
41 SetSpotLightAngle(m_SegregatedAngle);
42 SetBrightnessTo(m_SegregatedBrightness);
45 SetFlareVisible(true);
46 }
float m_SegregatedAngle
vector m_SegregatedColorRGB
float m_SegregatedBrightness
Definition CarLightBase.c:8
float m_SegregatedRadius
Definition CarLightBase.c:9

◆ SetColorToRed()

void SpotLightBase::SetColorToRed ( )
inlineprivate

Definition at line 26 of file HeadtorchLight.c.

27 {
28 SetAmbientColor(1.0, 0.2, 0.2);
29 SetDiffuseColor(1.0, 0.2, 0.2);
30 }

◆ SetColorToWhite()

void SpotLightBase::SetColorToWhite ( )
inlineprivate

Definition at line 20 of file HeadtorchLight.c.

21 {
22 SetAmbientColor(0.92, 0.85, 0.86);
23 SetDiffuseColor(0.92, 0.85, 0.86);
24 }

◆ SetIntensity() [1/4]

void SpotLightBase::SetIntensity ( float coef,
float time )
inlineprivate

Definition at line 19 of file FlashlightLight.c.

20 {
21 FadeBrightnessTo(m_DefaultBrightness * coef, time);
22 }

References m_DefaultBrightness.

◆ SetIntensity() [2/4]

void SpotLightBase::SetIntensity ( float coef,
float time )
inlineprivate

Definition at line 32 of file HeadtorchLight.c.

33 {
34 FadeBrightnessTo(m_DefaultBrightness * coef, time);
35 FadeRadiusTo(m_DefaultRadius * coef, time);
36 }

References m_DefaultBrightness, and m_DefaultRadius.

◆ SetIntensity() [3/4]

void SpotLightBase::SetIntensity ( float coef,
float time )
inlineprivate

Definition at line 21 of file PistollightLight.c.

22 {
23 FadeBrightnessTo(m_DefaultBrightness * coef, time);
24 FadeRadiusTo(m_DefaultRadius * coef, time);
25 }

References m_DefaultBrightness, and m_DefaultRadius.

◆ SetIntensity() [4/4]

void SpotLightBase::SetIntensity ( float coef,
float time )
inlineprivate

Definition at line 20 of file UniversallightLight.c.

21 {
22 FadeBrightnessTo(m_DefaultBrightness * coef, time);
23 FadeRadiusTo(m_DefaultRadius * coef, time);
24 }

References m_DefaultBrightness, and m_DefaultRadius.

◆ SpotlightLight()

void SpotLightBase::SpotlightLight ( )
inlineprivate

Definition at line 3 of file SpotlightLight.c.

4 {
5 SetVisibleDuringDaylight(true);
6 SetRadiusTo(60);
7 SetSpotLightAngle(140);
8 SetCastShadow(true);
9 SetBrightnessTo(20.0);
10 SetFadeOutTime(0.3);
11 FadeIn(0.2);
12 SetAmbientColor(0.8, 0.9, 1.0);
13 SetDiffuseColor(0.8, 0.9, 1.0);
14 }

◆ UniversallightLight()

void SpotLightBase::UniversallightLight ( )
inlineprivate

Definition at line 7 of file UniversallightLight.c.

8 {
9 SetVisibleDuringDaylight(true);
10 SetRadiusTo(m_DefaultRadius);
11 SetSpotLightAngle(m_DefaultAngle);
12 SetCastShadow(true);
13 SetBrightnessTo(m_DefaultBrightness);
14 SetFadeOutTime(0.15);
15 SetAmbientColor(0.95, 0.88, 0.8);
16 SetDiffuseColor(0.95, 0.88, 0.8);
17 SetDisableShadowsWithinRadius(1.2);
18 }

References m_DefaultBrightness, and m_DefaultRadius.

◆ UpdateLightMode() [1/2]

override void SpotLightBase::UpdateLightMode ( string slotName)
inlineprivate

Definition at line 27 of file PistollightLight.c.

28 {
29 switch (slotName)
30 {
31 case "weaponFlashlight":
32 SetSpotLightAngle(m_DefaultAngle / 2);
33 SetRadiusTo(m_DefaultRadius * 1.8);
34 break;
35
36 default:
37 SetSpotLightAngle(m_DefaultAngle);
38 SetRadiusTo(m_DefaultRadius);
39 break;
40 }
41 }
PlayerSpawnPreset slotName

References m_DefaultRadius, and slotName.

◆ UpdateLightMode() [2/2]

override void SpotLightBase::UpdateLightMode ( string slotName)
inlineprivate

Definition at line 26 of file UniversallightLight.c.

27 {
28 switch (slotName)
29 {
30 case "weaponFlashlight":
31 SetSpotLightAngle(m_DefaultAngle / 2);
32 SetRadiusTo(m_DefaultRadius * 1.8);
33 break;
34
35 default:
36 SetSpotLightAngle(m_DefaultAngle);
37 SetRadiusTo(m_DefaultRadius);
38 break;
39 }
40 }

References m_DefaultRadius, and slotName.

Member Data Documentation

◆ m_AggregatedAngle

float SpotLightBase::m_AggregatedAngle = 100
private

Definition at line 15 of file CarLightBase.c.

◆ m_AggregatedBrightness

float SpotLightBase::m_AggregatedBrightness = 30
private

Definition at line 13 of file CarLightBase.c.

◆ m_AggregatedColorRGB

vector SpotLightBase::m_AggregatedColorRGB = Vector(1.0, 0.8, 0.6)
private

Definition at line 16 of file CarLightBase.c.

◆ m_AggregatedRadius

float SpotLightBase::m_AggregatedRadius = 100
private

Definition at line 14 of file CarLightBase.c.

◆ m_DefaultAngle

static float SpotLightBase::m_DefaultAngle = 100
staticprivate

Definition at line 5 of file PistollightLight.c.

◆ m_DefaultBrightness

static float SpotLightBase::m_DefaultBrightness = 4
staticprivate

Definition at line 3 of file FlashlightLight.c.

◆ m_DefaultRadius

static float SpotLightBase::m_DefaultRadius = 25
staticprivate

Definition at line 4 of file FlashlightLight.c.

◆ m_SegregatedAngle

float SpotLightBase::m_SegregatedAngle = 90
private

Definition at line 10 of file CarLightBase.c.

◆ m_SegregatedBrightness

float SpotLightBase::m_SegregatedBrightness = 20
private

Definition at line 8 of file CarLightBase.c.

◆ m_SegregatedColorRGB

vector SpotLightBase::m_SegregatedColorRGB = Vector(1.0, 0.8, 0.6)
private

Definition at line 11 of file CarLightBase.c.

◆ m_SegregatedRadius

float SpotLightBase::m_SegregatedRadius = 66
private

Definition at line 9 of file CarLightBase.c.


The documentation for this class was generated from the following files: