Plasma Engine  2.0
Loading...
Searching...
No Matches
KrautTreeAssetObjects.h
1#pragma once
2
3#include <EditorFramework/Assets/SimpleAssetDocument.h>
4#include <GuiFoundation/Widgets/CurveEditData.h>
5#include <ToolsFoundation/Object/DocumentObjectBase.h>
6
8{
9 plString m_sLabel;
10 plString m_sMaterial;
11};
12
13PL_DECLARE_REFLECTABLE_TYPE(PL_NO_LINKAGE, plKrautAssetMaterial);
14
16{
17 using StorageType = plUInt8;
18
19 enum Enum
20 {
21 Regular,
22 Umbrella,
23
24 Default = Regular,
25 };
26};
27
28PL_DECLARE_REFLECTABLE_TYPE(PL_NO_LINKAGE, plKrautBranchTypeMode);
29
31{
32 using StorageType = plUInt8;
33
34 enum Enum
35 {
36 Straight, // along the start direction
37 Upwards, // to the sky!
38 Degree22,
39 Degree45,
40 Degree67,
41 Degree90,
42 Degree112,
43 Degree135,
44 Degree157,
45 Downwards, // to the ground
46
47 Default = Straight
48 };
49};
50
51PL_DECLARE_REFLECTABLE_TYPE(PL_NO_LINKAGE, plKrautBranchTargetDir);
52
54{
55 using StorageType = plUInt8;
56
57 enum Enum
58 {
59 Upwards,
60 AlongBranch,
61 OrthogonalToBranch,
62
63 Default = Upwards,
64 };
65};
66
67PL_DECLARE_REFLECTABLE_TYPE(PL_NO_LINKAGE, plKrautLeafOrientation);
68
70{
71 using StorageType = plUInt8;
72
73 enum Enum
74 {
75 Full,
76 Symetric,
77 InverseSymetric,
78
79 Default = Full
80 };
81};
82
83PL_DECLARE_REFLECTABLE_TYPE(PL_NO_LINKAGE, plKrautFrondContourMode);
84
86{
87 using StorageType = plUInt8;
88
89 enum Enum
90 {
91 Off,
92 Relative,
93 Absolute,
94
95 Default = Off
96 };
97};
98
99PL_DECLARE_REFLECTABLE_TYPE(PL_NO_LINKAGE, plKrautBranchTargetDir2Usage);
100
102{
103 // === Administrative ===
104
105 //bool m_bVisible = true;
106
107 bool m_bGrowSubBranchType1 = false;
108 bool m_bGrowSubBranchType2 = false;
109 bool m_bGrowSubBranchType3 = false;
110
111 // === Branch Type ===
112
113 // General
114
115 plUInt8 m_uiSegmentLengthCM = 5;
116 plEnum<plKrautBranchTypeMode> m_BranchTypeMode = plKrautBranchTypeMode::Regular;
117 float m_fBranchlessPartABS = 0.0f;
118 float m_fBranchlessPartEndABS = 0.0f;
119 plUInt8 m_uiLowerBound = 0;
120 plUInt8 m_uiUpperBound = 100;
121 plUInt16 m_uiMinBranchThicknessInCM = 20;
122 plUInt16 m_uiMaxBranchThicknessInCM = 20;
123
124 // Spawn Nodes
125
126 plUInt8 m_uiMinBranches = 4;
127 plUInt8 m_uiMaxBranches = 4;
128 float m_fNodeSpacingBefore = 0.5f;
129 float m_fNodeSpacingAfter = 0.0f;
130 float m_fNodeHeight = 0.0f;
131
132
133 // === Growth ===
134
135 // Start Direction
136
137 plAngle m_MaxRotationalDeviation = {};
138 plAngle m_BranchAngle = plAngle::MakeFromDegree(90);
139 plAngle m_MaxBranchAngleDeviation = plAngle::MakeFromDegree(10);
140
141 // Target Direction
142
143 plEnum<plKrautBranchTargetDir> m_TargetDirection = plKrautBranchTargetDir::Straight;
144 bool m_bTargetDirRelative = false;
145 plEnum<plKrautBranchTargetDir2Usage> m_TargetDir2Uage = plKrautBranchTargetDir2Usage::Off;
146 float m_fTargetDir2Usage = 2.5f;
147 plEnum<plKrautBranchTargetDir> m_TargetDirection2 = plKrautBranchTargetDir::Upwards;
148 plAngle m_MaxTargetDirDeviation = plAngle::MakeFromDegree(20);
149
150 // Growth
151
152 plUInt16 m_uiMinBranchLengthInCM = 100;
153 plUInt16 m_uiMaxBranchLengthInCM = 100;
154 plSingleCurveData m_MaxBranchLengthParentScale;
155 plAngle m_GrowMaxTargetDirDeviation = {};
156 plAngle m_GrowMaxDirChangePerSegment = plAngle::MakeFromDegree(5);
157 bool m_bRestrictGrowthToFrondPlane = false;
158
159 // Obstacles
160
161 //bool m_bActAsObstacle = false;
162 //bool m_bDoPhysicalSimulation = false;
163 //float m_fPhysicsLookAhead = 1.5f;
164 //plAngle m_PhysicsEvasionAngle = plAngle::MakeFromDegree(30);
165
166
167 // === Appearance ===
168
169 // Branch Mesh
170
171 bool m_bEnableMesh = true;
172 plString m_sBranchMaterial;
173 plSingleCurveData m_BranchContour;
174 float m_fRoundnessFactor = 0.5f;
175 plUInt8 m_uiFlares = 0;
176 float m_fFlareWidth = 2.0f;
177 plSingleCurveData m_FlareWidthCurve;
178 plAngle m_FlareRotation = {};
179 bool m_bRotateTexCoords = true;
180
181 // Fronds
182
183 bool m_bEnableFronds = true;
184 plString m_sFrondMaterial;
185 float m_fTextureRepeat = 0.0f;
186 plEnum<plKrautLeafOrientation> m_FrondUpOrientation = plKrautLeafOrientation::Upwards;
187 plAngle m_MaxFrondOrientationDeviation = {};
188 plUInt8 m_uiNumFronds = 1;
189 bool m_bAlignFrondsOnSurface = false;
190 plUInt8 m_uiFrondDetail = 1;
191 plSingleCurveData m_FrondContour;
192 plEnum<plKrautFrondContourMode> m_FrondContourMode = plKrautFrondContourMode::Full;
193 float m_fFrondHeight = 0.5f;
194 plSingleCurveData m_FrondHeight;
195 float m_fFrondWidth = 0.5f;
196 plSingleCurveData m_FrondWidth;
197 //plColor m_FrondVariationColor;// currently done through the material
198
199 // Leaves
200
201 bool m_bEnableLeaves = true;
202 plString m_sLeafMaterial;
203 bool m_bBillboardLeaves = true;
204 float m_fLeafSize = 0.25f;
205 plSingleCurveData m_LeafScale;
206 float m_fLeafInterval = 0;
207 //plColor m_LeafVariationColor;// currently done through the material
208
209 // Shared
210
211 //plUInt8 m_uiTextureTilingX[Kraut::BranchGeometryType::ENUM_COUNT] = {1, 1, 1};
212 //plUInt8 m_uiTextureTilingY[Kraut::BranchGeometryType::ENUM_COUNT] = {1, 1, 1};
213};
214
215PL_DECLARE_REFLECTABLE_TYPE(PL_NO_LINKAGE, plKrautAssetBranchType);
216
218{
219 PL_ADD_DYNAMIC_REFLECTION(plKrautTreeAssetProperties, plReflectedClass);
220
221public:
224
225 //plString m_sKrautFile;
226 //float m_fUniformScaling = 1.0f;
227 //float m_fLodDistanceScale = 1.0f;
228 float m_fStaticColliderRadius = 0.4f;
229 float m_fTreeStiffness = 10.0f;
230 plString m_sSurface;
231
233 plKrautAssetBranchType m_BT_Trunk1;
234 //plKrautAssetBranchType m_BT_Trunk2;
235 //plKrautAssetBranchType m_BT_Trunk3;
236 plKrautAssetBranchType m_BT_MainBranch1;
237 plKrautAssetBranchType m_BT_MainBranch2;
238 plKrautAssetBranchType m_BT_MainBranch3;
239 plKrautAssetBranchType m_BT_SubBranch1;
240 plKrautAssetBranchType m_BT_SubBranch2;
241 plKrautAssetBranchType m_BT_SubBranch3;
242 plKrautAssetBranchType m_BT_Twig1;
243 plKrautAssetBranchType m_BT_Twig2;
244 plKrautAssetBranchType m_BT_Twig3;
245
246 plUInt16 m_uiRandomSeedForDisplay = 0;
247
248 plHybridArray<plUInt16, 16> m_GoodRandomSeeds;
249};
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
static constexpr plAngle MakeFromDegree(float fDegree)
Creates an instance of plAngle that was initialized from degree. (Performs a conversion)
Definition Angle_inl.h:33
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Definition KrautTreeAssetObjects.h:218
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
Definition CurveEditData.h:82
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Definition KrautTreeAssetObjects.h:102
Definition KrautTreeAssetObjects.h:8
Definition KrautTreeAssetObjects.h:86
Definition KrautTreeAssetObjects.h:31
Definition KrautTreeAssetObjects.h:16
Definition KrautTreeAssetObjects.h:70
Definition KrautTreeAssetObjects.h:54