/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/EnginePlugins/ParticlePlugin/Finalizer/ParticleFinalizer_Age.h
56 строк
2 KB
Jan Krassnigg
Various small improvements (particles, curves) (#1739)
11 дек 2025, 09:27
Не верифицирован
11 дек 2025, 09:27
1f50f82
Код
Авторство
О чём код?
#pragma once #include <Foundation/Types/VarianceTypes.h> #include <ParticlePlugin/Finalizer/ParticleFinalizer.h> class ezPhysicsWorldModuleInterface; /// Factory for age finalizers. class EZ_PARTICLEPLUGIN_DLL ezParticleFinalizerFactory_Age final : public ezParticleFinalizerFactory { EZ_ADD_DYNAMIC_REFLECTION(ezParticleFinalizerFactory_Age, ezParticleFinalizerFactory); public: ezParticleFinalizerFactory_Age(); virtual const ezRTTI* GetFinalizerType() const override; virtual void CopyFinalizerProperties(ezParticleFinalizer* pObject, bool bFirstTime) const override; ezVarianceTypeTime m_LifeTime; ezString m_sOnDeathEvent; ezString m_sLifeScaleParameter; }; /// Updates particle age and removes particles that have exceeded their lifetime. /// /// Each frame, the remaining lifetime is decreased by the time delta. When a particle's /// lifetime reaches zero, it is removed from the system. If an on-death event is configured, /// the event is triggered at the particle's position with its velocity as the direction. /// The lifetime is initialized with optional variance and can be scaled by an effect parameter. class EZ_PARTICLEPLUGIN_DLL ezParticleFinalizer_Age final : public ezParticleFinalizer { EZ_ADD_DYNAMIC_REFLECTION(ezParticleFinalizer_Age, ezParticleFinalizer); public: ezParticleFinalizer_Age(); ~ezParticleFinalizer_Age(); virtual void CreateRequiredStreams() override; ezVarianceTypeTime m_LifeTime; ezTempHashedString m_sOnDeathEvent; ezTempHashedString m_sLifeScaleParameter; protected: friend class ezParticleFinalizerFactory_Age; virtual void InitializeElements(ezUInt64 uiStartIndex, ezUInt64 uiNumElements) override; virtual void Process(ezUInt64 uiNumElements) override; void OnParticleDeath(const ezStreamGroupElementRemovedEvent& e); bool m_bHasOnDeathEventHandler = false; ezProcessingStream* m_pStreamLifeTime = nullptr; ezProcessingStream* m_pStreamPosition = nullptr; ezProcessingStream* m_pStreamVelocity = nullptr; };