Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ForestGeneratorRectangle.c
Go to the documentation of this file.
2 {
7  ref array<SCR_ForestGeneratorLine> m_aLines = {}; // outline lines that intersect this rectangle
8  ref array<vector> m_aPoints = {}; // points of this rectangle
9  ref array<IEntitySource> m_aPresentRoadShapes = {};
10  float m_fWidth;
11  float m_fLength;
12  float m_fArea;
13  int m_iX;
14  int m_iY;
15 
16  //------------------------------------------------------------------------------------------------
17  void GetBounds(out vector mins, out vector maxs)
18  {
19  array<vector> points = {};
20  points.Insert(m_Line1.p1.m_vPos);
21  points.Insert(m_Line1.p2.m_vPos);
22  points.Insert(m_Line2.p2.m_vPos);
23  points.Insert(m_Line3.p2.m_vPos);
24  float minX = float.MAX;
25  float maxX = -float.MAX;
26  float minZ = float.MAX;
27  float maxZ = -float.MAX;
28 
29  foreach (vector point : points)
30  {
31  if (point[0] < minX)
32  minX = point[0];
33 
34  if (point[0] > maxX)
35  maxX = point[0];
36 
37  if (point[2] < minZ)
38  minZ = point[2];
39 
40  if (point[2] > maxZ)
41  maxZ = point[2];
42  }
43 
44  mins[0] = minX;
45  mins[2] = minZ;
46  maxs[0] = maxX;
47  maxs[2] = maxZ;
48  }
49 }
SCR_ForestGeneratorLine
Definition: SCR_ForestGeneratorLine.c:1
SCR_ForestGeneratorRectangle
Definition: SCR_ForestGeneratorRectangle.c:1