3class ForestGeneratorCluster
5 [
Attribute(defvalue:
"", uiwidget:
UIWidgets.Object,
desc:
"Define which tree groups should spawn in this cluster.")]
6 ref array<ref SmallForestGeneratorClusterObject> m_aObjects;
8 [
Attribute(defvalue:
"1", uiwidget:
UIWidgets.SpinBox,
desc:
"The minimum density of the filling in number of clusters for hectare.",
params:
"0 inf")]
11 [
Attribute(defvalue:
"1", uiwidget:
UIWidgets.SpinBox,
desc:
"The maximum density of the filling in number of clusters for hectare.",
params:
"0 inf")]
17 [
Attribute(defvalue:
"1", uiwidget:
UIWidgets.ComboBox,
desc:
"Can the cluster be present in main forest only, outline only or both", enums: { ParamEnum(
"Both",
"0"), ParamEnum(
"Forest only",
"1"), ParamEnum(
"Outline only",
"2") })]
20 SCR_EForestGeneratorClusterType m_Type;
25 void ForestGeneratorCluster()
30 foreach (SmallForestGeneratorClusterObject
object : m_aObjects)
32 if (
object.m_fMaxRadius > m_fRadius)
33 m_fRadius =
object.m_fMaxRadius;
35 if (
object.m_fMinRadius > m_fRadius)
36 m_fRadius =
object.m_fMinRadius;
46 void ForestGeneratorCircleCluster()
48 m_Type = SCR_EForestGeneratorClusterType.CIRCLE;
55 [
Attribute(defvalue:
"10", uiwidget: UIWidgets.SpinBox,
desc:
"Offset that is applied to generated objects to avoid seeing the exact shape of the curve. [m]")]
58 [
Attribute(defvalue:
"10", uiwidget: UIWidgets.SpinBox,
desc:
"Offset that is applied to generated objects to avoid seeing the exact shape of the curve. [m]")]
61 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.SpinBox,
desc:
"Defines how many times should the curve repeat for this strip.")]
64 [
Attribute(defvalue:
"10", uiwidget: UIWidgets.SpinBox,
desc:
"Defines the maximum extent of the curve. [m]")]
69 void ForestGeneratorStripCluster()
71 m_Type = SCR_EForestGeneratorClusterType.STRIP;
76class WideForestGeneratorClusterObject : SmallForestGeneratorClusterObject
78 [
Attribute(
desc:
"Capsule start, defines offset from the pivot of the object, serves for collision detection")]
79 vector m_CapsuleStartInEditor;
81 [ForestGeneratorCapsuleStartAttribute()]
82 vector m_CapsuleStart;
84 [
Attribute(
desc:
"Capsule end, defines offset from the pivot of the object, serves for collision detection")]
85 vector m_CapsuleEndInEditor;
87 [ForestGeneratorCapsuleEndAttribute()]
90 [
Attribute(defvalue:
"1",
desc:
"This overrides the setting from template library!")]
91 bool m_bAlignToNormal;
94 protected float m_fMinDistanceFromLine = -1;
100 m_CapsuleStart = Rotate2D(m_CapsuleStartInEditor *
m_fScale, Math.DEG2RAD * m_fYaw);
101 m_CapsuleEnd = Rotate2D(m_CapsuleEndInEditor *
m_fScale, Math.DEG2RAD * m_fYaw);
109 vector Rotate2D(vector vec,
float rads)
111 float sin = Math.Sin(rads);
112 float cos = Math.Cos(rads);
115 vec[0] * cos - vec[2] * sin,
117 vec[0] * sin + vec[2] * cos
123 float GetMinDistanceFromLine()
125 if (m_fMinDistanceFromLine != -1)
126 return m_fMinDistanceFromLine;
128 float distance = m_CapsuleStart.Length();
129 if (
distance > m_fMinDistanceFromLine)
133 if (
distance > m_fMinDistanceFromLine)
136 return m_fMinDistanceFromLine;
141class SmallForestGeneratorClusterObject : SCR_ForestGeneratorTreeBase
143 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.SpinBox,
desc:
"Minimum count of this object to spawn",
params:
"0 inf 1")]
146 [
Attribute(defvalue:
"2", uiwidget: UIWidgets.SpinBox,
desc:
"Maximum count of this object to spawn",
params:
"0 inf 1")]
149 [
Attribute(defvalue:
"-1", uiwidget: UIWidgets.Slider,
desc:
"Define the bell curve (see Wikipedia's Normal Distribution article)\n0 = closest to min, 100 = closest to max\n-1 = disabled",
params:
"-1 100 1")]
150 int m_iRandomMidPercent;
152 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.SpinBox,
desc:
"Minimum distance of this object from the center of this cluster",
params:
"0 inf")]
155 [
Attribute(defvalue:
"2", uiwidget: UIWidgets.SpinBox,
desc:
"Maximum distance of this object from the center of this cluster",
params:
"0 inf")]
166class MiddleForestGeneratorClusterObject : SmallForestGeneratorClusterObject
169 float m_fMidDistance;
180class BigForestGeneratorClusterObject : MiddleForestGeneratorClusterObject
183 float m_fTopDistance;
194enum SCR_EForestGeneratorClusterType
void ForestGeneratorDistaceAttribute(DistanceType distanceType)
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void Rotate(float tDelta, out vector transform[4], float rotationValue)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
This class defines forest generator clusters - which trees with which density should be present in th...
SCR_FieldOfViewSettings Attribute