diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2022-11-06 21:57:08 +0100 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2022-11-07 13:37:40 +0100 |
commit | ab7a807f2bfffa270ad0438eb646139db860537b (patch) | |
tree | d37da6b3809cdc2444f243383fb824d60f4bd23e /servers/rendering/renderer_rd/storage_rd | |
parent | f814e15c7f60a685e8b3623fc93231c18ccd3627 (diff) |
Rename GPUParticles2D/3D's `trail_length_secs` to `trail_lifetime`
The property already has a "seconds" suffix in the inspector.
The "lifetime" term makes it more obvious that the property is
specified as time, not a distance in units.
The property hint now allows manually entering values greater than
10 seconds.
The internal rendering value's default now matches the particles
nodes' default.
Diffstat (limited to 'servers/rendering/renderer_rd/storage_rd')
-rw-r--r-- | servers/rendering/renderer_rd/storage_rd/particles_storage.cpp | 4 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/storage_rd/particles_storage.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp index 7fa0bb64a3..854976692e 100644 --- a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp @@ -425,7 +425,7 @@ void ParticlesStorage::particles_set_trails(RID p_particles, bool p_enable, doub p_length = MIN(10.0, p_length); particles->trails_enabled = p_enable; - particles->trail_length = p_length; + particles->trail_lifetime = p_length; _particles_free_data(particles); @@ -1351,7 +1351,7 @@ void ParticlesStorage::update_particles() { int history_size = 1; int trail_steps = 1; if (particles->trails_enabled && particles->trail_bind_poses.size() > 1) { - history_size = MAX(1, int(particles->trail_length * fixed_fps)); + history_size = MAX(1, int(particles->trail_lifetime * fixed_fps)); trail_steps = particles->trail_bind_poses.size(); } diff --git a/servers/rendering/renderer_rd/storage_rd/particles_storage.h b/servers/rendering/renderer_rd/storage_rd/particles_storage.h index 017844626f..6478e2b5dc 100644 --- a/servers/rendering/renderer_rd/storage_rd/particles_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/particles_storage.h @@ -232,7 +232,7 @@ private: Dependency dependency; - double trail_length = 1.0; + double trail_lifetime = 0.3; bool trails_enabled = false; LocalVector<ParticlesFrameParams> frame_history; LocalVector<ParticlesFrameParams> trail_params; |