16 [
Attribute(defvalue:
"1 1 1 0",
desc:
"Color of Camera attached light")]
19 [
Attribute(defvalue:
"1 1 1 0",
desc:
"Color of pointing light")]
28 [
Attribute(
"150",
desc:
"How high in the air is the light compaired to the ground at the given position if it does not follow the camera")]
31 [
Attribute(
"0",
desc:
"(Keyboard) How high does the camera need to be from the ground before the system considers showing the pointing light (still only showing when ShowPointingLightDistance is reached)")]
34 [
Attribute(
"0",
desc:
"(Gamepad) How high does the camera need to be from the ground before the system considers showing the pointing light (still only showing when ShowPointingLightDistance is reached)")]
37 [
Attribute(
"100",
desc:
"(Keyboard) How far does the hit location need to be before the pointing light is shown")]
40 [
Attribute(
"100",
desc:
"(Gamepad) How far does the hit location need to be before the pointing light is shown")]
43 [
Attribute(
"1",
desc:
"If false the rotation is the same as camera. If true it will set the m_fLightDeattachedRotationOverrideY as pointing light rotation Y")]
46 [
Attribute(
"-75",
desc:
"Will set pointing light rotation Y to this value if m_bPointingLightRotationOverride is true")]
49 [
Attribute(
"100",
desc:
"Distance from ground when Camera light is at max intensity",
params:
"0 99999")]
52 [
Attribute(
"200",
desc:
"Pointing light will be max light intensity fi this distance from light or higher")]
56 [
Attribute(
"17",
desc:
"Min intensity of camera light. This uses the ground level (alpha 0) to calculate the alpha to use in m_cCameraLightIntensityCurve",
params:
"-8 21")]
59 [
Attribute(
"17",
desc:
"Max intensity of camera light. This uses m_fCameraLightIntensityMaxHeight from ground (alpha 1) to calculate the alpha to use in m_cCameraLightIntensityCurve",
params:
"-8 21")]
63 [
Attribute(
"17",
desc:
"Min intensity of pointer light. This uses the m_fPointingLightIntensityMaxDistance (alpha 0) to calculate the alpha to use in m_cPointingLightIntensityCurve",
params:
"-8 21")]
66 [
Attribute(
"17",
desc:
"Max intensity of pointer light. This uses the m_fPointingLightIntensityMaxDistance (alpha 1) to calculate alpha to use in m_cPointingLightIntensityCurve",
params:
"-8 21")]
84 private const float LIGHT_TRACE_DISTANCE = 1500;
85 private const float LIGHT_MOUSE_Y_OFFSET = 20;
101 void SetLight(
bool enable,
bool noSound =
false)
117 Math3D.MatrixIdentity4(lightTrasform);
121 vector cameraTransform[4];
169 if (
data.m_aValues && !
data.m_aValues.IsEmpty())
170 SetLight(
data.m_aValues[0] != 0,
true);
218 vector cameraTransform[4];
221 bool showPointingLight =
false;
225 if (pointingPosition !=
vector.Zero)
228 distanceSq =
vector.DistanceSq(cameraTransform[3], pointingPosition);
231 if (distanceSq >= lightDetachDistanceSq)
235 if (cameraHeightAboveTerrain >= cameraHeightBeforeDeatach)
236 showPointingLight =
true;
241 if (showPointingLight)
247 vector lightTransform[4] = cameraTransform;
285 outDir *= LIGHT_TRACE_DISTANCE;
288 trace.Start = startPos;
289 trace.End = startPos + outDir;
294 if (startPos[1] >
m_World.GetOceanBaseHeight())
297 float rayDistance =
m_World.TraceMove(trace, null);
300 if (rayDistance >= 1)
301 cursorWorldPos =
Vector(0, - 1000, 0);
303 cursorWorldPos = startPos + outDir * rayDistance;
304 return cursorWorldPos;
316 vector startPos = transform[3];
317 vector rightVector = {transform[2][0], transform[2][1], transform[2][2]};
321 trace.Start = startPos;
322 trace.End = startPos + rightVector * LIGHT_TRACE_DISTANCE;
327 if (startPos[1] >
m_World.GetOceanBaseHeight())
331 float rayDistance =
m_World.TraceMove(trace, null);
334 if (rayDistance >= 1)
335 return Vector(0, - 1000, 0);
338 vector hitPos = startPos + rightVector * (rayDistance * LIGHT_TRACE_DISTANCE);
349 Print(
"SCR_LightManualCameraComponent could not find World!",
LogLevel.WARNING);
353 Print(
"SCR_LightManualCameraComponent could not find Workspace!",
LogLevel.WARNING);
363 Print(
"SCR_LightManualCameraComponent: Cannot initialize, m_LightPrefab not defined!",
LogLevel.WARNING);
371 inputManager.AddActionListener(
"ManualCameraLight",
EActionTrigger.DOWN, ToggleLight);
392 inputManager.RemoveActionListener(
"ManualCameraLight",
EActionTrigger.DOWN, ToggleLight);
const int TRACE_LAYER_CAMERA
ArmaReforgerScripted GetGame()
ref array< string > angles
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Get all prefabs that have the spawner data
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Object holding reference to resource. In destructor release the resource.
Parent class from which all SCR_ManualCamera components inherit.
SCR_ManualCamera GetCameraEntity()
InputManager GetInputManager()
Create a light on camera position.
float m_fShowPointingLightDistance_gamepad
ref ScriptInvoker Event_OnLightChanged
ref Color m_cPointingLightColor
ref Curve m_cPointingLightIntensityCurve
ref Curve m_cCameraLightIntensityCurve
void OnInputDeviceIsGamepad(bool isGamepad)
override bool EOnCameraInit()
float m_fPointingLightIntensityMaxDistance
void PointingLightTransformUpdate(SCR_ManualCameraParam param, vector pointingPosition, float cameraHeightBeforeDeatach, float lightDetachDistanceSq)
override void EOnCameraSave(SCR_ManualCameraComponentSave data)
float m_fCameraLightIntesityMin
void PointingLightTransformUpdateGamepad(SCR_ManualCameraParam param)
void PointingLightTransformUpdateKeyboard(SCR_ManualCameraParam param)
ref Color m_cCameraLightColor
ScriptInvoker GetOnLightChanged()
float m_fCameraHeightBeforeShowPointing_gamepad
float m_fCameraHeightBeforeShowPointing_keyboard
override void EOnCameraLoad(SCR_ManualCameraComponentSave data)
bool m_bLightAtCameraPosition
override void EOnCameraExit()
float m_fShowPointingLightDistance_keyboard
float m_fPointingLightHeight
vector GetCursorWorldPosition()
vector GetCameraCenterRayCastPosition()
float m_fCameraLightIntensityMaxHeight
LightEntity m_CameraLight
float m_fPointingLightIntesityMin
override void EOnCameraFrame(SCR_ManualCameraParam param)
float m_fPointingLightIntesityMax
float m_fLongitudinalOffset
float m_fPointingLightRotationOverrideY
float m_fCameraLightIntesityMax
LightEntity m_PointingLight
ResourceName m_LightPrefab
void CameraLightIntensityUpdate(vector cameraTransform[4])
bool m_bPointingLightRotationOverride
bool m_bIsUsingKeyboardAndMouse
WorkspaceWidget m_WorkSpace
Parameter for carrying information between individual camera components.
static float GetHeightAboveTerrain(vector pos, BaseWorld world=null, bool noUnderwater=false, TraceParam trace=null)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute
proto native vector Vector(float x, float y, float z)