Pixelpart 1.8.2
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:
37 PixelpartParticleType();
38 virtual ~PixelpartParticleType();
39
40#ifdef DOXYGEN
45
55
67
71 bool visible;
72
78 int layer;
79#endif
80
81 void init(pixelpart::ParticleType* particleTypePtr, pixelpart::EffectEngine* effectEnginePtr);
82
88 int get_id() const;
89
95 int get_parent_id() const;
96
102 String get_name() const;
103
109 void set_position_relative(bool mode);
110
116 bool is_position_relative() const;
117
124 void set_rotation_mode(int mode);
125
132 int get_rotation_mode() const;
133
139 void set_alignment_mode(int mode);
140
146 int get_alignment_mode() const;
147
153 Ref<PixelpartStaticPropertyFloat3> get_pivot() const;
154
162 Ref<PixelpartStaticPropertyFloat> get_motion_path_force() const;
163
169 void set_visible(bool mode);
170
176 bool is_visible() const;
177
185 void set_layer(int layer);
186
192 int get_layer() const;
193
199 Ref<PixelpartAnimatedPropertyFloat> get_count() const;
200
206 Ref<PixelpartAnimatedPropertyFloat> get_lifespan() const;
207
213 Ref<PixelpartAnimatedPropertyFloat> get_initial_size() const;
214
222 Ref<PixelpartAnimatedPropertyFloat3> get_initial_rotation() const;
223
229 Ref<PixelpartAnimatedPropertyFloat> get_initial_velocity() const;
230
236 Ref<PixelpartAnimatedPropertyFloat> get_inherited_velocity() const;
237
243 Ref<PixelpartAnimatedPropertyFloat> get_initial_opacity() const;
244
250 Ref<PixelpartAnimatedPropertyFloat3> get_position() const;
251
257 Ref<PixelpartAnimatedPropertyFloat3> get_size() const;
258
264 Ref<PixelpartAnimatedPropertyFloat3> get_stretch() const;
265
271 Ref<PixelpartAnimatedPropertyFloat> get_physical_size() const;
272
280 Ref<PixelpartAnimatedPropertyFloat3> get_rotation() const;
281
287 Ref<PixelpartAnimatedPropertyFloat3> get_rotation_by_speed() const;
288
294 Ref<PixelpartAnimatedPropertyFloat> get_acceleration() const;
295
301 Ref<PixelpartAnimatedPropertyFloat> get_radial_acceleration() const;
302
308 Ref<PixelpartAnimatedPropertyFloat> get_weight() const;
309
315 Ref<PixelpartAnimatedPropertyFloat> get_bounce() const;
316
322 Ref<PixelpartAnimatedPropertyFloat> get_friction() const;
323
329 Ref<PixelpartAnimatedPropertyFloat4> get_color() const;
330
336 Ref<PixelpartAnimatedPropertyFloat> get_opacity() const;
337
343 Ref<PixelpartStaticPropertyFloat> get_lifespan_variance() const;
344
350 Ref<PixelpartStaticPropertyFloat> get_size_variance() const;
351
357 Ref<PixelpartStaticPropertyFloat3> get_rotation_variance() const;
358
364 Ref<PixelpartStaticPropertyFloat3> get_angular_velocity_variance() const;
365
371 Ref<PixelpartStaticPropertyFloat> get_velocity_variance() const;
372
378 Ref<PixelpartStaticPropertyFloat4> get_color_variance() const;
379
385 Ref<PixelpartStaticPropertyFloat> get_opacity_variance() const;
386
387protected:
388 static void _bind_methods();
389
390private:
391 pixelpart::ParticleType* particleType = nullptr;
392 pixelpart::EffectEngine* effectEngine = nullptr;
393};
394}
395
396#endif
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
int get_rotation_mode() const
Whether the rotation property represents the exact rotation of particles or their angular velocity.
Definition PixelpartParticleType.cpp:46
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
int get_alignment_mode() const
Direction to which particles are aligned.
Definition PixelpartParticleType.cpp:59
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:78
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
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
Ref< PixelpartAnimatedPropertyFloat > get_initial_opacity() const
Opacity of each particle when created.
Definition PixelpartParticleType.cpp:177
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:44
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:71
void set_alignment_mode(int mode)
Set direction to which particles are aligned.
Definition PixelpartParticleType.cpp:52
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
int rotation_mode
Whether the rotation property represents the exact rotation of particles or their angular velocity.
Definition PixelpartParticleType.h:54
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
int alignment_mode
Direction to which particles are aligned.
Definition PixelpartParticleType.h:66
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
void set_rotation_mode(int mode)
Set whether the rotation property represents the exact rotation of particles or their angular velocit...
Definition PixelpartParticleType.cpp:39
Ref< PixelpartStaticPropertyFloat > get_motion_path_force() const
How much particles are influenced by the motion path.
Definition PixelpartParticleType.cpp:77