Plasma Engine  2.0
Loading...
Searching...
No Matches
ParticleBehavior.h
1#pragma once
2
3#include <Foundation/DataProcessing/Stream/ProcessingStreamProcessor.h>
4#include <Foundation/Reflection/Reflection.h>
5#include <ParticlePlugin/Module/ParticleModule.h>
6#include <ParticlePlugin/ParticlePluginDLL.h>
7
11
13class PL_PARTICLEPLUGIN_DLL plParticleBehaviorFactory : public plReflectedClass
14{
15 PL_ADD_DYNAMIC_REFLECTION(plParticleBehaviorFactory, plReflectedClass);
16
17public:
18 virtual const plRTTI* GetBehaviorType() const = 0;
19 virtual void CopyBehaviorProperties(plParticleBehavior* pObject, bool bFirstTime) const = 0;
20
21 plParticleBehavior* CreateBehavior(plParticleSystemInstance* pOwner) const;
22
23 virtual void Save(plStreamWriter& inout_stream) const = 0;
24 virtual void Load(plStreamReader& inout_stream) = 0;
25
26 virtual void QueryFinalizerDependencies(plSet<const plRTTI*>& inout_finalizerDeps) const {}
27};
28
29class PL_PARTICLEPLUGIN_DLL plParticleBehavior : public plParticleModule
30{
31 PL_ADD_DYNAMIC_REFLECTION(plParticleBehavior, plParticleModule);
32
33 friend class plParticleSystemInstance;
34
35protected:
37 virtual void InitializeElements(plUInt64 uiStartIndex, plUInt64 uiNumElements) override {}
38 virtual void StepParticleSystem(const plTime& tDiff, plUInt32 uiNumNewParticles) { m_TimeDiff = tDiff; }
39
40 plTime m_TimeDiff;
41};
Base class for all particle behaviors.
Definition ParticleBehavior.h:14
Definition ParticleBehavior.h:30
virtual void InitializeElements(plUInt64 uiStartIndex, plUInt64 uiNumElements) override
This method needs to be implemented in order to initialize new elements to specific values.
Definition ParticleBehavior.h:37
Definition ParticleModule.h:12
A particle system stores all data for one 'layer' of a running particle effect.
Definition ParticleSystemInstance.h:15
A single stream in a stream group holding contiguous data of a given type.
Definition ProcessingStream.h:8
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
Definition Set.h:238
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12