1//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
2//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
3#pragma once
4
5#include "BsCorePrerequisites.h"
6#include "Reflection/BsRTTIType.h"
7#include "Particles/BsParticleSystem.h"
8#include "Particles/BsParticleEvolver.h"
9#include "Private/RTTI/BsColorGradientRTTI.h"
10#include "Private/RTTI/BsParticleDistributionRTTI.h"
11
12namespace bs
13{
14 /** @cond RTTI */
15 /** @addtogroup RTTI-Impl-Core
16 * @{
17 */
18
19 class BS_CORE_EXPORT ParticleEmitterConeShapeRTTI :
20 public RTTIType<ParticleEmitterConeShape, IReflectable, ParticleEmitterConeShapeRTTI>
21 {
22 private:
23 BS_BEGIN_RTTI_MEMBERS
24 BS_RTTI_MEMBER_PLAIN_NAMED(type, mInfo.type, 0)
25 BS_RTTI_MEMBER_PLAIN_NAMED(radius, mInfo.radius, 1)
26 BS_RTTI_MEMBER_PLAIN_NAMED(angle, mInfo.angle, 2)
27 BS_RTTI_MEMBER_PLAIN_NAMED(length, mInfo.length, 3)
28 BS_RTTI_MEMBER_PLAIN_NAMED(thickness, mInfo.thickness, 4)
29 BS_RTTI_MEMBER_PLAIN_NAMED(arc, mInfo.arc, 5)
30 BS_RTTI_MEMBER_PLAIN_NAMED(modeType, mInfo.mode.type, 6)
31 BS_RTTI_MEMBER_PLAIN_NAMED(modeInterval, mInfo.mode.interval, 7)
32 BS_RTTI_MEMBER_PLAIN_NAMED(modeSpeed, mInfo.mode.speed, 8)
33 BS_END_RTTI_MEMBERS
34
35 public:
36 const String& getRTTIName() override
37 {
38 static String name = "ParticleEmitterConeShape";
39 return name;
40 }
41
42 UINT32 getRTTIId() override
43 {
44 return TID_ParticleEmitterConeShape;
45 }
46
47 SPtr<IReflectable> newRTTIObject() override
48 {
49 return bs_shared_ptr_new<ParticleEmitterConeShape>();
50 }
51 };
52
53 class BS_CORE_EXPORT ParticleEmitterSphereShapeRTTI :
54 public RTTIType<ParticleEmitterSphereShape, IReflectable, ParticleEmitterSphereShapeRTTI>
55 {
56 private:
57 BS_BEGIN_RTTI_MEMBERS
58 BS_RTTI_MEMBER_PLAIN_NAMED(radius, mInfo.radius, 0)
59 BS_RTTI_MEMBER_PLAIN_NAMED(thickness, mInfo.thickness, 1)
60 BS_END_RTTI_MEMBERS
61
62 public:
63 const String& getRTTIName() override
64 {
65 static String name = "ParticleEmitterSphereShape";
66 return name;
67 }
68
69 UINT32 getRTTIId() override
70 {
71 return TID_ParticleEmitterSphereShape;
72 }
73
74 SPtr<IReflectable> newRTTIObject() override
75 {
76 return bs_shared_ptr_new<ParticleEmitterSphereShape>();
77 }
78 };
79
80 class BS_CORE_EXPORT ParticleEmitterHemisphereShapeRTTI :
81 public RTTIType<ParticleEmitterHemisphereShape, IReflectable, ParticleEmitterHemisphereShapeRTTI>
82 {
83 private:
84 BS_BEGIN_RTTI_MEMBERS
85 BS_RTTI_MEMBER_PLAIN_NAMED(radius, mInfo.radius, 0)
86 BS_RTTI_MEMBER_PLAIN_NAMED(thickness, mInfo.thickness, 1)
87 BS_END_RTTI_MEMBERS
88
89 public:
90 const String& getRTTIName() override
91 {
92 static String name = "ParticleEmitterHemisphereShape";
93 return name;
94 }
95
96 UINT32 getRTTIId() override
97 {
98 return TID_ParticleEmitterHemisphereShape;
99 }
100
101 SPtr<IReflectable> newRTTIObject() override
102 {
103 return bs_shared_ptr_new<ParticleEmitterHemisphereShape>();
104 }
105 };
106
107 class BS_CORE_EXPORT ParticleEmitterBoxShapeRTTI :
108 public RTTIType<ParticleEmitterBoxShape, IReflectable, ParticleEmitterBoxShapeRTTI>
109 {
110 private:
111 BS_BEGIN_RTTI_MEMBERS
112 BS_RTTI_MEMBER_PLAIN_NAMED(type, mInfo.type, 0)
113 BS_RTTI_MEMBER_PLAIN_NAMED(extents, mInfo.extents, 1)
114 BS_END_RTTI_MEMBERS
115
116 public:
117 const String& getRTTIName() override
118 {
119 static String name = "ParticleEmitterBoxShape";
120 return name;
121 }
122
123 UINT32 getRTTIId() override
124 {
125 return TID_ParticleEmitterBoxShape;
126 }
127
128 SPtr<IReflectable> newRTTIObject() override
129 {
130 return bs_shared_ptr_new<ParticleEmitterBoxShape>();
131 }
132 };
133
134 class BS_CORE_EXPORT ParticleEmitterLineShapeRTTI :
135 public RTTIType<ParticleEmitterLineShape, IReflectable, ParticleEmitterLineShapeRTTI>
136 {
137 private:
138 BS_BEGIN_RTTI_MEMBERS
139 BS_RTTI_MEMBER_PLAIN_NAMED(length, mInfo.length, 0)
140 BS_RTTI_MEMBER_PLAIN_NAMED(modeType, mInfo.mode.type, 1)
141 BS_RTTI_MEMBER_PLAIN_NAMED(modeInterval, mInfo.mode.interval, 2)
142 BS_RTTI_MEMBER_PLAIN_NAMED(modeSpeed, mInfo.mode.speed, 3)
143 BS_END_RTTI_MEMBERS
144
145 public:
146 const String& getRTTIName() override
147 {
148 static String name = "ParticleEmitterLineShape";
149 return name;
150 }
151
152 UINT32 getRTTIId() override
153 {
154 return TID_ParticleEmitterLineShape;
155 }
156
157 SPtr<IReflectable> newRTTIObject() override
158 {
159 return bs_shared_ptr_new<ParticleEmitterLineShape>();
160 }
161 };
162
163 class BS_CORE_EXPORT ParticleEmitterCircleShapeRTTI :
164 public RTTIType<ParticleEmitterCircleShape, IReflectable, ParticleEmitterCircleShapeRTTI>
165 {
166 private:
167 BS_BEGIN_RTTI_MEMBERS
168 BS_RTTI_MEMBER_PLAIN_NAMED(radius, mInfo.radius, 0)
169 BS_RTTI_MEMBER_PLAIN_NAMED(thickness, mInfo.thickness, 1)
170 BS_RTTI_MEMBER_PLAIN_NAMED(arc, mInfo.arc, 2)
171 BS_RTTI_MEMBER_PLAIN_NAMED(modeType, mInfo.mode.type, 3)
172 BS_RTTI_MEMBER_PLAIN_NAMED(modeInterval, mInfo.mode.interval, 4)
173 BS_RTTI_MEMBER_PLAIN_NAMED(modeSpeed, mInfo.mode.speed, 5)
174 BS_END_RTTI_MEMBERS
175
176 public:
177 const String& getRTTIName() override
178 {
179 static String name = "ParticleEmitterCircleShape";
180 return name;
181 }
182
183 UINT32 getRTTIId() override
184 {
185 return TID_ParticleEmitterCircleShape;
186 }
187
188 SPtr<IReflectable> newRTTIObject() override
189 {
190 return bs_shared_ptr_new<ParticleEmitterCircleShape>();
191 }
192 };
193
194 class BS_CORE_EXPORT ParticleEmitterRectShapeRTTI :
195 public RTTIType<ParticleEmitterRectShape, IReflectable, ParticleEmitterRectShapeRTTI>
196 {
197 private:
198 BS_BEGIN_RTTI_MEMBERS
199 BS_RTTI_MEMBER_PLAIN_NAMED(extents, mInfo.extents, 0)
200 BS_END_RTTI_MEMBERS
201
202 public:
203 const String& getRTTIName() override
204 {
205 static String name = "ParticleEmitterRectShape";
206 return name;
207 }
208
209 UINT32 getRTTIId() override
210 {
211 return TID_ParticleEmitterRectShape;
212 }
213
214 SPtr<IReflectable> newRTTIObject() override
215 {
216 return bs_shared_ptr_new<ParticleEmitterRectShape>();
217 }
218 };
219
220 class BS_CORE_EXPORT ParticleEmitterStaticMeshShapeRTTI :
221 public RTTIType<ParticleEmitterStaticMeshShape, IReflectable, ParticleEmitterStaticMeshShapeRTTI>
222 {
223 private:
224 BS_BEGIN_RTTI_MEMBERS
225 BS_RTTI_MEMBER_PLAIN_NAMED(type, mInfo.type, 0)
226 BS_RTTI_MEMBER_REFL_NAMED(mesh, mInfo.mesh, 1)
227 BS_RTTI_MEMBER_PLAIN_NAMED(sequential, mInfo.sequential, 2)
228 BS_END_RTTI_MEMBERS
229
230 public:
231 const String& getRTTIName() override
232 {
233 static String name = "ParticleEmitterStaticMeshShape";
234 return name;
235 }
236
237 UINT32 getRTTIId() override
238 {
239 return TID_ParticleEmitterStaticMeshShape;
240 }
241
242 SPtr<IReflectable> newRTTIObject() override
243 {
244 return bs_shared_ptr_new<ParticleEmitterStaticMeshShape>();
245 }
246 };
247
248 class BS_CORE_EXPORT ParticleEmitterSkinnedMeshShapeRTTI :
249 public RTTIType<ParticleEmitterSkinnedMeshShape, IReflectable, ParticleEmitterSkinnedMeshShapeRTTI>
250 {
251 private:
252 BS_BEGIN_RTTI_MEMBERS
253 BS_RTTI_MEMBER_PLAIN_NAMED(type, mInfo.type, 0)
254 BS_RTTI_MEMBER_PLAIN_NAMED(sequential, mInfo.sequential, 1)
255 BS_END_RTTI_MEMBERS
256
257 public:
258 const String& getRTTIName() override
259 {
260 static String name = "ParticleEmitterSkinnedMeshShape";
261 return name;
262 }
263
264 UINT32 getRTTIId() override
265 {
266 return TID_ParticleEmitterSkinnedMeshShape;
267 }
268
269 SPtr<IReflectable> newRTTIObject() override
270 {
271 return bs_shared_ptr_new<ParticleEmitterSkinnedMeshShape>();
272 }
273 };
274
275 template<> struct RTTIPlainType<ParticleBurst>
276 {
277 enum { id = TID_ParticleBurst }; enum { hasDynamicSize = 1 };
278
279 /** @copydoc RTTIPlainType::toMemory */
280 static void toMemory(const ParticleBurst& data, char* memory)
281 {
282 UINT32 size = sizeof(UINT32);
283 char* memoryStart = memory;
284 memory += sizeof(UINT32);
285
286 UINT32 version = 0; // In case the data structure changes
287 memory = rttiWriteElem(version, memory, size);
288 memory = rttiWriteElem(data.time, memory, size);
289 memory = rttiWriteElem(data.cycles, memory, size);
290 memory = rttiWriteElem(data.count, memory, size);
291 memory = rttiWriteElem(data.interval, memory, size);
292
293 memcpy(memoryStart, &size, sizeof(UINT32));
294 }
295
296 /** @copydoc RTTIPlainType::fromMemory */
297 static UINT32 fromMemory(ParticleBurst& data, char* memory)
298 {
299 UINT32 size = 0;
300 memory = rttiReadElem(size, memory);
301
302 UINT32 version;
303 memory = rttiReadElem(version, memory);
304
305 switch(version)
306 {
307 case 0:
308 memory = rttiReadElem(data.time, memory);
309 memory = rttiReadElem(data.cycles, memory);
310 memory = rttiReadElem(data.count, memory);
311 memory = rttiReadElem(data.interval, memory);
312 break;
313 default:
314 LOGERR("Unknown version of ParticleBurst data. Unable to deserialize.");
315 break;
316 }
317
318 return size;
319 }
320
321 /** @copydoc RTTIPlainType::getDynamicSize */
322 static UINT32 getDynamicSize(const ParticleBurst& data)
323 {
324 UINT64 dataSize = sizeof(UINT32) + sizeof(UINT32);
325 dataSize += rttiGetElemSize(data.time);
326 dataSize += rttiGetElemSize(data.cycles);
327 dataSize += rttiGetElemSize(data.count);
328 dataSize += rttiGetElemSize(data.interval);
329
330 assert(dataSize <= std::numeric_limits<UINT32>::max());
331
332 return (UINT32)dataSize;
333 }
334 };
335
336
337 class BS_CORE_EXPORT ParticleEmitterRTTI : public RTTIType<ParticleEmitter, IReflectable, ParticleEmitterRTTI>
338 {
339 private:
340 BS_BEGIN_RTTI_MEMBERS
341 BS_RTTI_MEMBER_PLAIN(mEmissionRate, 0)
342 BS_RTTI_MEMBER_PLAIN(mInitialLifetime, 1)
343 BS_RTTI_MEMBER_PLAIN(mInitialSpeed, 2)
344 BS_RTTI_MEMBER_PLAIN(mInitialSize, 3)
345 BS_RTTI_MEMBER_PLAIN(mInitialSize3D, 4)
346 BS_RTTI_MEMBER_PLAIN(mUse3DSize, 5)
347 BS_RTTI_MEMBER_PLAIN(mInitialRotation, 6)
348 BS_RTTI_MEMBER_PLAIN(mInitialRotation3D, 7)
349 BS_RTTI_MEMBER_PLAIN(mUse3DRotation, 8)
350 BS_RTTI_MEMBER_PLAIN(mInitialColor, 9)
351 BS_RTTI_MEMBER_PLAIN(mFlipU, 10)
352 BS_RTTI_MEMBER_PLAIN(mFlipV, 11)
353 BS_RTTI_MEMBER_REFLPTR(mShape, 12)
354 BS_RTTI_MEMBER_PLAIN(mRandomOffset, 13)
355 BS_RTTI_MEMBER_PLAIN_ARRAY(mBursts, 14)
356 BS_END_RTTI_MEMBERS
357
358 public:
359 const String& getRTTIName() override
360 {
361 static String name = "ParticleEmitter";
362 return name;
363 }
364
365 UINT32 getRTTIId() override
366 {
367 return TID_ParticleEmitter;
368 }
369
370 SPtr<IReflectable> newRTTIObject() override
371 {
372 return bs_shared_ptr_new<ParticleEmitter>();
373 }
374 };
375
376 class BS_CORE_EXPORT ParticleTextureAnimationRTTI :
377 public RTTIType<ParticleTextureAnimation, IReflectable, ParticleTextureAnimationRTTI>
378 {
379 private:
380 BS_BEGIN_RTTI_MEMBERS
381 BS_RTTI_MEMBER_PLAIN_NAMED(numCycles, mDesc.numCycles, 0)
382 BS_RTTI_MEMBER_PLAIN_NAMED(randomizeRow, mDesc.randomizeRow, 1)
383 BS_END_RTTI_MEMBERS
384
385 public:
386 const String& getRTTIName() override
387 {
388 static String name = "ParticleTextureAnimation";
389 return name;
390 }
391
392 UINT32 getRTTIId() override
393 {
394 return TID_ParticleTextureAnimation;
395 }
396
397 SPtr<IReflectable> newRTTIObject() override
398 {
399 return bs_shared_ptr_new<ParticleTextureAnimation>();
400 }
401 };
402
403 class BS_CORE_EXPORT ParticleOrbitRTTI : public RTTIType<ParticleOrbit, IReflectable, ParticleOrbitRTTI>
404 {
405 private:
406 BS_BEGIN_RTTI_MEMBERS
407 BS_RTTI_MEMBER_PLAIN_NAMED(center, mDesc.center, 0)
408 BS_RTTI_MEMBER_PLAIN_NAMED(velocity, mDesc.velocity, 1)
409 BS_RTTI_MEMBER_PLAIN_NAMED(radial, mDesc.radial, 2)
410 BS_RTTI_MEMBER_PLAIN_NAMED(worldSpace, mDesc.worldSpace, 3)
411 BS_END_RTTI_MEMBERS
412
413 public:
414 const String& getRTTIName() override
415 {
416 static String name = "ParticleOrbit";
417 return name;
418 }
419
420 UINT32 getRTTIId() override
421 {
422 return TID_ParticleOrbit;
423 }
424
425 SPtr<IReflectable> newRTTIObject() override
426 {
427 return bs_shared_ptr_new<ParticleOrbit>();
428 }
429 };
430
431 class BS_CORE_EXPORT ParticleVelocityRTTI : public RTTIType<ParticleVelocity, IReflectable, ParticleVelocityRTTI>
432 {
433 private:
434 BS_BEGIN_RTTI_MEMBERS
435 BS_RTTI_MEMBER_PLAIN_NAMED(velocity, mDesc.velocity, 0)
436 BS_RTTI_MEMBER_PLAIN_NAMED(worldSpace, mDesc.worldSpace, 1)
437 BS_END_RTTI_MEMBERS
438
439 public:
440 const String& getRTTIName() override
441 {
442 static String name = "ParticleVelocity";
443 return name;
444 }
445
446 UINT32 getRTTIId() override
447 {
448 return TID_ParticleVelocity;
449 }
450
451 SPtr<IReflectable> newRTTIObject() override
452 {
453 return bs_shared_ptr_new<ParticleVelocity>();
454 }
455 };
456
457 class BS_CORE_EXPORT ParticleForceRTTI : public RTTIType<ParticleForce, IReflectable, ParticleForceRTTI>
458 {
459 private:
460 BS_BEGIN_RTTI_MEMBERS
461 BS_RTTI_MEMBER_PLAIN_NAMED(force, mDesc.force, 0)
462 BS_RTTI_MEMBER_PLAIN_NAMED(worldSpace, mDesc.worldSpace, 1)
463 BS_END_RTTI_MEMBERS
464
465 public:
466 const String& getRTTIName() override
467 {
468 static String name = "ParticleForce";
469 return name;
470 }
471
472 UINT32 getRTTIId() override
473 {
474 return TID_ParticleForce;
475 }
476
477 SPtr<IReflectable> newRTTIObject() override
478 {
479 return bs_shared_ptr_new<ParticleForce>();
480 }
481 };
482
483 class BS_CORE_EXPORT ParticleGravityRTTI : public RTTIType<ParticleGravity, IReflectable, ParticleGravityRTTI>
484 {
485 private:
486 BS_BEGIN_RTTI_MEMBERS
487 BS_RTTI_MEMBER_PLAIN_NAMED(scale, mDesc.scale, 0)
488 BS_END_RTTI_MEMBERS
489
490 public:
491 const String& getRTTIName() override
492 {
493 static String name = "ParticleGravity";
494 return name;
495 }
496
497 UINT32 getRTTIId() override
498 {
499 return TID_ParticleGravity;
500 }
501
502 SPtr<IReflectable> newRTTIObject() override
503 {
504 return bs_shared_ptr_new<ParticleGravity>();
505 }
506 };
507
508 class BS_CORE_EXPORT ParticleColorRTTI : public RTTIType<ParticleColor, IReflectable, ParticleColorRTTI>
509 {
510 private:
511 BS_BEGIN_RTTI_MEMBERS
512 BS_RTTI_MEMBER_PLAIN_NAMED(color, mDesc.color, 0)
513 BS_END_RTTI_MEMBERS
514
515 public:
516 const String& getRTTIName() override
517 {
518 static String name = "ParticleColor";
519 return name;
520 }
521
522 UINT32 getRTTIId() override
523 {
524 return TID_ParticleColor;
525 }
526
527 SPtr<IReflectable> newRTTIObject() override
528 {
529 return bs_shared_ptr_new<ParticleColor>();
530 }
531 };
532
533 class BS_CORE_EXPORT ParticleSizeRTTI : public RTTIType<ParticleSize, IReflectable, ParticleSizeRTTI>
534 {
535 private:
536 BS_BEGIN_RTTI_MEMBERS
537 BS_RTTI_MEMBER_PLAIN_NAMED(size, mDesc.size, 0)
538 BS_RTTI_MEMBER_PLAIN_NAMED(size3D, mDesc.size3D, 1)
539 BS_RTTI_MEMBER_PLAIN_NAMED(use3DSize, mDesc.use3DSize, 2)
540 BS_END_RTTI_MEMBERS
541
542 public:
543 const String& getRTTIName() override
544 {
545 static String name = "ParticleSize";
546 return name;
547 }
548
549 UINT32 getRTTIId() override
550 {
551 return TID_ParticleSize;
552 }
553
554 SPtr<IReflectable> newRTTIObject() override
555 {
556 return bs_shared_ptr_new<ParticleSize>();
557 }
558 };
559
560 class BS_CORE_EXPORT ParticleRotationRTTI : public RTTIType<ParticleRotation, IReflectable, ParticleRotationRTTI>
561 {
562 private:
563 BS_BEGIN_RTTI_MEMBERS
564 BS_RTTI_MEMBER_PLAIN_NAMED(rotation, mDesc.rotation, 0)
565 BS_RTTI_MEMBER_PLAIN_NAMED(rotation3D, mDesc.rotation3D, 1)
566 BS_RTTI_MEMBER_PLAIN_NAMED(use3DRotation, mDesc.use3DRotation, 2)
567 BS_END_RTTI_MEMBERS
568
569 public:
570 const String& getRTTIName() override
571 {
572 static String name = "ParticleRotation";
573 return name;
574 }
575
576 UINT32 getRTTIId() override
577 {
578 return TID_ParticleRotation;
579 }
580
581 SPtr<IReflectable> newRTTIObject() override
582 {
583 return bs_shared_ptr_new<ParticleRotation>();
584 }
585 };
586
587 class BS_CORE_EXPORT ParticleCollisionsRTTI :
588 public RTTIType<ParticleCollisions, IReflectable, ParticleCollisionsRTTI>
589 {
590 private:
591 BS_BEGIN_RTTI_MEMBERS
592 BS_RTTI_MEMBER_PLAIN_NAMED(radius, mDesc.radius, 0)
593 BS_RTTI_MEMBER_PLAIN_NAMED(dampening, mDesc.dampening, 1)
594 BS_RTTI_MEMBER_PLAIN_NAMED(layer, mDesc.layer, 2)
595 BS_RTTI_MEMBER_PLAIN_NAMED(lifetimeLoss, mDesc.lifetimeLoss, 3)
596 BS_RTTI_MEMBER_PLAIN_NAMED(mode, mDesc.mode, 4)
597 BS_RTTI_MEMBER_PLAIN_NAMED(restitution, mDesc.restitution, 5)
598 BS_END_RTTI_MEMBERS
599
600 public:
601 const String& getRTTIName() override
602 {
603 static String name = "ParticleCollisions";
604 return name;
605 }
606
607 UINT32 getRTTIId() override
608 {
609 return TID_ParticleCollisions;
610 }
611
612 SPtr<IReflectable> newRTTIObject() override
613 {
614 return bs_shared_ptr_new<ParticleCollisions>();
615 }
616 };
617
618 class BS_CORE_EXPORT ParticleVectorFieldSettingsRTTI : public RTTIType<ParticleVectorFieldSettings, IReflectable, ParticleVectorFieldSettingsRTTI>
619 {
620 private:
621 BS_BEGIN_RTTI_MEMBERS
622 BS_RTTI_MEMBER_REFL(vectorField, 0)
623 BS_RTTI_MEMBER_PLAIN(intensity, 1)
624 BS_RTTI_MEMBER_PLAIN(tightness, 2)
625 BS_RTTI_MEMBER_PLAIN(scale, 3)
626 BS_RTTI_MEMBER_PLAIN(offset, 4)
627 BS_RTTI_MEMBER_PLAIN(rotation, 5)
628 BS_RTTI_MEMBER_PLAIN(rotationRate, 6)
629 BS_RTTI_MEMBER_PLAIN(tilingX, 7)
630 BS_RTTI_MEMBER_PLAIN(tilingY, 8)
631 BS_RTTI_MEMBER_PLAIN(tilingZ, 9)
632 BS_END_RTTI_MEMBERS
633
634 public:
635 const String& getRTTIName() override
636 {
637 static String name = "ParticleVectorFieldSettings";
638 return name;
639 }
640
641 UINT32 getRTTIId() override
642 {
643 return TID_ParticleVectorFieldSettings;
644 }
645
646 SPtr<IReflectable> newRTTIObject() override
647 {
648 return bs_shared_ptr_new<ParticleVectorFieldSettings>();
649 }
650 };
651
652 class BS_CORE_EXPORT ParticleDepthCollisionSettingsRTTI :
653 public RTTIType<ParticleDepthCollisionSettings, IReflectable, ParticleDepthCollisionSettingsRTTI>
654 {
655 private:
656 BS_BEGIN_RTTI_MEMBERS
657 BS_RTTI_MEMBER_PLAIN(enabled, 0)
658 BS_RTTI_MEMBER_PLAIN(restitution, 1)
659 BS_RTTI_MEMBER_PLAIN(dampening, 2)
660 BS_RTTI_MEMBER_PLAIN(radiusScale, 3)
661 BS_END_RTTI_MEMBERS
662
663 public:
664 const String& getRTTIName() override
665 {
666 static String name = "ParticleDepthCollisionSettings";
667 return name;
668 }
669
670 UINT32 getRTTIId() override
671 {
672 return TID_ParticleDepthCollisionSettings;
673 }
674
675 SPtr<IReflectable> newRTTIObject() override
676 {
677 return bs_shared_ptr_new<ParticleDepthCollisionSettings>();
678 }
679 };
680
681 class BS_CORE_EXPORT ParticleGpuSimulationSettingsRTTI :
682 public RTTIType<ParticleGpuSimulationSettings, IReflectable, ParticleGpuSimulationSettingsRTTI>
683 {
684 private:
685 BS_BEGIN_RTTI_MEMBERS
686 BS_RTTI_MEMBER_REFL(vectorField, 0)
687 BS_RTTI_MEMBER_PLAIN(colorOverLifetime, 1)
688 BS_RTTI_MEMBER_PLAIN(sizeScaleOverLifetime, 2)
689 BS_RTTI_MEMBER_REFL(depthCollision, 3)
690 BS_RTTI_MEMBER_PLAIN(acceleration, 4)
691 BS_RTTI_MEMBER_PLAIN(drag, 5)
692 BS_END_RTTI_MEMBERS
693
694 public:
695 const String& getRTTIName() override
696 {
697 static String name = "ParticleGpuSimulationSettings";
698 return name;
699 }
700
701 UINT32 getRTTIId() override
702 {
703 return TID_ParticleGpuSimulationSettings;
704 }
705
706 SPtr<IReflectable> newRTTIObject() override
707 {
708 return bs_shared_ptr_new<ParticleGpuSimulationSettings>();
709 }
710 };
711
712 class BS_CORE_EXPORT ParticleSystemSettingsRTTI :
713 public RTTIType<ParticleSystemSettings, IReflectable, ParticleSystemSettingsRTTI>
714 {
715 private:
716 BS_BEGIN_RTTI_MEMBERS
717 BS_RTTI_MEMBER_PLAIN(simulationSpace, 0)
718 BS_RTTI_MEMBER_PLAIN(orientation, 1)
719 BS_RTTI_MEMBER_PLAIN(orientationLockY, 2)
720 BS_RTTI_MEMBER_PLAIN(orientationPlaneNormal, 3)
721 BS_RTTI_MEMBER_PLAIN(sortMode, 4)
722 BS_RTTI_MEMBER_PLAIN(duration, 5)
723 BS_RTTI_MEMBER_PLAIN(isLooping, 6)
724 BS_RTTI_MEMBER_PLAIN(maxParticles, 7)
725 BS_RTTI_MEMBER_PLAIN(useAutomaticSeed, 8)
726 //BS_RTTI_MEMBER_PLAIN(gravityScale, 9)
727 BS_RTTI_MEMBER_PLAIN(manualSeed, 10)
728 BS_RTTI_MEMBER_REFL(material, 11)
729 BS_RTTI_MEMBER_PLAIN(useAutomaticBounds, 12)
730 BS_RTTI_MEMBER_PLAIN(customBounds, 13)
731 BS_RTTI_MEMBER_PLAIN(renderMode, 14)
732 BS_RTTI_MEMBER_REFL(mesh, 15)
733 BS_END_RTTI_MEMBERS
734
735 public:
736 const String& getRTTIName() override
737 {
738 static String name = "ParticleSystemSettings";
739 return name;
740 }
741
742 UINT32 getRTTIId() override
743 {
744 return TID_ParticleSystemSettings;
745 }
746
747 SPtr<IReflectable> newRTTIObject() override
748 {
749 return bs_shared_ptr_new<ParticleSystemSettings>();
750 }
751 };
752
753 class BS_CORE_EXPORT ParticleSystemRTTI : public RTTIType<ParticleSystem, IReflectable, ParticleSystemRTTI>
754 {
755 private:
756 BS_BEGIN_RTTI_MEMBERS
757 BS_RTTI_MEMBER_REFL(mSettings, 0)
758 BS_RTTI_MEMBER_REFLPTR_ARRAY(mEmitters, 1)
759 BS_RTTI_MEMBER_REFLPTR_ARRAY(mEvolvers, 2)
760 BS_RTTI_MEMBER_REFL(mGpuSimulationSettings, 3)
761 BS_RTTI_MEMBER_PLAIN(mLayer, 4)
762 BS_END_RTTI_MEMBERS
763
764 public:
765 void onDeserializationEnded(IReflectable* obj, SerializationContext* context) override
766 {
767 // Note: Since this is a CoreObject I should call initialize() right after deserialization,
768 // but since this specific type is used in Components we delay initialization until Component
769 // itself does it. Keep this is mind in case this ever needs to be deserialized for non-Component
770 // purposes (you'll need to call initialize manually).
771 }
772
773 const String& getRTTIName() override
774 {
775 static String name = "ParticleSystem";
776 return name;
777 }
778
779 UINT32 getRTTIId() override
780 {
781 return TID_ParticleSystem;
782 }
783
784 SPtr<IReflectable> newRTTIObject() override
785 {
786 return ParticleSystem::createEmpty();
787 }
788 };
789
790 /** @} */
791 /** @endcond */
792}
793