Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
ForestGeneratorTrees.c
Go to the documentation of this file.
1 [BaseContainerProps(namingConvention: NamingConvention.NC_MUST_HAVE_NAME)]
2 class ForestGeneratorTree : SCR_ForestGeneratorTreeBase
3 {
4  [Attribute(defvalue: "1", uiwidget: UIWidgets.SpinBox, params: "0 inf 0.001", precision: 3, desc: "Random selection weight")]
5  float m_fWeight;
6 
7  int m_iDebugGroupIndex;
8 }
9 
10 [BaseContainerProps(namingConvention: NamingConvention.NC_MUST_HAVE_NAME)]
11 class ForestGeneratorTreeShort : ForestGeneratorTree
12 {
13  //------------------------------------------------------------------------------------------------
14  override void AdjustScale()
15  {
17  }
18 }
19 
20 [BaseContainerProps(namingConvention: NamingConvention.NC_MUST_HAVE_NAME)]
21 class ForestGeneratorTreeMiddle : ForestGeneratorTree
22 {
23  [Attribute(defvalue: "5", uiwidget: UIWidgets.SpinBox, "Minimum required radius in the middle layer for this object to spawn"), ForestGeneratorDistaceAttribute(DistanceType.MID)]
24  float m_fMidDistance;
25 
26  //------------------------------------------------------------------------------------------------
27  override void AdjustScale()
28  {
30  m_fMidDistance *= m_fScale;
31  }
32 }
33 
34 [BaseContainerProps(namingConvention: NamingConvention.NC_MUST_HAVE_NAME)]
35 class ForestGeneratorTreeTall : ForestGeneratorTree
36 {
37  [Attribute(defvalue: "5", uiwidget: UIWidgets.SpinBox, "Minimum required radius in the middle layer for this object to spawn"), ForestGeneratorDistaceAttribute(DistanceType.MID)]
38  float m_fMidDistance;
39 
40  [Attribute(defvalue: "10", uiwidget: UIWidgets.SpinBox, "Minimum required radius in the top layer for this object to spawn"), ForestGeneratorDistaceAttribute(DistanceType.TOP)]
41  float m_fTopDistance;
42 
43  //------------------------------------------------------------------------------------------------
44  override void AdjustScale()
45  {
47  m_fMidDistance *= m_fScale;
48  m_fTopDistance *= m_fScale;
49  }
50 }
51 
52 [BaseContainerProps(namingConvention: NamingConvention.NC_MUST_HAVE_NAME)]
53 class FallenTree : ForestGeneratorTree
54 {
55  [Attribute(desc: "Capsule start, defines offset from the pivot of the object, serves for collision detection")]
56  vector m_CapsuleStartInEditor;
57 
58  [ForestGeneratorCapsuleStartAttribute()]
59  vector m_CapsuleStart;
60 
61  [Attribute(desc: "Capsule end, defines offset from the pivot of the object, serves for collision detection")]
62  vector m_CapsuleEndInEditor;
63 
64  [ForestGeneratorCapsuleEndAttribute()]
65  vector m_CapsuleEnd;
66 
67  [Attribute(defvalue: "1", desc: "This overrides the setting from template library!")]
68  bool m_bAlignToNormal;
69 
70  float m_fYaw = 0;
71  protected float m_fMinDistanceFromLine = -1;
72 
73  //------------------------------------------------------------------------------------------------
74  void Rotate()
75  {
76  // vector yawDirection = vector.YawToVector(yaw);
77  // yawDirection = Vector(-yawDirection[0], 0, yawDirection[1]); // convert from Enforce to Enfusion format
78  m_CapsuleStart = Rotate2D(m_CapsuleStartInEditor * m_fScale, Math.DEG2RAD * m_fYaw);
79  m_CapsuleEnd = Rotate2D(m_CapsuleEndInEditor * m_fScale, Math.DEG2RAD * m_fYaw);
80  }
81 
82  //------------------------------------------------------------------------------------------------
83  vector Rotate2D(vector vec, float rads)
84  {
85  float sin = Math.Sin(rads);
86  float cos = Math.Cos(rads);
87 
88  return Vector(
89  vec[0] * cos - vec[2] * sin,
90  0,
91  vec[0] * sin + vec[2] * cos);
92  }
93 
94  //------------------------------------------------------------------------------------------------
95  float GetMinDistanceFromLine()
96  {
97  if (m_fMinDistanceFromLine != -1)
98  return m_fMinDistanceFromLine;
99 
100  float distance = m_CapsuleStart.Length();
101  if (distance > m_fMinDistanceFromLine)
102  m_fMinDistanceFromLine = distance;
103 
104  distance = m_CapsuleEnd.Length();
105  if (distance > m_fMinDistanceFromLine)
106  m_fMinDistanceFromLine = distance;
107 
108  return m_fMinDistanceFromLine;
109  }
110 }
DistanceType
DistanceType
Definition: DistanceType.c:12
Rotate
protected void Rotate(float tDelta, out vector transform[4], float rotationValue)
Definition: SCR_PreviewEntityEditorUIComponent.c:439
ForestGeneratorDistaceAttribute
void ForestGeneratorDistaceAttribute(DistanceType distanceType)
Definition: ForestGeneratorObjects.c:3
m_fBotDistance
float m_fBotDistance
Definition: ForestGeneratorObjects.c:50
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
distance
float distance
Definition: SCR_DestructibleTreeV2.c:29
AdjustScale
void AdjustScale()
ForestGeneratorTree
Definition: ForestGeneratorTrees.c:2
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
m_fScale
float m_fScale
Definition: ForestGeneratorObjects.c:65
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