Plasma Engine  2.0
Loading...
Searching...
No Matches
ParticleBehavior_Raycast.h
1#pragma once
2
3#include <Foundation/Strings/String.h>
4#include <ParticlePlugin/Behavior/ParticleBehavior.h>
5
7
8struct PL_PARTICLEPLUGIN_DLL plParticleRaycastHitReaction
9{
10 using StorageType = plUInt8;
11
12 enum Enum
13 {
14 Bounce,
15 Die,
16 Stop,
17
18 Default = Bounce
19 };
20};
21
22PL_DECLARE_REFLECTABLE_TYPE(PL_PARTICLEPLUGIN_DLL, plParticleRaycastHitReaction);
23
24class PL_PARTICLEPLUGIN_DLL plParticleBehaviorFactory_Raycast final : public plParticleBehaviorFactory
25{
27
28public:
31
32 virtual const plRTTI* GetBehaviorType() const override;
33 virtual void CopyBehaviorProperties(plParticleBehavior* pObject, bool bFirstTime) const override;
34
35 virtual void QueryFinalizerDependencies(plSet<const plRTTI*>& inout_finalizerDeps) const override;
36
37 virtual void Save(plStreamWriter& inout_stream) const override;
38 virtual void Load(plStreamReader& inout_stream) override;
39
41 plUInt8 m_uiCollisionLayer = 0;
42 plString m_sOnCollideEvent;
43 float m_fBounceFactor = 0.5f;
44 float m_fSlideFactor = 0.5f;
45 float m_fSizeFactor = 0.1f;
46};
47
48
49class PL_PARTICLEPLUGIN_DLL plParticleBehavior_Raycast final : public plParticleBehavior
50{
51 PL_ADD_DYNAMIC_REFLECTION(plParticleBehavior_Raycast, plParticleBehavior);
52
53public:
55
56 virtual void CreateRequiredStreams() override;
57 virtual void QueryOptionalStreams() override;
58
60 plUInt8 m_uiCollisionLayer = 0;
61 plTempHashedString m_sOnCollideEvent;
62 float m_fBounceFactor = 0.5f;
63 float m_fSlideFactor = 0.5f;
64 float m_fSizeFactor = 0.1f;
65
66protected:
68
69 virtual void Process(plUInt64 uiNumElements) override;
70
71 void RequestRequiredWorldModulesForCache(plParticleWorldModule* pParticleModule) override;
72
73 plPhysicsWorldModuleInterface* m_pPhysicsModule;
74
75 plProcessingStream* m_pStreamPosition = nullptr;
76 plProcessingStream* m_pStreamLastPosition = nullptr;
77 plProcessingStream* m_pStreamVelocity = nullptr;
78 const plProcessingStream* m_pStreamSize = nullptr;
79};
Definition ParticleBehavior_Raycast.h:50
Definition ParticleBehavior_Raycast.h:25
Base class for all particle behaviors.
Definition ParticleBehavior.h:14
Definition ParticleBehavior.h:30
This world module stores all particle effect data that is active in a given plWorld instance.
Definition ParticleWorldModule.h:24
Definition PhysicsWorldModule.h:109
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
Definition Set.h:238
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
A class to use together with plHashedString for quick comparisons with temporary strings that need no...
Definition HashedString.h:151
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Definition ParticleBehavior_Raycast.h:9