1
0
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:
QbieShay
2024-05-18 18:13:57 +02:00
committed by Qbieshay
parent bdf625bd54
commit e9eb0b6082
27 changed files with 653 additions and 108 deletions

View File

@@ -78,6 +78,8 @@ private:
bool interpolate = true;
NodePath sub_emitter;
real_t collision_base_size = 0.01;
uint32_t seed = 0;
bool use_fixed_seed = false;
bool trail_enabled = false;
double trail_lifetime = 0.3;
@@ -107,6 +109,11 @@ protected:
void _notification(int p_what);
void _validate_property(PropertyInfo &p_property) const;
#ifndef DISABLE_DEPRECATED
void _restart_bind_compat_92089();
static void _bind_compatibility_methods();
#endif
public:
AABB get_aabb() const override;
@@ -175,7 +182,14 @@ public:
void set_transform_align(TransformAlign p_align);
TransformAlign get_transform_align() const;
void restart();
void restart(bool p_keep_seed = false);
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;
void request_particles_process(real_t p_requested_process_time);
enum EmitFlags {
EMIT_FLAG_POSITION = RS::PARTICLES_EMIT_FLAG_POSITION,