Debian Codegraph @

src/scene/x3d/auto_generated_node_helpers/x3dnodes_particlesystem.inc

raw
1 { -*- buffer-read-only: t -*-
2
3 Copyright 2015-2024 Michalis Kamburelis.
4
5 This file is part of "Castle Game Engine".
6
7 "Castle Game Engine" is free software; see the file COPYING.txt,
8 included in this distribution, for details about the copyright.
9
10 "Castle Game Engine" is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 ----------------------------------------------------------------------------
15 }
16
17 { Automatically generated node properties.
18
19 Do not edit this file manually!
20 To add new properties:
21 - add them to the text files in tools/internal/x3d-nodes-to-pascal/nodes-specification/ ,
22 - and regenerate include files by running x3d-nodes-to-pascal }
23
24 {$ifdef read_interface}
25
26 strict private
27 function GetCreateParticles: Boolean;
28 procedure SetCreateParticles(const Value: Boolean);
29 function GetEnabled: Boolean;
30 procedure SetEnabled(const Value: Boolean);
31 function GetLifetimeVariation: Single;
32 procedure SetLifetimeVariation(const Value: Single);
33 function GetMaxParticles: Integer;
34 procedure SetMaxParticles(const Value: Integer);
35 function GetParticleLifetime: Single;
36 procedure SetParticleLifetime(const Value: Single);
37 function GetParticleSize: TVector2;
38 procedure SetParticleSize(const Value: TVector2);
39 function GetColor: TAbstractColorNode;
40 procedure SetColor(const Value: TAbstractColorNode);
41 function GetEmitter: TAbstractParticleEmitterNode;
42 procedure SetEmitter(const Value: TAbstractParticleEmitterNode);
43 function GetGeometryType: TParticlesGeometry;
44 procedure SetGeometryType(const Value: TParticlesGeometry);
45 function GetTexCoord: TTextureCoordinateNode;
46 procedure SetTexCoord(const Value: TTextureCoordinateNode);
47 public
48 { Create node fields and events. }
49 procedure CreateNode; override;
50 class function ClassX3DType: String; override;
51
52 strict private FFdCreateParticles: TSFBool;
53 { Internal wrapper for property @code(CreateParticles). This wrapper API may change, we advise to access simpler @code(CreateParticles) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
54 public property FdCreateParticles: TSFBool read FFdCreateParticles;
55 { }
56 property CreateParticles: Boolean read GetCreateParticles write SetCreateParticles;
57
58 strict private FFdEnabled: TSFBool;
59 { Internal wrapper for property @code(Enabled). This wrapper API may change, we advise to access simpler @code(Enabled) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
60 public property FdEnabled: TSFBool read FFdEnabled;
61 { }
62 property Enabled: Boolean read GetEnabled write SetEnabled;
63
64 strict private FFdLifetimeVariation: TSFFloat;
65 { Internal wrapper for property @code(LifetimeVariation). This wrapper API may change, we advise to access simpler @code(LifetimeVariation) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
66 public property FdLifetimeVariation: TSFFloat read FFdLifetimeVariation;
67 { }
68 property LifetimeVariation: Single read GetLifetimeVariation write SetLifetimeVariation;
69
70 strict private FFdMaxParticles: TSFInt32;
71 { Internal wrapper for property @code(MaxParticles). This wrapper API may change, we advise to access simpler @code(MaxParticles) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
72 public property FdMaxParticles: TSFInt32 read FFdMaxParticles;
73 { }
74 property MaxParticles: Integer read GetMaxParticles write SetMaxParticles;
75
76 strict private FFdParticleLifetime: TSFFloat;
77 { Internal wrapper for property @code(ParticleLifetime). This wrapper API may change, we advise to access simpler @code(ParticleLifetime) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
78 public property FdParticleLifetime: TSFFloat read FFdParticleLifetime;
79 { }
80 property ParticleLifetime: Single read GetParticleLifetime write SetParticleLifetime;
81
82 strict private FFdParticleSize: TSFVec2f;
83 { Internal wrapper for property @code(ParticleSize). This wrapper API may change, we advise to access simpler @code(ParticleSize) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
84 public property FdParticleSize: TSFVec2f read FFdParticleSize;
85 { }
86 property ParticleSize: TVector2 read GetParticleSize write SetParticleSize;
87
88 strict private FEventIsActive: TSFBoolEvent;
89 { }
90 public property EventIsActive: TSFBoolEvent read FEventIsActive;
91
92 strict private FFdColor: TSFNode;
93 { Internal wrapper for property @code(Color). This wrapper API may change, we advise to access simpler @code(Color) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
94 public property FdColor: TSFNode read FFdColor;
95 { }
96 property Color: TAbstractColorNode read GetColor write SetColor;
97
98 strict private FFdColorKey: TMFFloat;
99 { Internal wrapper for property @code(ColorKey). This wrapper API may change, we advise to access simpler @code(ColorKey) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
100 public property FdColorKey: TMFFloat read FFdColorKey;
101 { }
102 procedure SetColorKey(const Value: array of Single); overload;
103 { }
104 procedure SetColorKey(const Value: TSingleList); overload;
105
106 strict private FFdEmitter: TSFNode;
107 { Internal wrapper for property @code(Emitter). This wrapper API may change, we advise to access simpler @code(Emitter) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
108 public property FdEmitter: TSFNode read FFdEmitter;
109 { }
110 property Emitter: TAbstractParticleEmitterNode read GetEmitter write SetEmitter;
111
112 strict private FFdGeometryType: TSFStringEnum;
113 { Internal wrapper for property @code(GeometryType). This wrapper API may change, we advise to access simpler @code(GeometryType) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
114 public property FdGeometryType: TSFStringEnum read FFdGeometryType;
115 { }
116 property GeometryType: TParticlesGeometry read GetGeometryType write SetGeometryType;
117
118 strict private FFdPhysics: TMFNode;
119 { Internal wrapper for property @code(Physics). This wrapper API may change, we advise to access simpler @code(Physics) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
120 public property FdPhysics: TMFNode read FFdPhysics;
121 { }
122 procedure SetPhysics(const Value: array of TAbstractParticlePhysicsModelNode);
123
124 strict private FFdTexCoord: TSFNode;
125 { Internal wrapper for property @code(TexCoord). This wrapper API may change, we advise to access simpler @code(TexCoord) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
126 public property FdTexCoord: TSFNode read FFdTexCoord;
127 { }
128 property TexCoord: TTextureCoordinateNode read GetTexCoord write SetTexCoord;
129
130 strict private FFdTexCoordKey: TMFFloat;
131 { Internal wrapper for property @code(TexCoordKey). This wrapper API may change, we advise to access simpler @code(TexCoordKey) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
132 public property FdTexCoordKey: TMFFloat read FFdTexCoordKey;
133 { }
134 procedure SetTexCoordKey(const Value: array of Single); overload;
135 { }
136 procedure SetTexCoordKey(const Value: TSingleList); overload;
137
138 {$endif read_interface}
139
140 {$ifdef read_implementation}
141
142 { TParticleSystemNode ----------------------------------------------- }
143
144 function TParticleSystemNode.GetCreateParticles: Boolean;
145 begin
146 Result := FdCreateParticles.Value;
147 end;
148
149 procedure TParticleSystemNode.SetCreateParticles(const Value: Boolean);
150 begin
151 FdCreateParticles.Send(Value);
152 end;
153
154 function TParticleSystemNode.GetEnabled: Boolean;
155 begin
156 Result := FdEnabled.Value;
157 end;
158
159 procedure TParticleSystemNode.SetEnabled(const Value: Boolean);
160 begin
161 FdEnabled.Send(Value);
162 end;
163
164 function TParticleSystemNode.GetLifetimeVariation: Single;
165 begin
166 Result := FdLifetimeVariation.Value;
167 end;
168
169 procedure TParticleSystemNode.SetLifetimeVariation(const Value: Single);
170 begin
171 FdLifetimeVariation.Send(Value);
172 end;
173
174 function TParticleSystemNode.GetMaxParticles: Integer;
175 begin
176 Result := FdMaxParticles.Value;
177 end;
178
179 procedure TParticleSystemNode.SetMaxParticles(const Value: Integer);
180 begin
181 FdMaxParticles.Send(Value);
182 end;
183
184 function TParticleSystemNode.GetParticleLifetime: Single;
185 begin
186 Result := FdParticleLifetime.Value;
187 end;
188
189 procedure TParticleSystemNode.SetParticleLifetime(const Value: Single);
190 begin
191 FdParticleLifetime.Send(Value);
192 end;
193
194 function TParticleSystemNode.GetParticleSize: TVector2;
195 begin
196 Result := FdParticleSize.Value;
197 end;
198
199 procedure TParticleSystemNode.SetParticleSize(const Value: TVector2);
200 begin
201 FdParticleSize.Send(Value);
202 end;
203
204 function TParticleSystemNode.GetColor: TAbstractColorNode;
205 begin
206 if FdColor.Value is TAbstractColorNode then
207 Result := TAbstractColorNode(FdColor.Value)
208 else
209 Result := nil;
210 end;
211
212 procedure TParticleSystemNode.SetColor(const Value: TAbstractColorNode);
213 begin
214 FdColor.Send(Value);
215 end;
216
217 procedure TParticleSystemNode.SetColorKey(const Value: array of Single);
218 begin
219 FdColorKey.Send(Value);
220 end;
221
222 procedure TParticleSystemNode.SetColorKey(const Value: TSingleList);
223 begin
224 FdColorKey.Send(Value);
225 end;
226
227 function TParticleSystemNode.GetEmitter: TAbstractParticleEmitterNode;
228 begin
229 if FdEmitter.Value is TAbstractParticleEmitterNode then
230 Result := TAbstractParticleEmitterNode(FdEmitter.Value)
231 else
232 Result := nil;
233 end;
234
235 procedure TParticleSystemNode.SetEmitter(const Value: TAbstractParticleEmitterNode);
236 begin
237 FdEmitter.Send(Value);
238 end;
239
240 function TParticleSystemNode.GetGeometryType: TParticlesGeometry;
241 begin
242 Result := TParticlesGeometry(FdGeometryType.EnumValue);
243 end;
244
245 procedure TParticleSystemNode.SetGeometryType(const Value: TParticlesGeometry);
246 begin
247 FdGeometryType.SendEnumValue(Ord(Value));
248 end;
249
250 procedure TParticleSystemNode.SetPhysics(const Value: array of TAbstractParticlePhysicsModelNode);
251 var
252 L: Integer;
253 A: array of TX3DNode;
254 begin
255 L := High(Value) + 1;
256 SetLength(A, L);
257 if L > 0 then
258 Move(Value[0], A[0], L * SizeOf(TAbstractParticlePhysicsModelNode));
259 FdPhysics.Send(A);
260 end;
261
262 function TParticleSystemNode.GetTexCoord: TTextureCoordinateNode;
263 begin
264 if FdTexCoord.Value is TTextureCoordinateNode then
265 Result := TTextureCoordinateNode(FdTexCoord.Value)
266 else
267 Result := nil;
268 end;
269
270 procedure TParticleSystemNode.SetTexCoord(const Value: TTextureCoordinateNode);
271 begin
272 FdTexCoord.Send(Value);
273 end;
274
275 procedure TParticleSystemNode.SetTexCoordKey(const Value: array of Single);
276 begin
277 FdTexCoordKey.Send(Value);
278 end;
279
280 procedure TParticleSystemNode.SetTexCoordKey(const Value: TSingleList);
281 begin
282 FdTexCoordKey.Send(Value);
283 end;
284
285 class function TParticleSystemNode.ClassX3DType: String;
286 begin
287 Result := 'ParticleSystem';
288 end;
289
290 procedure TParticleSystemNode.CreateNode;
291 begin
292 inherited;
293
294 FFdCreateParticles := TSFBool.Create(Self, True, 'createParticles', true);
295 FdCreateParticles.ChangeAlways := chVisibleNonGeometry;
296 AddField(FFdCreateParticles);
297
298 FFdEnabled := TSFBool.Create(Self, True, 'enabled', true);
299 FdEnabled.ChangeAlways := chVisibleNonGeometry;
300 AddField(FFdEnabled);
301
302 FFdLifetimeVariation := TSFFloat.Create(Self, True, 'lifetimeVariation', 0.25);
303 FdLifetimeVariation.ChangeAlways := chVisibleNonGeometry;
304 FdLifetimeVariation.MustBeNonnegative := true;
305 AddField(FFdLifetimeVariation);
306
307 FFdMaxParticles := TSFInt32.Create(Self, True, 'maxParticles', 200);
308 FdMaxParticles.ChangeAlways := chVisibleNonGeometry;
309 FdMaxParticles.MustBeNonnegative := true;
310 AddField(FFdMaxParticles);
311
312 FFdParticleLifetime := TSFFloat.Create(Self, True, 'particleLifetime', 5);
313 FdParticleLifetime.ChangeAlways := chVisibleNonGeometry;
314 FdParticleLifetime.MustBeNonnegative := true;
315 AddField(FFdParticleLifetime);
316
317 FFdParticleSize := TSFVec2f.Create(Self, True, 'particleSize', Vector2(0.02, 0.02));
318 FdParticleSize.ChangeAlways := chVisibleNonGeometry;
319 AddField(FFdParticleSize);
320
321 FEventIsActive := TSFBoolEvent.Create(Self, 'isActive', false);
322 AddEvent(FEventIsActive);
323
324 FFdColor := TSFNode.Create(Self, False, 'color', [TAbstractColorNode]);
325 FdColor.ChangeAlways := chVisibleNonGeometry;
326 AddField(FFdColor);
327
328 FFdColorKey := TMFFloat.Create(Self, False, 'colorKey', []);
329 FdColorKey.ChangeAlways := chVisibleNonGeometry;
330 AddField(FFdColorKey);
331
332 FFdEmitter := TSFNode.Create(Self, False, 'emitter', [TAbstractParticleEmitterNode]);
333 FdEmitter.ChangeAlways := chVisibleNonGeometry;
334 AddField(FFdEmitter);
335
336 FFdGeometryType := TSFStringEnum.Create(Self, False, 'geometryType', @ParticlesGeometryNames, Ord(High(ParticlesGeometryNames)) + 1, Ord(pgQuad));
337 FdGeometryType.ChangeAlways := chVisibleNonGeometry;
338 AddField(FFdGeometryType);
339
340 FFdPhysics := TMFNode.Create(Self, False, 'physics', [TAbstractParticlePhysicsModelNode]);
341 FdPhysics.ChangeAlways := chVisibleNonGeometry;
342 AddField(FFdPhysics);
343
344 FFdTexCoord := TSFNode.Create(Self, False, 'texCoord', [TTextureCoordinateNode]);
345 FdTexCoord.ChangeAlways := chVisibleNonGeometry;
346 AddField(FFdTexCoord);
347
348 FFdTexCoordKey := TMFFloat.Create(Self, False, 'texCoordKey', []);
349 FdTexCoordKey.ChangeAlways := chVisibleNonGeometry;
350 AddField(FFdTexCoordKey);
351 end;
352
353 {$endif read_implementation}