ported particle sub-emission to 2D

This commit is contained in:
freeglebarr
2022-01-24 17:28:59 -03:00
parent 2fbc7de4a0
commit 6f88294528
4 changed files with 109 additions and 0 deletions

View File

@ -79,6 +79,8 @@ private:
RID mesh;
void _attach_sub_emitter();
protected:
static void _bind_methods();
virtual void _validate_property(PropertyInfo &property) const override;
@ -139,6 +141,19 @@ public:
TypedArray<String> get_configuration_warnings() const override;
void set_sub_emitter(const NodePath &p_path);
NodePath get_sub_emitter() const;
enum EmitFlags {
EMIT_FLAG_POSITION = RS::PARTICLES_EMIT_FLAG_POSITION,
EMIT_FLAG_ROTATION_SCALE = RS::PARTICLES_EMIT_FLAG_ROTATION_SCALE,
EMIT_FLAG_VELOCITY = RS::PARTICLES_EMIT_FLAG_VELOCITY,
EMIT_FLAG_COLOR = RS::PARTICLES_EMIT_FLAG_COLOR,
EMIT_FLAG_CUSTOM = RS::PARTICLES_EMIT_FLAG_CUSTOM
};
void emit_particle(const Transform2D &p_transform, const Vector2 &p_velocity, const Color &p_color, const Color &p_custom, uint32_t p_emit_flags);
void restart();
Rect2 capture_rect() const;
GPUParticles2D();
@ -146,5 +161,6 @@ public:
};
VARIANT_ENUM_CAST(GPUParticles2D::DrawOrder)
VARIANT_ENUM_CAST(GPUParticles2D::EmitFlags)
#endif // PARTICLES_2D_H