3#include <Foundation/Math/Transform.h>
4#include <Foundation/SimdMath/SimdVec4i.h>
5#include <Foundation/Threading/TaskSystem.h>
6#include <Foundation/Types/SharedPtr.h>
7#include <ParticlePlugin/System/ParticleSystemInstance.h>
19 virtual void Execute()
override;
40 void SetEmitterEnabled(
bool bEnable);
41 bool GetEmitterEnabled()
const {
return m_bEmitterEnabled; }
43 bool HasActiveParticles()
const;
45 void ClearParticleSystems();
46 void ClearEventReactions();
48 bool IsContinuous()
const;
50 plWorld* GetWorld()
const {
return m_pWorld; }
59 plRandom& GetRNG() {
return m_Random; }
61 plUInt64 GetRandomSeed()
const {
return m_uiRandomSeed; }
63 void RequestWindSamples();
64 void UpdateWindSamples(
plTime diff);
67 plUInt64 GetNumActiveParticles()
const;
76 void SetTransform(
const plTransform& transform,
const plVec3& vParticleStartVelocity);
80 void SetTransformForNextFrame(
const plTransform& transform,
const plVec3& vParticleStartVelocity);
94 void PassTransformToSystems();
100 plVec3 m_vVelocityForNextFrame;
102 struct WindSampleGrid
119 bool Update(
const plTime& diff);
129 bool ShouldBeUpdated()
const;
140 bool StepSimulation(
const plTime& tDiff);
155 void AddSharedInstance(
const void* pSharedInstanceOwner);
156 void RemoveSharedInstance(
const void* pSharedInstanceOwner);
159 bool m_bIsSharedEffect =
false;
167 void SetIsVisible()
const;
172 bool IsVisible()
const;
179 void CombineSystemBoundingVolumes();
182 mutable plTime m_EffectIsVisible;
185 plUInt64 m_uiRandomSeed = 0;
196 float GetFloatParameter(plUInt32 uiIdx)
const {
return m_FloatParameters[uiIdx].m_fValue; }
200 const plColor& GetColorParameter(plUInt32 uiIdx)
const {
return m_ColorParameters[uiIdx].m_Value; }
204 struct FloatParameter
206 PL_DECLARE_POD_TYPE();
207 plUInt64 m_uiNameHash;
211 struct ColorParameter
213 PL_DECLARE_POD_TYPE();
214 plUInt64 m_uiNameHash;
226 void ClearParticleSystem(plUInt32 index);
227 void ProcessEventQueues();
234 bool m_bEmitterEnabled =
true;
235 bool m_bSimulateInLocalSpace =
false;
236 bool m_bIsFinishing =
false;
237 plUInt8 m_uiReviveTimeout = 3;
238 plInt8 m_iMinSimStepsToDo = 0;
239 float m_fApplyInstanceVelocity = 0;
240 plTime m_PreSimulateDuration;
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
plColor represents an RGBA color in linear color space. Values are stored as float,...
Definition Color.h:44
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Definition ParticleEffectController.h:7
A handle to a particle effect.
Definition Declarations.h:39
Definition ParticleEffectInstance.h:25
bool IsSharedEffect() const
Returns true, if this effect is configured to be simulated once per frame, but rendered by multiple i...
Definition ParticleEffectInstance.h:152
bool IsSimulatedInLocalSpace() const
Whether the effect is simulated around the origin and thus not affected by instance position and rota...
Definition ParticleEffectInstance.h:73
plTime GetTotalEffectLifeTime() const
Returns the total (game) time that the effect is alive and has been updated.
Definition ParticleEffectInstance.h:125
bool NeedsToApplyTransform() const
For the renderer to know whether the instance transform has to be applied to each particle position.
Definition ParticleEffectInstance.h:86
const plTransform & GetTransform() const
Returns the transform of the main or shared instance.
Definition ParticleEffectInstance.h:83
Definition ParticleEffectInstance.h:12
virtual void Execute() override
Override this to implement the task's supposed functionality.
Definition ParticleEffectInstance.cpp:851
This world module stores all particle effect data that is active in a given plWorld instance.
Definition ParticleWorldModule.h:24
A random number generator. Currently uses the WELL512 algorithm.
Definition Random.h:9
A Shared ptr manages a shared object and destroys that object when no one references it anymore....
Definition SharedPtr.h:10
A 4-component SIMD vector class.
Definition SimdVec4f.h:8
Definition SmallArray.h:219
Wraps a C-style array, which has a fixed size at compile-time, with a more convenient interface.
Definition StaticArray.h:13
Base class for custom tasks.
Definition Task.h:10
A class to use together with plHashedString for quick comparisons with temporary strings that need no...
Definition HashedString.h:151
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Definition ParticleEvent.h:9
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12
PL_ALWAYS_INLINE static constexpr plTime MakeZero()
Creates an instance of plTime that was initialized with zero.
Definition Time.h:42