4 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.SpinBox,
params:
"0 inf 0.001", precision: 3,
desc:
"Random selection weight")]
7 int m_iDebugGroupIndex;
55 [
Attribute(
desc:
"Capsule start, defines offset from the pivot of the object, serves for collision detection")]
56 vector m_CapsuleStartInEditor;
58 [ForestGeneratorCapsuleStartAttribute()]
59 vector m_CapsuleStart;
61 [
Attribute(
desc:
"Capsule end, defines offset from the pivot of the object, serves for collision detection")]
62 vector m_CapsuleEndInEditor;
64 [ForestGeneratorCapsuleEndAttribute()]
67 [
Attribute(defvalue:
"1",
desc:
"This overrides the setting from template library!")]
68 bool m_bAlignToNormal;
71 protected float m_fMinDistanceFromLine = -1;
78 m_CapsuleStart = Rotate2D(m_CapsuleStartInEditor *
m_fScale, Math.DEG2RAD * m_fYaw);
79 m_CapsuleEnd = Rotate2D(m_CapsuleEndInEditor *
m_fScale, Math.DEG2RAD * m_fYaw);
83 vector Rotate2D(vector vec,
float rads)
85 float sin = Math.Sin(rads);
86 float cos = Math.Cos(rads);
89 vec[0] * cos - vec[2] * sin,
91 vec[0] * sin + vec[2] * cos);
95 float GetMinDistanceFromLine()
97 if (m_fMinDistanceFromLine != -1)
98 return m_fMinDistanceFromLine;
100 float distance = m_CapsuleStart.Length();
101 if (
distance > m_fMinDistanceFromLine)
105 if (
distance > m_fMinDistanceFromLine)
108 return m_fMinDistanceFromLine;