Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_2DPiPScopeZeroingGenerator.c
Go to the documentation of this file.
2 {
3  [Attribute("", UIWidgets.ResourcePickerThumbnail, "Reference projectile", params: "et")]
4  protected ResourceName m_sReferenceProjectile;
5 
6  protected SCR_2DPIPSightsComponent m_SightsComponent;
7  protected float m_fFovZoomed;
8 
9  //------------------------------------------------------------------------------------------------
10  override bool WB_InitGenerator()
11  {
12  SetPointInfoGeneration(false);
13  SetProjectileResource(m_sReferenceProjectile);
14 
15  BaseSightsComponent bsc = GetSights();
16  m_SightsComponent = SCR_2DPIPSightsComponent.Cast(bsc);
17  if (m_SightsComponent)
18  {
19  float magnification = m_SightsComponent.GetMagnification();
20  float s_fReferenceFOV = 38; // Hardcoded, depends on player settings but this should work here
21  m_fFovZoomed = Math.RAD2DEG * 2 * Math.Atan2(Math.Tan(Math.DEG2RAD * (s_fReferenceFOV / 2)), magnification);
22  return true;
23  }
24  else
25  {
26  return false;
27  }
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  override bool WB_GetZeroingData(float weaponAngle, float distance, out vector offset, out vector angles)
32  {
33  angles[0] = weaponAngle;
34  return true;
35  }
36 
37  //------------------------------------------------------------------------------------------------
38  override float WB_CalculateWeaponZeroingAnimationValue(float pitch, float distance, out vector offset, out vector angles)
39  {
40  if (m_SightsComponent.GetZeroType() == SCR_EPIPZeroingType.EPZ_CAMERA_TURN)
41  {
42  return angles[0];
43  }
44  else
45  {
46  // Unsupported at this point.
47  Print("The Reticle Offset zeroing method is currently unsupported pending Refactor of scopes", LogLevel.ERROR);
48  return 0;
49  }
50  }
51 }
GetSights
TurretComponentClass AimingComponentClass GetSights()
ScriptedBaseZeroingGenerator
Definition: ScriptedBaseZeroingGenerator.c:7
Attribute
typedef Attribute
Post-process effect of scripted camera.
distance
float distance
Definition: SCR_DestructibleTreeV2.c:29
SCR_2DPiPScopeZeroingGenerator
Definition: SCR_2DPiPScopeZeroingGenerator.c:1
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24