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.")]
11 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.SpinBox,
desc:
"The maximum density of the filling in number of clusters for hectare.")]
14 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.CheckBox,
desc:
"Generate this cluster?")]
17 SCR_EForestGeneratorClusterType m_Type;
27 foreach (SmallForestGeneratorClusterObject
object : m_aObjects)
42 void ForestGeneratorCircleCluster()
44 m_Type = SCR_EForestGeneratorClusterType.CIRCLE;
51 [
Attribute(defvalue:
"10", uiwidget: UIWidgets.SpinBox,
desc:
"Offset that is applied to generated objects to avoid seeing the exact shape of the curve. [m]")]
54 [
Attribute(defvalue:
"10", uiwidget: UIWidgets.SpinBox,
desc:
"Offset that is applied to generated objects to avoid seeing the exact shape of the curve. [m]")]
57 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.SpinBox,
desc:
"Defines how many times should the curve repeat for this strip.")]
60 [
Attribute(defvalue:
"10", uiwidget: UIWidgets.SpinBox,
desc:
"Defines the maximum extent of the curve. [m]")]
64 void ForestGeneratorStripCluster()
66 m_Type = SCR_EForestGeneratorClusterType.STRIP;
71 class WideForestGeneratorClusterObject : SmallForestGeneratorClusterObject
73 [
Attribute(
desc:
"Capsule start, defines offset from the pivot of the object, serves for collision detection")]
74 vector m_CapsuleStartInEditor;
76 [ForestGeneratorCapsuleStartAttribute()]
77 vector m_CapsuleStart;
79 [
Attribute(
desc:
"Capsule end, defines offset from the pivot of the object, serves for collision detection")]
80 vector m_CapsuleEndInEditor;
82 [ForestGeneratorCapsuleEndAttribute()]
85 [
Attribute(defvalue:
"1",
desc:
"This overrides the setting from template library!")]
86 bool m_bAlignToNormal;
89 protected float m_fMinDistanceFromLine = -1;
94 m_CapsuleStart = Rotate2D(m_CapsuleStartInEditor *
m_fScale, Math.DEG2RAD * m_fYaw);
95 m_CapsuleEnd = Rotate2D(m_CapsuleEndInEditor *
m_fScale, Math.DEG2RAD * m_fYaw);
99 vector Rotate2D(vector vec,
float rads)
101 float sin = Math.Sin(rads);
102 float cos = Math.Cos(rads);
105 vec[0] * cos - vec[2] * sin,
107 vec[0] * sin + vec[2] * cos);
111 float GetMinDistanceFromLine()
113 if (m_fMinDistanceFromLine != -1)
114 return m_fMinDistanceFromLine;
116 float distance = m_CapsuleStart.Length();
117 if (
distance > m_fMinDistanceFromLine)
121 if (
distance > m_fMinDistanceFromLine)
124 return m_fMinDistanceFromLine;
129 class SmallForestGeneratorClusterObject : SCR_ForestGeneratorTreeBase
131 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.SpinBox,
desc:
"Minimum count of this object to spawn")];
134 [
Attribute(defvalue:
"2", uiwidget: UIWidgets.SpinBox,
desc:
"Maximum count of this object to spawn")];
137 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.SpinBox,
desc:
"Minimum distance of this object from the center of this cluster")]
140 [
Attribute(defvalue:
"2", uiwidget: UIWidgets.SpinBox,
desc:
"Maximum distance of this object from the center of this cluster")]
151 class MiddleForestGeneratorClusterObject : SmallForestGeneratorClusterObject
154 float m_fMidDistance;
165 class BigForestGeneratorClusterObject : MiddleForestGeneratorClusterObject
168 float m_fTopDistance;
179 enum SCR_EForestGeneratorClusterType