Pixelpart 1.10.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
66
96
98 virtual ~PixelpartParticleType();
99
100#ifdef DOXYGEN
105
115
127
132
138 int layer;
139#endif
140
141 void init(pixelpart::ParticleType* particleTypePtr, pixelpart::EffectEngine* effectEnginePtr);
142
148 int get_id() const;
149
155 int get_parent_id() const;
156
162 String get_name() const;
163
170
177
185 void set_position_relative(bool mode);
186
194 bool is_position_relative() const;
195
203
211
218
225
231 Ref<PixelpartStaticPropertyFloat3> get_pivot() const;
232
240 Ref<PixelpartStaticPropertyFloat> get_motion_path_force() const;
241
247 void set_visible(bool mode);
248
254 bool is_visible() const;
255
263 void set_layer(int layer);
264
270 int get_layer() const;
271
277 Ref<PixelpartAnimatedPropertyFloat> get_count() const;
278
284 Ref<PixelpartAnimatedPropertyFloat> get_lifespan() const;
285
291 Ref<PixelpartAnimatedPropertyFloat> get_initial_size() const;
292
300 Ref<PixelpartAnimatedPropertyFloat3> get_initial_rotation() const;
301
307 Ref<PixelpartAnimatedPropertyFloat> get_initial_velocity() const;
308
314 Ref<PixelpartAnimatedPropertyFloat> get_inherited_velocity() const;
315
321 Ref<PixelpartAnimatedPropertyFloat> get_initial_opacity() const;
322
328 Ref<PixelpartAnimatedPropertyFloat3> get_position() const;
329
335 Ref<PixelpartAnimatedPropertyFloat3> get_size() const;
336
342 Ref<PixelpartAnimatedPropertyFloat3> get_stretch() const;
343
349 Ref<PixelpartAnimatedPropertyFloat> get_physical_size() const;
350
358 Ref<PixelpartAnimatedPropertyFloat3> get_rotation() const;
359
365 Ref<PixelpartAnimatedPropertyFloat3> get_rotation_by_speed() const;
366
372 Ref<PixelpartAnimatedPropertyFloat> get_acceleration() const;
373
379 Ref<PixelpartAnimatedPropertyFloat> get_radial_acceleration() const;
380
386 Ref<PixelpartAnimatedPropertyFloat> get_weight() const;
387
393 Ref<PixelpartAnimatedPropertyFloat> get_bounce() const;
394
400 Ref<PixelpartAnimatedPropertyFloat> get_friction() const;
401
407 Ref<PixelpartAnimatedPropertyFloat4> get_color() const;
408
414 Ref<PixelpartAnimatedPropertyFloat> get_opacity() const;
415
421 Ref<PixelpartStaticPropertyFloat> get_lifespan_variance() const;
422
428 Ref<PixelpartStaticPropertyFloat> get_size_variance() const;
429
435 Ref<PixelpartStaticPropertyFloat3> get_rotation_variance() const;
436
442 Ref<PixelpartStaticPropertyFloat3> get_angular_velocity_variance() const;
443
449 Ref<PixelpartStaticPropertyFloat> get_velocity_variance() const;
450
456 Ref<PixelpartStaticPropertyFloat4> get_color_variance() const;
457
463 Ref<PixelpartStaticPropertyFloat> get_opacity_variance() const;
464
465protected:
466 static void _bind_methods();
467
468private:
469 pixelpart::ParticleType* particleType = nullptr;
470 pixelpart::EffectEngine* effectEngine = nullptr;
471};
472}
473
474VARIANT_ENUM_CAST(PixelpartParticleType::SimulationSpace);
475VARIANT_ENUM_CAST(PixelpartParticleType::RotationMode);
476VARIANT_ENUM_CAST(PixelpartParticleType::AlignmentMode);
477
478#endif
Defines the appearance and behavior of particles.
Definition PixelpartParticleType.h:33
SimulationSpace simulation_space
Whether particles are simulated in global or local coordinates.
Definition PixelpartParticleType.h:104
Ref< PixelpartStaticPropertyFloat > get_size_variance() const
How much the size varies between particles.
Definition PixelpartParticleType.cpp:353
bool is_position_relative() const
Whether the position of particles is tied to the position of the emitter.
Definition PixelpartParticleType.cpp:44
void set_position_relative(bool mode)
Set whether the position of particles is tied to the position of the emitter.
Definition PixelpartParticleType.cpp:41
Ref< PixelpartAnimatedPropertyFloat > get_physical_size() const
Relative size of each particle for motion and collision calculations over its lifetime.
Definition PixelpartParticleType.cpp:231
Ref< PixelpartAnimatedPropertyFloat > get_acceleration() const
Linear acceleration applied to each particle over its lifetime.
Definition PixelpartParticleType.cpp:264
Ref< PixelpartAnimatedPropertyFloat > get_friction() const
How resistant each particle is to sliding down colliders over its lifetime.
Definition PixelpartParticleType.cpp:308
void set_rotation_mode(RotationMode mode)
Set whether the rotation property represents the exact rotation of particles or their angular velocit...
Definition PixelpartParticleType.cpp:48
void set_alignment_mode(AlignmentMode mode)
Set direction to which particles are aligned.
Definition PixelpartParticleType.cpp:61
int get_id() const
ID of the particle type.
Definition PixelpartParticleType.cpp:18
SimulationSpace get_simulation_space() const
Whether particles are simulated in global or local coordinates.
Definition PixelpartParticleType.cpp:35
Ref< PixelpartStaticPropertyFloat > get_velocity_variance() const
How much the speed varies between particles.
Definition PixelpartParticleType.cpp:386
Ref< PixelpartAnimatedPropertyFloat > get_inherited_velocity() const
How much speed particles inherit from the parent particle or emitter.
Definition PixelpartParticleType.cpp:175
Ref< PixelpartStaticPropertyFloat > get_lifespan_variance() const
How much the lifespan varies between particles.
Definition PixelpartParticleType.cpp:342
void set_layer(int layer)
Set layer particles are drawn on.
Definition PixelpartParticleType.cpp:109
void set_simulation_space(SimulationSpace space)
Set whether particles are simulated in global or local coordinates.
Definition PixelpartParticleType.cpp:28
Ref< PixelpartStaticPropertyFloat4 > get_color_variance() const
How much the color varies between particles.
Definition PixelpartParticleType.cpp:397
Ref< PixelpartAnimatedPropertyFloat3 > get_position() const
Motion path for particles.
Definition PixelpartParticleType.cpp:198
int layer
Layer particles are drawn on.
Definition PixelpartParticleType.h:138
Ref< PixelpartAnimatedPropertyFloat > get_bounce() const
How much each particle bounces back from colliders over its lifetime.
Definition PixelpartParticleType.cpp:297
void set_visible(bool mode)
Set whether particles of this type are visible.
Definition PixelpartParticleType.cpp:98
Ref< PixelpartStaticPropertyFloat3 > get_pivot() const
Center of rotation relative to the particle’s center.
Definition PixelpartParticleType.cpp:74
int get_layer() const
Layer particles are drawn on.
Definition PixelpartParticleType.cpp:116
Ref< PixelpartAnimatedPropertyFloat > get_count() const
How many particles of this type are spawned by emitters.
Definition PixelpartParticleType.cpp:120
Ref< PixelpartAnimatedPropertyFloat > get_initial_velocity() const
How fast each particle is initially after being spawned by the emitter.
Definition PixelpartParticleType.cpp:164
RotationMode
Whether the rotation property represents the exact rotation of particles or their angular velocity.
Definition PixelpartParticleType.h:55
@ ROTATION_VELOCITY
Definition PixelpartParticleType.h:64
@ ROTATION_ANGLE
Definition PixelpartParticleType.h:59
bool is_visible() const
Whether particles of this type are visible.
Definition PixelpartParticleType.cpp:105
Ref< PixelpartAnimatedPropertyFloat3 > get_size() const
Size of each particle over its lifetime as a fraction of its initial size.
Definition PixelpartParticleType.cpp:209
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:68
Ref< PixelpartAnimatedPropertyFloat > get_initial_opacity() const
Opacity of each particle when created.
Definition PixelpartParticleType.cpp:186
RotationMode rotation_mode
Whether the rotation property represents the exact rotation of particles or their angular velocity.
Definition PixelpartParticleType.h:114
RotationMode get_rotation_mode() const
Whether the rotation property represents the exact rotation of particles or their angular velocity.
Definition PixelpartParticleType.cpp:55
Ref< PixelpartAnimatedPropertyFloat > get_weight() const
How strongly each particle is affected by force fields over its lifetime.
Definition PixelpartParticleType.cpp:286
String get_name() const
Name of the particle type.
Definition PixelpartParticleType.cpp:24
Ref< PixelpartAnimatedPropertyFloat > get_lifespan() const
How long particles exist after being spawned by emitters.
Definition PixelpartParticleType.cpp:131
Ref< PixelpartStaticPropertyFloat3 > get_rotation_variance() const
How much the rotation varies between particles, in degrees.
Definition PixelpartParticleType.cpp:364
Ref< PixelpartStaticPropertyFloat3 > get_angular_velocity_variance() const
How much the angular velocity varies between particles, in degrees/second.
Definition PixelpartParticleType.cpp:375
bool visible
Whether particles of this type are visible.
Definition PixelpartParticleType.h:131
SimulationSpace
Whether particles are simulated in global or local coordinates.
Definition PixelpartParticleType.h:40
@ SIMULATION_SPACE_LOCAL
Definition PixelpartParticleType.h:49
@ SIMULATION_SPACE_GLOBAL
Definition PixelpartParticleType.h:44
AlignmentMode alignment_mode
Direction to which particles are aligned.
Definition PixelpartParticleType.h:126
Ref< PixelpartAnimatedPropertyFloat3 > get_initial_rotation() const
Rotation of each particle when created, in degrees.
Definition PixelpartParticleType.cpp:153
Ref< PixelpartAnimatedPropertyFloat3 > get_rotation_by_speed() const
How much particles rotate based on their velocity, in degrees.
Definition PixelpartParticleType.cpp:253
Ref< PixelpartAnimatedPropertyFloat > get_radial_acceleration() const
Acceleration of each particle towards the emitter over its lifetime.
Definition PixelpartParticleType.cpp:275
Ref< PixelpartAnimatedPropertyFloat > get_initial_size() const
Size of each particle when created.
Definition PixelpartParticleType.cpp:142
AlignmentMode
Direction to which particles are aligned.
Definition PixelpartParticleType.h:70
@ ALIGNMENT_EMITTER
Definition PixelpartParticleType.h:94
@ ALIGNMENT_EMISSION
Definition PixelpartParticleType.h:89
@ ALIGNMENT_CAMERA
Definition PixelpartParticleType.h:79
@ ALIGNMENT_MOTION
Definition PixelpartParticleType.h:84
@ ALIGNMENT_NONE
Definition PixelpartParticleType.h:74
Ref< PixelpartAnimatedPropertyFloat3 > get_rotation() const
How particles rotate over time from their initial rotation, in degrees.
Definition PixelpartParticleType.cpp:242
Ref< PixelpartAnimatedPropertyFloat > get_opacity() const
Opacity of each particle over its lifetime as a fraction of its initial opacity.
Definition PixelpartParticleType.cpp:330
Ref< PixelpartAnimatedPropertyFloat4 > get_color() const
Color of each particle over its lifetime.
Definition PixelpartParticleType.cpp:319
Ref< PixelpartStaticPropertyFloat > get_opacity_variance() const
How much the opacity varies between particles.
Definition PixelpartParticleType.cpp:408
Ref< PixelpartAnimatedPropertyFloat3 > get_stretch() const
How much particles are stretched based on their speed.
Definition PixelpartParticleType.cpp:220
Ref< PixelpartStaticPropertyFloat > get_motion_path_force() const
How much particles are influenced by the motion path.
Definition PixelpartParticleType.cpp:86