Pixelpart 1.9.0
Godot Plugin
Loading...
Searching...
No Matches
PixelpartParticleType.h
1#ifndef PIXELPART_PARTICLE_TYPE_H
2#define PIXELPART_PARTICLE_TYPE_H
3
4#include "../property/PixelpartStaticPropertyFloat.h"
5#include "../property/PixelpartStaticPropertyFloat3.h"
6#include "../property/PixelpartStaticPropertyFloat4.h"
7#include "../property/PixelpartAnimatedPropertyFloat.h"
8#include "../property/PixelpartAnimatedPropertyFloat3.h"
9#include "../property/PixelpartAnimatedPropertyFloat4.h"
10#include <pixelpart-runtime/effect/ParticleType.h>
11#include <pixelpart-runtime/engine/EffectEngine.h>
12#include <godot_cpp/classes/ref_counted.hpp>
13
14namespace godot {
33class PixelpartParticleType : public RefCounted {
34 GDCLASS(PixelpartParticleType, RefCounted)
35
36public:
51
81
83 virtual ~PixelpartParticleType();
84
85#ifdef DOXYGEN
90
100
112
117
123 int layer;
124#endif
125
126 void init(pixelpart::ParticleType* particleTypePtr, pixelpart::EffectEngine* effectEnginePtr);
127
133 int get_id() const;
134
140 int get_parent_id() const;
141
147 String get_name() const;
148
154 void set_position_relative(bool mode);
155
161 bool is_position_relative() const;
162
170
178
185
192
198 Ref<PixelpartStaticPropertyFloat3> get_pivot() const;
199
207 Ref<PixelpartStaticPropertyFloat> get_motion_path_force() const;
208
214 void set_visible(bool mode);
215
221 bool is_visible() const;
222
230 void set_layer(int layer);
231
237 int get_layer() const;
238
244 Ref<PixelpartAnimatedPropertyFloat> get_count() const;
245
251 Ref<PixelpartAnimatedPropertyFloat> get_lifespan() const;
252
258 Ref<PixelpartAnimatedPropertyFloat> get_initial_size() const;
259
267 Ref<PixelpartAnimatedPropertyFloat3> get_initial_rotation() const;
268
274 Ref<PixelpartAnimatedPropertyFloat> get_initial_velocity() const;
275
281 Ref<PixelpartAnimatedPropertyFloat> get_inherited_velocity() const;
282
288 Ref<PixelpartAnimatedPropertyFloat> get_initial_opacity() const;
289
295 Ref<PixelpartAnimatedPropertyFloat3> get_position() const;
296
302 Ref<PixelpartAnimatedPropertyFloat3> get_size() const;
303
309 Ref<PixelpartAnimatedPropertyFloat3> get_stretch() const;
310
316 Ref<PixelpartAnimatedPropertyFloat> get_physical_size() const;
317
325 Ref<PixelpartAnimatedPropertyFloat3> get_rotation() const;
326
332 Ref<PixelpartAnimatedPropertyFloat3> get_rotation_by_speed() const;
333
339 Ref<PixelpartAnimatedPropertyFloat> get_acceleration() const;
340
346 Ref<PixelpartAnimatedPropertyFloat> get_radial_acceleration() const;
347
353 Ref<PixelpartAnimatedPropertyFloat> get_weight() const;
354
360 Ref<PixelpartAnimatedPropertyFloat> get_bounce() const;
361
367 Ref<PixelpartAnimatedPropertyFloat> get_friction() const;
368
374 Ref<PixelpartAnimatedPropertyFloat4> get_color() const;
375
381 Ref<PixelpartAnimatedPropertyFloat> get_opacity() const;
382
388 Ref<PixelpartStaticPropertyFloat> get_lifespan_variance() const;
389
395 Ref<PixelpartStaticPropertyFloat> get_size_variance() const;
396
402 Ref<PixelpartStaticPropertyFloat3> get_rotation_variance() const;
403
409 Ref<PixelpartStaticPropertyFloat3> get_angular_velocity_variance() const;
410
416 Ref<PixelpartStaticPropertyFloat> get_velocity_variance() const;
417
423 Ref<PixelpartStaticPropertyFloat4> get_color_variance() const;
424
430 Ref<PixelpartStaticPropertyFloat> get_opacity_variance() const;
431
432protected:
433 static void _bind_methods();
434
435private:
436 pixelpart::ParticleType* particleType = nullptr;
437 pixelpart::EffectEngine* effectEngine = nullptr;
438};
439}
440
441VARIANT_ENUM_CAST(PixelpartParticleType::RotationMode);
442VARIANT_ENUM_CAST(PixelpartParticleType::AlignmentMode);
443
444#endif
Defines the appearance and behavior of particles.
Definition PixelpartParticleType.h:33
Ref< PixelpartStaticPropertyFloat > get_size_variance() const
How much the size varies between particles.
Definition PixelpartParticleType.cpp:344
bool is_position_relative() const
Whether the position of particles is tied to the position of the emitter.
Definition PixelpartParticleType.cpp:35
void set_position_relative(bool mode)
Set whether the position of particles is tied to the position of the emitter.
Definition PixelpartParticleType.cpp:28
Ref< PixelpartAnimatedPropertyFloat > get_physical_size() const
Relative size of each particle for motion and collision calculations over its lifetime.
Definition PixelpartParticleType.cpp:222
Ref< PixelpartAnimatedPropertyFloat > get_acceleration() const
Linear acceleration applied to each particle over its lifetime.
Definition PixelpartParticleType.cpp:255
Ref< PixelpartAnimatedPropertyFloat > get_friction() const
How resistant each particle is to sliding down colliders over its lifetime.
Definition PixelpartParticleType.cpp:299
void set_rotation_mode(RotationMode mode)
Set whether the rotation property represents the exact rotation of particles or their angular velocit...
Definition PixelpartParticleType.cpp:39
void set_alignment_mode(AlignmentMode mode)
Set direction to which particles are aligned.
Definition PixelpartParticleType.cpp:52
int get_id() const
ID of the particle type.
Definition PixelpartParticleType.cpp:18
Ref< PixelpartStaticPropertyFloat > get_velocity_variance() const
How much the speed varies between particles.
Definition PixelpartParticleType.cpp:377
Ref< PixelpartAnimatedPropertyFloat > get_inherited_velocity() const
How much speed particles inherit from the parent particle or emitter.
Definition PixelpartParticleType.cpp:166
Ref< PixelpartStaticPropertyFloat > get_lifespan_variance() const
How much the lifespan varies between particles.
Definition PixelpartParticleType.cpp:333
void set_layer(int layer)
Set layer particles are drawn on.
Definition PixelpartParticleType.cpp:100
Ref< PixelpartStaticPropertyFloat4 > get_color_variance() const
How much the color varies between particles.
Definition PixelpartParticleType.cpp:388
Ref< PixelpartAnimatedPropertyFloat3 > get_position() const
Motion path for particles.
Definition PixelpartParticleType.cpp:189
int layer
Layer particles are drawn on.
Definition PixelpartParticleType.h:123
Ref< PixelpartAnimatedPropertyFloat > get_bounce() const
How much each particle bounces back from colliders over its lifetime.
Definition PixelpartParticleType.cpp:288
void set_visible(bool mode)
Set whether particles of this type are visible.
Definition PixelpartParticleType.cpp:89
Ref< PixelpartStaticPropertyFloat3 > get_pivot() const
Center of rotation relative to the particle’s center.
Definition PixelpartParticleType.cpp:65
int get_layer() const
Layer particles are drawn on.
Definition PixelpartParticleType.cpp:107
Ref< PixelpartAnimatedPropertyFloat > get_count() const
How many particles of this type are spawned by emitters.
Definition PixelpartParticleType.cpp:111
Ref< PixelpartAnimatedPropertyFloat > get_initial_velocity() const
How fast each particle is initially after being spawned by the emitter.
Definition PixelpartParticleType.cpp:155
RotationMode
Whether the rotation property represents the exact rotation of particles or their angular velocity.
Definition PixelpartParticleType.h:40
@ ROTATION_VELOCITY
Definition PixelpartParticleType.h:49
@ ROTATION_ANGLE
Definition PixelpartParticleType.h:44
bool is_visible() const
Whether particles of this type are visible.
Definition PixelpartParticleType.cpp:96
Ref< PixelpartAnimatedPropertyFloat3 > get_size() const
Size of each particle over its lifetime as a fraction of its initial size.
Definition PixelpartParticleType.cpp:200
int get_parent_id() const
ID of the parent particle type.
Definition PixelpartParticleType.cpp:21
AlignmentMode get_alignment_mode() const
Direction to which particles are aligned.
Definition PixelpartParticleType.cpp:59
Ref< PixelpartAnimatedPropertyFloat > get_initial_opacity() const
Opacity of each particle when created.
Definition PixelpartParticleType.cpp:177
RotationMode rotation_mode
Whether the rotation property represents the exact rotation of particles or their angular velocity.
Definition PixelpartParticleType.h:99
RotationMode get_rotation_mode() const
Whether the rotation property represents the exact rotation of particles or their angular velocity.
Definition PixelpartParticleType.cpp:46
Ref< PixelpartAnimatedPropertyFloat > get_weight() const
How strongly each particle is affected by force fields over its lifetime.
Definition PixelpartParticleType.cpp:277
String get_name() const
Name of the particle type.
Definition PixelpartParticleType.cpp:24
bool position_relative
Whether the position of particles is tied to the position of the emitter.
Definition PixelpartParticleType.h:89
Ref< PixelpartAnimatedPropertyFloat > get_lifespan() const
How long particles exist after being spawned by emitters.
Definition PixelpartParticleType.cpp:122
Ref< PixelpartStaticPropertyFloat3 > get_rotation_variance() const
How much the rotation varies between particles, in degrees.
Definition PixelpartParticleType.cpp:355
Ref< PixelpartStaticPropertyFloat3 > get_angular_velocity_variance() const
How much the angular velocity varies between particles, in degrees/second.
Definition PixelpartParticleType.cpp:366
bool visible
Whether particles of this type are visible.
Definition PixelpartParticleType.h:116
AlignmentMode alignment_mode
Direction to which particles are aligned.
Definition PixelpartParticleType.h:111
Ref< PixelpartAnimatedPropertyFloat3 > get_initial_rotation() const
Rotation of each particle when created, in degrees.
Definition PixelpartParticleType.cpp:144
Ref< PixelpartAnimatedPropertyFloat3 > get_rotation_by_speed() const
How much particles rotate based on their velocity, in degrees.
Definition PixelpartParticleType.cpp:244
Ref< PixelpartAnimatedPropertyFloat > get_radial_acceleration() const
Acceleration of each particle towards the emitter over its lifetime.
Definition PixelpartParticleType.cpp:266
Ref< PixelpartAnimatedPropertyFloat > get_initial_size() const
Size of each particle when created.
Definition PixelpartParticleType.cpp:133
AlignmentMode
Direction to which particles are aligned.
Definition PixelpartParticleType.h:55
@ ALIGNMENT_EMITTER
Definition PixelpartParticleType.h:79
@ ALIGNMENT_EMISSION
Definition PixelpartParticleType.h:74
@ ALIGNMENT_CAMERA
Definition PixelpartParticleType.h:64
@ ALIGNMENT_MOTION
Definition PixelpartParticleType.h:69
@ ALIGNMENT_NONE
Definition PixelpartParticleType.h:59
Ref< PixelpartAnimatedPropertyFloat3 > get_rotation() const
How particles rotate over time from their initial rotation, in degrees.
Definition PixelpartParticleType.cpp:233
Ref< PixelpartAnimatedPropertyFloat > get_opacity() const
Opacity of each particle over its lifetime as a fraction of its initial opacity.
Definition PixelpartParticleType.cpp:321
Ref< PixelpartAnimatedPropertyFloat4 > get_color() const
Color of each particle over its lifetime.
Definition PixelpartParticleType.cpp:310
Ref< PixelpartStaticPropertyFloat > get_opacity_variance() const
How much the opacity varies between particles.
Definition PixelpartParticleType.cpp:399
Ref< PixelpartAnimatedPropertyFloat3 > get_stretch() const
How much particles are stretched based on their speed.
Definition PixelpartParticleType.cpp:211
Ref< PixelpartStaticPropertyFloat > get_motion_path_force() const
How much particles are influenced by the motion path.
Definition PixelpartParticleType.cpp:77