From 573d6dd1e6c732e3e9f879992811c39018d4459a Mon Sep 17 00:00:00 2001 From: Jerome Humbert Date: Sat, 22 Jun 2024 21:17:11 +0200 Subject: [PATCH] Expose `is_alive` particle flag (#347) Expose the `is_alive` flag of particles in the update pass, to enable an expression to query the current alive state of the particle. --- CHANGELOG.md | 12 ++++++++ src/graph/expr.rs | 71 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df7b6927..ff79ca75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- Added `BuiltInOperator::IsAlive` exposing the current state of the `is_alive` particle flag, + which represents whether a particle is still alive or will be deallocated at the end of the update pass. + +### Fixed + +- Prevented an error from being emitted when a GPU pipeline is still being created. (#341) +- Fixed a panic when a particle effect as an invalid asset handle. (#343) + ## [0.11.0] 2024-05-29 ### Added diff --git a/src/graph/expr.rs b/src/graph/expr.rs index 752cc8c1..d961beb9 100644 --- a/src/graph/expr.rs +++ b/src/graph/expr.rs @@ -1244,20 +1244,35 @@ impl CastExpr { #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Reflect, Serialize, Deserialize)] pub enum BuiltInOperator { /// Current effect system simulation time since startup, in seconds. + /// /// This is based on the /// [`Time`](crate::time::EffectSimulation) clock. + /// + /// Type: `f32` Time, /// Delta time, in seconds, since last effect system update. + /// + /// Type: `f32` DeltaTime, /// Current virtual time since startup, in seconds. + /// /// This is based on the [`Time`](bevy::time::Virtual) clock. + /// + /// Type: `f32` VirtualTime, /// Virtual delta time, in seconds, since last effect system update. + /// + /// Type: `f32` VirtualDeltaTime, /// Current real time since startup, in seconds. + /// /// This is based on the [`Time