Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
ForestGeneratorTrees.c
Go to the documentation of this file.
1[BaseContainerProps(namingConvention: NamingConvention.NC_MUST_HAVE_NAME)]
2class 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)]
11class ForestGeneratorTreeShort : ForestGeneratorTree
12{
13 //------------------------------------------------------------------------------------------------
14 override void AdjustScale()
15 {
17 }
18}
19
20[BaseContainerProps(namingConvention: NamingConvention.NC_MUST_HAVE_NAME)]
21class 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)]
35class ForestGeneratorTreeTall : ForestGeneratorTree
36{
37 [Attribute(defvalue: "5", uiwidget: UIWidgets.SpinBox, "Minimum required radius in the middle layer for this object to spawn", params: "0 inf"), 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", params: "0 inf"), 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)]
53class 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;
71 protected float m_fMinDistanceFromLine = -1;
72
73 //------------------------------------------------------------------------------------------------
74 void Rotate()
75 {
76 m_CapsuleStart = Rotate2D(m_CapsuleStartInEditor * m_fScale, Math.DEG2RAD * m_fYaw);
77 m_CapsuleEnd = Rotate2D(m_CapsuleEndInEditor * m_fScale, Math.DEG2RAD * m_fYaw);
78 }
79
80 //------------------------------------------------------------------------------------------------
81 vector Rotate2D(vector vec, float rads)
82 {
83 float sin = Math.Sin(rads);
84 float cos = Math.Cos(rads);
85
86 return {
87 vec[0] * cos - vec[2] * sin,
88 0,
89 vec[0] * sin + vec[2] * cos
90 };
91 }
92
93 //------------------------------------------------------------------------------------------------
94 float GetMinDistanceFromLine()
95 {
96 if (m_fMinDistanceFromLine != -1)
97 return m_fMinDistanceFromLine;
98
99 float distance = m_CapsuleStart.Length();
100 if (distance > m_fMinDistanceFromLine)
101 m_fMinDistanceFromLine = distance;
102
103 distance = m_CapsuleEnd.Length();
104 if (distance > m_fMinDistanceFromLine)
105 m_fMinDistanceFromLine = distance;
106
107 return m_fMinDistanceFromLine;
108 }
109}
float m_fBotDistance
float m_fScale
void ForestGeneratorDistaceAttribute(DistanceType distanceType)
void AdjustScale()
params precision
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
float distance
void Rotate(float tDelta, out vector transform[4], float rotationValue)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_FieldOfViewSettings Attribute
DistanceType