| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#pragma once |
| 32 |
|
| 33 |
#include "editor/scene/particles_editor_plugin.h" |
| 34 |
|
| 35 |
class Particles3DEditorPlugin : public ParticlesEditorPlugin { |
| 36 |
GDCLASS(Particles3DEditorPlugin, ParticlesEditorPlugin); |
| 37 |
|
| 38 |
enum { |
| 39 |
MENU_OPTION_GENERATE_AABB = 300, |
| 40 |
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE, |
| 41 |
}; |
| 42 |
|
| 43 |
ConfirmationDialog *generate_aabb = nullptr; |
| 44 |
SpinBox *generate_seconds = nullptr; |
| 45 |
|
| 46 |
SceneTreeDialog *emission_tree_dialog = nullptr; |
| 47 |
ConfirmationDialog *emission_dialog = nullptr; |
| 48 |
SpinBox *emission_amount = nullptr; |
| 49 |
OptionButton *emission_fill = nullptr; |
| 50 |
|
| 51 |
void _generate_aabb(); |
| 52 |
void _node_selected(const NodePath &p_path); |
| 53 |
|
| 54 |
protected: |
| 55 |
Vector<Face3> geometry; |
| 56 |
|
| 57 |
virtual void _menu_callback(int p_idx) override; |
| 58 |
virtual void _add_menu_options(PopupMenu *p_menu) override; |
| 59 |
|
| 60 |
bool _generate(Vector<Vector3> &r_points, Vector<Vector3> &r_normals); |
| 61 |
virtual bool _can_generate_points() const = 0; |
| 62 |
virtual void _generate_emission_points() = 0; |
| 63 |
|
| 64 |
public: |
| 65 |
Particles3DEditorPlugin(); |
| 66 |
}; |
| 67 |
|
| 68 |
class GPUParticles3DEditorPlugin : public Particles3DEditorPlugin { |
| 69 |
GDCLASS(GPUParticles3DEditorPlugin, Particles3DEditorPlugin); |
| 70 |
|
| 71 |
protected: |
| 72 |
Node *_convert_particles() override; |
| 73 |
|
| 74 |
bool _can_generate_points() const override; |
| 75 |
void _generate_emission_points() override; |
| 76 |
|
| 77 |
public: |
| 78 |
GPUParticles3DEditorPlugin(); |
| 79 |
}; |
| 80 |
|
| 81 |
class CPUParticles3DEditorPlugin : public Particles3DEditorPlugin { |
| 82 |
GDCLASS(CPUParticles3DEditorPlugin, Particles3DEditorPlugin); |
| 83 |
|
| 84 |
protected: |
| 85 |
Node *_convert_particles() override; |
| 86 |
|
| 87 |
bool _can_generate_points() const override { return true; } |
| 88 |
void _generate_emission_points() override; |
| 89 |
|
| 90 |
public: |
| 91 |
CPUParticles3DEditorPlugin(); |
| 92 |
}; |