Pixelpart 1.8.2
Godot Plugin
Loading...
Searching...
No Matches
PixelpartParticleEmitter.h
1#ifndef PIXELPART_PARTICLE_EMITTER_H
2#define PIXELPART_PARTICLE_EMITTER_H
3
4#include "PixelpartNode.h"
5#include "../property/PixelpartAnimatedPropertyFloat.h"
6#include "../property/PixelpartAnimatedPropertyFloat3.h"
7#include <pixelpart-runtime/effect/ParticleEmitter.h>
8#include <vector>
9
10namespace godot {
17class PixelpartParticleEmitter : public PixelpartNode {
18 GDCLASS(PixelpartParticleEmitter, PixelpartNode)
19
20public:
21 PixelpartParticleEmitter();
22 virtual ~PixelpartParticleEmitter();
23
24#ifdef DOXYGEN
28 int shape;
29
34
39
45
53 #endif
54
55 virtual void init(pixelpart::Node* internalNode, pixelpart::EffectEngine* effectEnginePtr) override;
56
62 void set_shape(int type);
63
69 int get_shape() const;
70
78 void add_shape_point(Vector3 point);
79
87 void remove_shape_point(int index);
88
97 void set_shape_point(int index, Vector3 point);
98
105 Vector3 get_shape_point(int index) const;
106
114 int get_shape_point_count() const;
115
124 void set_distribution(int mode);
125
134 int get_distribution() const;
135
141 void set_grid_order(int mode);
142
148 int get_grid_order() const;
149
159 void set_grid_size(int x, int y, int z);
160
168 int get_grid_size_x() const;
169
177 int get_grid_size_y() const;
178
186 int get_grid_size_z() const;
187
196 void set_emission_mode(int mode);
197
206 int get_emission_mode() const;
207
216 void set_direction_mode(int mode);
217
226 int get_direction_mode() const;
227
235 Ref<PixelpartAnimatedPropertyFloat3> get_direction() const;
236
244 Ref<PixelpartAnimatedPropertyFloat> get_spread() const;
245
246protected:
247 static void _bind_methods();
248
249private:
250 void set_shape_points(const std::vector<pixelpart::float3_t>& points);
251 std::vector<pixelpart::float3_t> get_shape_points() const;
252
253 pixelpart::ParticleEmitter* particleEmitter = nullptr;
254};
255}
256
257#endif
int get_shape() const
Return shape of the emitter area.
Definition PixelpartParticleEmitter.cpp:27
int get_emission_mode() const
Return the emission mode.
Definition PixelpartParticleEmitter.cpp:135
int direction_mode
Mode to control initial particle direction.
Definition PixelpartParticleEmitter.h:52
void set_shape(int type)
Set shape of the emitter area.
Definition PixelpartParticleEmitter.cpp:20
Ref< PixelpartAnimatedPropertyFloat3 > get_direction() const
Direction in which particles move when spawned, in degrees.
Definition PixelpartParticleEmitter.cpp:157
void set_shape_point(int index, Vector3 point)
Change the location of the point at the given index in the emitter shape.
Definition PixelpartParticleEmitter.cpp:57
int get_grid_size_z() const
Return the number of grid cells in Z direction.
Definition PixelpartParticleEmitter.cpp:125
int get_grid_order() const
Get the grid order of grid distribution modes.
Definition PixelpartParticleEmitter.cpp:102
int get_grid_size_x() const
Return the number of grid cells in X direction.
Definition PixelpartParticleEmitter.cpp:119
void set_distribution(int mode)
Set where particles are spawned inside the emitter area.
Definition PixelpartParticleEmitter.cpp:81
void add_shape_point(Vector3 point)
Add a new point to the emitter shape.
Definition PixelpartParticleEmitter.cpp:34
int grid_order
Grid order of grid distribution modes.
Definition PixelpartParticleEmitter.h:38
void remove_shape_point(int index)
Remove the point at the given index from the emitter shape.
Definition PixelpartParticleEmitter.cpp:44
int get_distribution() const
Return where particles are spawned inside the emitter area.
Definition PixelpartParticleEmitter.cpp:88
int emission_mode
Emission mode to control when particles are created during the lifetime of the emitter.
Definition PixelpartParticleEmitter.h:44
Vector3 get_shape_point(int index) const
Return the location of the point at the given index in the emitter shape.
Definition PixelpartParticleEmitter.cpp:70
int get_direction_mode() const
Get the direction mode.
Definition PixelpartParticleEmitter.cpp:149
int distribution
Where particles are spawned inside the emitter area.
Definition PixelpartParticleEmitter.h:33
int shape
Shape of the emitter area.
Definition PixelpartParticleEmitter.h:28
int get_shape_point_count() const
Return the number of points in the emitter shape.
Definition PixelpartParticleEmitter.cpp:77
Ref< PixelpartAnimatedPropertyFloat > get_spread() const
How much the direction varies.
Definition PixelpartParticleEmitter.cpp:168
void set_direction_mode(int mode)
Set the direction mode.
Definition PixelpartParticleEmitter.cpp:142
int get_grid_size_y() const
Return the number of grid cells in Y direction.
Definition PixelpartParticleEmitter.cpp:122
void set_grid_size(int x, int y, int z)
Set the number of grid cells.
Definition PixelpartParticleEmitter.cpp:109
void set_emission_mode(int mode)
Set the emission mode.
Definition PixelpartParticleEmitter.cpp:128
void set_grid_order(int mode)
Set the grid order of grid distribution modes.
Definition PixelpartParticleEmitter.cpp:95