You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Implemented tools around particles seed randomization.
The purpose of this code is to expose the necessary functions for users and engine devs to develop tooling for properly timing and seeking inside particles. Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro> Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com> Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
This commit is contained in:
@@ -66,6 +66,8 @@ private:
|
||||
float interp_to_end_factor = 0;
|
||||
Vector3 previous_velocity;
|
||||
Vector2 previous_position;
|
||||
uint32_t seed = 0;
|
||||
bool use_fixed_seed = false;
|
||||
#ifdef TOOLS_ENABLED
|
||||
bool show_visibility_rect = false;
|
||||
#endif
|
||||
@@ -101,6 +103,11 @@ protected:
|
||||
void _notification(int p_what);
|
||||
void _update_collision_size();
|
||||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
void _restart_bind_compat_92089();
|
||||
static void _bind_compatibility_methods();
|
||||
#endif
|
||||
|
||||
public:
|
||||
void set_emitting(bool p_emitting);
|
||||
void set_amount(int p_amount);
|
||||
@@ -119,6 +126,7 @@ public:
|
||||
void set_trail_sections(int p_sections);
|
||||
void set_trail_section_subdivisions(int p_subdivisions);
|
||||
void set_interp_to_end(float p_interp);
|
||||
void request_particles_process(real_t p_requested_process_time);
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
void set_show_visibility_rect(bool p_show_visibility_rect);
|
||||
@@ -166,6 +174,12 @@ public:
|
||||
void set_sub_emitter(const NodePath &p_path);
|
||||
NodePath get_sub_emitter() const;
|
||||
|
||||
void set_use_fixed_seed(bool p_use_fixed_seed);
|
||||
bool get_use_fixed_seed() const;
|
||||
|
||||
void set_seed(uint32_t p_seed);
|
||||
uint32_t get_seed() const;
|
||||
|
||||
enum EmitFlags {
|
||||
EMIT_FLAG_POSITION = RS::PARTICLES_EMIT_FLAG_POSITION,
|
||||
EMIT_FLAG_ROTATION_SCALE = RS::PARTICLES_EMIT_FLAG_ROTATION_SCALE,
|
||||
@@ -176,7 +190,7 @@ public:
|
||||
|
||||
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();
|
||||
void restart(bool p_keep_seed = false);
|
||||
Rect2 capture_rect() const;
|
||||
void convert_from_particles(Node *p_particles);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user