Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_LimitBoxManualCameraComponent.c
Go to the documentation of this file.
1 
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 }
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition: SCR_BaseManualCameraComponent.c:5
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_LimitBoxManualCameraComponent
Limit camera movement within specific box area.
Definition: SCR_LimitBoxManualCameraComponent.c:5
Attribute
typedef Attribute
Post-process effect of scripted camera.
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