Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_LimitCylinderManualCameraComponent.c
Go to the documentation of this file.
1 
4 [BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
6 {
7  [Attribute(defvalue: "1")]
8  protected float m_fRadius;
9 
10  [Attribute(defvalue: "2")]
11  protected float m_fHeightMinor;
12 
13  private float m_fRadiusSq;
14  private vector m_vPos;
15 
16  //------------------------------------------------------------------------------------------------
17  override void EOnCameraFrame(SCR_ManualCameraParam param)
18  {
19  if (!param.isDirty) return;
20 
21  m_vPos = param.transform[3];
22 
23  //--- Horizontal
24  if (vector.DistanceSqXZ(m_vPos, vector.Zero) > m_fRadiusSq)
25  {
26  float angle = Math.Atan2(m_vPos[0], m_vPos[2]);
27  m_vPos[0] = Math.Sin(angle) * m_fRadius;
28  m_vPos[2] = Math.Cos(angle) * m_fRadius;
29  }
30 
31  //--- Vertical
32  m_vPos[1] = Math.Clamp(m_vPos[1], -m_fHeightMinor, m_fHeightMinor);
33 
34  param.transform[3] = m_vPos;
35  }
36 
37  //------------------------------------------------------------------------------------------------
38  override bool EOnCameraInit()
39  {
40  m_fRadiusSq = m_fRadius * m_fRadius;
41  return true;
42  }
43 }
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition: SCR_BaseManualCameraComponent.c:5
SCR_LimitCylinderManualCameraComponent
Limit camera movement within specific cylindrical area.
Definition: SCR_LimitCylinderManualCameraComponent.c:5
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_fRadius
float m_fRadius
Definition: SCR_AITargetClusterState.c:30
SCR_ManualCameraParam
Parameter for carrying information between individual camera components.
Definition: SCR_ManualCameraParam.c:5
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468