8 private vector m_vBoundsMin;
11 private vector m_vBoundsMax;
13 [
Attribute(defvalue:
"1",
desc:
"When true, boundaries are calculated from world boundaries, not from 0,0,0")]
14 private bool m_RelativeToWorld;
16 private vector m_vPos;
21 if (!param.isDirty)
return;
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;
31 override bool EOnCameraInit()
33 if (!m_RelativeToWorld)
return true;
35 ArmaReforgerScripted game =
GetGame();
39 BaseWorld world = game.GetWorld();
43 vector worldBoundBoxMin, worldBoundBoxMax;
44 world.GetBoundBox(worldBoundBoxMin, worldBoundBoxMax);
46 m_vBoundsMin += worldBoundBoxMin;
47 m_vBoundsMax += worldBoundBoxMax;