Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_RotateManualCameraComponent.c
Go to the documentation of this file.
1
2
4[BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
6{
7 [Attribute("90")]
8 private float m_fSpeed;
9
10 private float m_fYaw;
11 private float m_fPitch;
12
13 //------------------------------------------------------------------------------------------------
14 override void EOnCameraFrame(SCR_ManualCameraParam param)
15 {
16 if (!param.isManualInputEnabled)
17 return;
18
19 float yaw = GetInputManager().GetActionValue("ManualCameraRotateYaw");
20 float pitch = GetInputManager().GetActionValue("ManualCameraRotatePitch");
21
22 //--- With mouse, the input is activated only every second frame. Correct it by using previous value.
23 if (GetInputManager().IsUsingMouseAndKeyboard())
24 {
25 float yawPrev = m_fYaw;
26 m_fYaw = yaw;
27 if (yaw == 0 && yawPrev != 0) yaw = yawPrev;
28
29 float pitchPrev = m_fPitch;
30 m_fPitch = pitch;
31 if (pitch == 0 && pitchPrev != 0) pitch = pitchPrev;
32 }
33
34 if (yaw == 0 && pitch == 0)
35 return;
36
37 param.rotDelta += Vector(yaw, pitch, 0) * m_fSpeed * param.fov / Math.Max(GetCameraEntity().GetDefaultFOV(), 1);
38 param.isManualInput = true;
39 param.isDirty = true;
40 }
41
42 //------------------------------------------------------------------------------------------------
43 override bool EOnCameraInit()
44 {
45 return true;
46 }
47}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition Math.c:13
Parent class from which all SCR_ManualCamera components inherit.
Parameter for carrying information between individual camera components.
SCR_FieldOfViewSettings Attribute
proto native vector Vector(float x, float y, float z)