Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_LimitBoxManualCameraComponent.c
Go to the documentation of this file.
1
2
4[BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
6{
7 [Attribute(defvalue: "-2000 -2000 -2000")]
8 private vector m_vBoundsMin;
9
10 [Attribute(defvalue: "2000 2000 2000")]
11 private vector m_vBoundsMax;
12
13 [Attribute(defvalue: "1", desc: "When true, boundaries are calculated from world boundaries, not from 0,0,0")]
14 private bool m_RelativeToWorld;
15
16 private vector m_vPos;
17
18 //------------------------------------------------------------------------------------------------
19 override void EOnCameraFrame(SCR_ManualCameraParam param)
20 {
21 if (!param.isDirty) return;
22
23 m_vPos = param.transform[3];
24 m_vPos[0] = Math.Clamp(m_vPos[0], m_vBoundsMin[0], m_vBoundsMax[0]);
25 m_vPos[1] = Math.Clamp(m_vPos[1], m_vBoundsMin[1], m_vBoundsMax[1]);
26 m_vPos[2] = Math.Clamp(m_vPos[2], m_vBoundsMin[2], m_vBoundsMax[2]);
27 param.transform[3] = m_vPos;
28 }
29
30 //------------------------------------------------------------------------------------------------
31 override bool EOnCameraInit()
32 {
33 if (!m_RelativeToWorld) return true;
34
35 ArmaReforgerScripted game = GetGame();
36 if (!game)
37 return false;
38
39 BaseWorld world = game.GetWorld();
40 if (!world)
41 return false;
42
43 vector worldBoundBoxMin, worldBoundBoxMax;
44 world.GetBoundBox(worldBoundBoxMin, worldBoundBoxMax);
45
46 m_vBoundsMin += worldBoundBoxMin;
47 m_vBoundsMax += worldBoundBoxMax;
48
49 return true;
50 }
51}
ref DSGameConfig game
Definition DSConfig.c:81
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Math.c:13
Parent class from which all SCR_ManualCamera components inherit.
Limit camera movement within specific box area.
Parameter for carrying information between individual camera components.
SCR_FieldOfViewSettings Attribute