Private Member Functions | |
void | ScriptedLightBase () |
Constructor. Everything here is executed before the constructor of all children. | |
void | ~ScriptedLightBase () |
override void | EOnInit (IEntity other, int extra) |
override bool | IsScriptedLight () |
void | UpdateMode () |
private void | UpdateLightMode (string slotName) |
private void | DeleteLightWithDelay () |
Correct way of deleting light from memory. It is necesarry to have this delay due to hierarchy. | |
private void | DeleteLightNow () |
void | AttachOnObject (Object parent, vector local_pos="0 0 0", vector local_ori="0 0 0") |
Attaches this light on the parent entity, with optional position and orientation offset. | |
Object | GetAttachmentParent () |
Returns attachment parent. | |
void | AttachOnMemoryPoint (Object parent, string memory_point_start, string memory_point_target="") |
Attaches this light on the parent entity's memory point, with optional direction target memory point. | |
void | DetachFromParent () |
Detaches this light from its parent entity. | |
void | SetBrightnessTo (float value) |
Sets the brightness of the light. | |
void | CorrectLightPulseDuringDaylight () |
Call this after using SetBrightness(...) to fix light's intensity during daytime. | |
void | FadeBrightnessTo (float value, float time_in_s) |
Fades the brightness of the light to the given value. | |
void | SetRadiusTo (float value) |
Sets the radius of the light. | |
void | FadeRadiusTo (float value, float time_in_s) |
Fades the radius of the light to the given value. | |
void | Destroy () |
Switches off the light and deletes it from memory. | |
void | SetLifetime (float life_in_s) |
Makes the light destroy itself after the given time in seconds. The light will fade out if it's set to do so with SetFadeOutTime(...) | |
void | SetFadeOutTime (float time_in_s) |
Sets the fade out time in seconds. Fade out begins automatically as the light nears the end of its life time, or when method FadeOut() is called. | |
void | FadeOut (float time_in_s=-1) |
Starts the fade out process and destroys the light when its done. Optional parameter allows you to set time of this fade out in seconds. If not set, then default value (from SetFadeOutTime(...)) is used. | |
void | FadeIn (float time_in_s) |
Makes the light fade into existence. Works only at the moment the light is created. Consider using FadeBrightnessTo(...) and FadeRadiusTo(...) at anytime later during lifetime. | |
void | AddLifetime (float life_in_s) |
Prolongs the lifetime of the light in seconds. Use negative number to shorten its lifetime. | |
void | OnFrameLightSource (IEntity other, float timeSlice) |
Override this for custom functionality. | |
override void | EOnFrame (IEntity other, float timeSlice) |
On frame event. If you want to control your light within your own rules then override the event OnFrameLightSource and put your code there. | |
void | SetDancingShadowsAmplitude (float max_deviation_in_meters) |
Sets the maximum range of the point light within the dancing shadows effect. | |
void | SetDancingShadowsMovementSpeed (float speed_in_meters_per_frame) |
Sets the maximum speed of the point light within the dancing shadows effect. | |
float | GetDancingShadowsAmplitude () |
Returns max movement range of pointlight within the dancing shadow effect. | |
float | GetDancingShadowsMovementSpeed () |
Returns max movement speed of pointlight within the dancing shadow effect. | |
void | SetSelectionID (int id) |
void | UpdateLightSourceMaterial (string path) |
void | EnableDebug (bool state) |
Enables some debug functionality of this light. | |
void | HandleDancingShadows (float time, float timeSlice) |
void | HandleFlickering (float time, float timeSlice) |
void | SetFlickerSpeed (float speed) |
Sets speed of light flickering (random brightness coefficient change per second) | |
void | SetFlickerAmplitude (float coef) |
Sets the change coefficient of flickering light. (0.0 - 1.0 values, result of greater values are period time of light off ) | |
void | SetFlickerAmplitudeMax (float coef) |
void | SetFlickerAmplitudeMin (float coef) |
float | GetFlickerSpeed () |
Returns flicker speed. | |
float | GetFlickerAmplitudeCoefMax () |
Returns flicker amplitude maximum. | |
float | GetFlickerAmplitudeCoefMin () |
Returns flicker amplitude minimum. | |
void | TryShadowOptimization () |
Optimizes shadows by disabling them on this light source while it's within the given radius around the camera. | |
void | SetDisableShadowsWithinRadius (float radius_in_m) |
When the light source gets within this radius (radius_in_m) around the camera, then it's shadows are disabled. | |
float | GetDisableShadowsWithinRadius () |
Returns the range you put inside SetDisableShadowsWithinRadius(...) | |
void | CheckIfParentIsInCargo () |
private bool | CheckLifetime (int current_time) |
private void | CheckFadeOut (int current_time) |
private void | HandleBrightnessFadeing (float timeSlice) |
private void | HandleRadiusFadeing (float timeSlice) |
void | SetBlinkingSpeed (float _speed) |
Sets blinking speed (no blinking if speed <= 0) | |
float | GetBlinkingSpeed () |
Returns the speed of blinks. | |
private void | HandleBlinking (float time) |
void | EnableDimming (float baseBrightness, DimmingConfig dimCfg) |
LightDimming | GetDimming () |
void | StopDimming () |
Static Private Member Functions | |
static ScriptedLightBase | CreateLightAtObjMemoryPoint (typename name, notnull Object target, string memory_point_start, string memory_point_target="", vector global_pos="0 0 0", float fade_in_time_in_s=0) |
static ScriptedLightBase | CreateLight (typename name, vector global_pos="0 0 0", float fade_in_time_in_s=0) |
Creates an instance of light on the given position. Optionally, use fade_in_time_in_s parameter to make the light fade into existence. | |
Static Private Attributes | |
static ref set< ScriptedLightBase > | m_NightTimeOnlyLights = new set<ScriptedLightBase>() |
|
inlineprivate |
|
inlineprivate |
Prolongs the lifetime of the light in seconds. Use negative number to shorten its lifetime.
|
inlineprivate |
Attaches this light on the parent entity's memory point, with optional direction target memory point.
References vector::Direction(), ErrorEx, m_LocalPos, and vector::VectorToAngles().
|
inlineprivate |
Attaches this light on the parent entity, with optional position and orientation offset.
References m_LocalOri, m_LocalPos, m_Parent, and SetPosition().
|
inlineprivate |
|
inlineprivate |
References GameInventory::IsInCargo(), m_Parent, and SetEnabled().
|
inlineprivate |
Call this after using SetBrightness(...) to fix light's intensity during daytime.
|
inlinestaticprivate |
|
inlinestaticprivate |
References CreateLight(), and name.
|
inlineprivate |
References GetGame(), and CGame::ObjectDelete().
|
inlineprivate |
Correct way of deleting light from memory. It is necesarry to have this delay due to hierarchy.
References CALL_CATEGORY_SYSTEM, GetGame(), and m_DeleteTimer.
|
inlineprivate |
Switches off the light and deletes it from memory.
References m_Parent, and SetEnabled().
|
inlineprivate |
Detaches this light from its parent entity.
References GetParent(), m_LocalOri, m_LocalPos, m_Parent, and Vector().
|
inlineprivate |
Enables some debug functionality of this light.
|
inlineprivate |
References LightDimming().
On frame event. If you want to control your light within your own rules then override the event OnFrameLightSource and put your code there.
References GetGame(), CGame::GetTime(), m_Radius, and SetRadius().
References GetGame(), and GetPlayer().
Fades the brightness of the light to the given value.
References Math::AbsFloat().
|
inlineprivate |
Makes the light fade into existence. Works only at the moment the light is created. Consider using FadeBrightnessTo(...) and FadeRadiusTo(...) at anytime later during lifetime.
|
inlineprivate |
Starts the fade out process and destroys the light when its done. Optional parameter allows you to set time of this fade out in seconds. If not set, then default value (from SetFadeOutTime(...)) is used.
Fades the radius of the light to the given value.
References Math::AbsFloat(), and m_Radius.
|
inlineprivate |
Returns the speed of blinks.
|
inlineprivate |
Returns max movement range of pointlight within the dancing shadow effect.
|
inlineprivate |
Returns max movement speed of pointlight within the dancing shadow effect.
|
inlineprivate |
|
inlineprivate |
Returns the range you put inside SetDisableShadowsWithinRadius(...)
|
inlineprivate |
Returns flicker amplitude maximum.
|
inlineprivate |
Returns flicker amplitude minimum.
|
inlineprivate |
Returns flicker speed.
|
inlineprivate |
References Math::Round(), and Math::Sin().
References Math::RandomFloat().
|
inlineprivate |
References Destroy(), m_Radius, and SetRadius().
|
inlineprivate |
Override this for custom functionality.
|
inlineprivate |
Constructor. Everything here is executed before the constructor of all children.
References GetGame(), CGame::GetTime(), and SetEnabled().
|
inlineprivate |
Sets blinking speed (no blinking if speed <= 0)
|
inlineprivate |
Sets the brightness of the light.
|
inlineprivate |
Sets the maximum range of the point light within the dancing shadows effect.
References Math::AbsFloat().
|
inlineprivate |
Sets the maximum speed of the point light within the dancing shadows effect.
References Math::AbsFloat().
|
inlineprivate |
When the light source gets within this radius (radius_in_m) around the camera, then it's shadows are disabled.
|
inlineprivate |
Sets the fade out time in seconds. Fade out begins automatically as the light nears the end of its life time, or when method FadeOut() is called.
|
inlineprivate |
Sets the change coefficient of flickering light. (0.0 - 1.0 values, result of greater values are period time of light off )
References Math::AbsFloat().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
Sets speed of light flickering (random brightness coefficient change per second)
|
inlineprivate |
Makes the light destroy itself after the given time in seconds. The light will fade out if it's set to do so with SetFadeOutTime(...)
References GetGame(), and CGame::GetTime().
|
inlineprivate |
Sets the radius of the light.
References m_Radius, and SetRadius().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
Optimizes shadows by disabling them on this light source while it's within the given radius around the camera.
References vector::Distance(), GetGame(), and GetPosition.
|
private |
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |