Plasma Engine  2.0
Loading...
Searching...
No Matches
ParticleStream.h
1#pragma once
2
3#include <Foundation/DataProcessing/Stream/ProcessingStream.h>
4#include <Foundation/DataProcessing/Stream/ProcessingStreamProcessor.h>
5#include <Foundation/Reflection/Reflection.h>
6#include <ParticlePlugin/Declarations.h>
7#include <ParticlePlugin/ParticlePluginDLL.h>
8
11
13class PL_PARTICLEPLUGIN_DLL plParticleStreamFactory : public plReflectedClass
14{
15 PL_ADD_DYNAMIC_REFLECTION(plParticleStreamFactory, plReflectedClass);
16
17public:
18 plParticleStreamFactory(const char* szStreamName, plProcessingStream::DataType dataType, const plRTTI* pStreamTypeToCreate);
19
20 const plRTTI* GetParticleStreamType() const;
21 plProcessingStream::DataType GetStreamDataType() const;
22 const char* GetStreamName() const;
23
24 static void GetFullStreamName(const char* szName, plProcessingStream::DataType type, plStringBuilder& out_sResult);
25
26 plParticleStream* CreateParticleStream(plParticleSystemInstance* pOwner) const;
27
28private:
29 const char* m_szStreamName = nullptr;
30 plProcessingStream::DataType m_DataType = plProcessingStream::DataType::Float;
31 const plRTTI* m_pStreamTypeToCreate = nullptr;
32};
33
35class PL_PARTICLEPLUGIN_DLL plParticleStream : public plProcessingStreamProcessor
36{
37 PL_ADD_DYNAMIC_REFLECTION(plParticleStream, plProcessingStreamProcessor);
38
39 friend class plParticleSystemInstance;
40 friend class plParticleStreamFactory;
41
42protected:
44 virtual void Initialize(plParticleSystemInstance* pOwner) {}
45 virtual plResult UpdateStreamBindings() final override;
46 virtual void Process(plUInt64 uiNumElements) final override {}
47
49 virtual void InitializeElements(plUInt64 uiStartIndex, plUInt64 uiNumElements) override;
50
51 plProcessingStream* m_pStream;
52
53private:
54 plParticleStreamBinding m_StreamBinding;
55};
Definition Declarations.h:56
Base class for all particle stream factories.
Definition ParticleStream.h:14
Base class for all particle streams.
Definition ParticleStream.h:36
virtual void Process(plUInt64 uiNumElements) final override
The actual method which processes the data, will be called with the number of elements to process.
Definition ParticleStream.h:46
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
DataType
The data types which can be stored in the stream. When adding new data types the GetDataTypeSize() of...
Definition ProcessingStream.h:13
Base class for all stream processor implementations.
Definition ProcessingStreamProcessor.h:11
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
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54