Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_LimitCylinderManualCameraComponent.c
Go to the documentation of this file.
1
2
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_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition Math.c:13
Parent class from which all SCR_ManualCamera components inherit.
Limit camera movement within specific cylindrical area.
Parameter for carrying information between individual camera components.
SCR_FieldOfViewSettings Attribute