/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/EnginePlugins/ParticlePlugin/Behavior/ParticleBehavior_BoundsSphere.h
57 строк
2 KB
Jan Krassnigg
Added Expression Particle Behavior (#1884)
29 мар 2026, 23:32
Не верифицирован
29 мар 2026, 23:32
071fa9d
Код
Авторство
О чём код?
#pragma once #include <ParticlePlugin/Behavior/ParticleBehavior.h> /// What happens when a particle is outside the sphere struct EZ_PARTICLEPLUGIN_DLL ezParticleSphereOutOfBoundsMode { using StorageType = ezUInt8; enum Enum { Kill, ///< Remove particle immediately Constrain, ///< Clamp particle to sphere surface Default = Kill }; }; EZ_DECLARE_REFLECTABLE_TYPE(EZ_PARTICLEPLUGIN_DLL, ezParticleSphereOutOfBoundsMode); /// Constrains particles to a spherical volume. /// /// Particles outside the radius are either killed or pushed back to the sphere surface. /// The center is relative to the effect's world position. class EZ_PARTICLEPLUGIN_DLL ezParticleBehaviorFactory_BoundsSphere final : public ezParticleBehaviorFactory { EZ_ADD_DYNAMIC_REFLECTION(ezParticleBehaviorFactory_BoundsSphere, ezParticleBehaviorFactory); public: ezParticleBehaviorFactory_BoundsSphere(); virtual const ezRTTI* GetBehaviorType() const override; virtual void CopyBehaviorProperties(ezParticleBehavior* pObject, bool bFirstTime) const override; virtual void Save(ezStreamWriter& inout_stream) const override; virtual void Load(ezStreamReader& inout_stream, const ezParticleEffectDescriptor& ownerEffectDescriptor, const ezParticleSystemDescriptor& ownerSystemDescriptor) override; ezVec3 m_vCenterOffset = ezVec3::MakeZero(); float m_fRadius = 3.0f; ezEnum<ezParticleSphereOutOfBoundsMode> m_OutOfBoundsMode; }; class EZ_PARTICLEPLUGIN_DLL ezParticleBehavior_BoundsSphere final : public ezParticleBehavior { EZ_ADD_DYNAMIC_REFLECTION(ezParticleBehavior_BoundsSphere, ezParticleBehavior); public: ezVec3 m_vCenterOffset = ezVec3::MakeZero(); float m_fRadius = 3.0f; ezEnum<ezParticleSphereOutOfBoundsMode> m_OutOfBoundsMode; protected: virtual void CreateRequiredStreams() override; virtual void Process(ezUInt64 uiNumElements) override; ezProcessingStream* m_pStreamPosition = nullptr; };