Plasma Engine  2.0
Loading...
Searching...
No Matches
BakedProbesComponent.h
1#pragma once
2
3#include <Core/World/SettingsComponent.h>
4#include <Core/World/SettingsComponentManager.h>
5#include <Foundation/Types/SharedPtr.h>
6#include <RendererCore/BakedProbes/BakingInterface.h>
7#include <RendererCore/Declarations.h>
8#include <RendererFoundation/RendererFoundationDLL.h>
9
14
15class PL_RENDERERCORE_DLL plBakedProbesComponentManager : public plSettingsComponentManager<class plBakedProbesComponent>
16{
17public:
20
21 virtual void Initialize() override;
22 virtual void Deinitialize() override;
23
24 plMeshResourceHandle m_hDebugSphere;
25 plMaterialResourceHandle m_hDebugMaterial;
26
27private:
28 void RenderDebug(const plWorldModule::UpdateContext& updateContext);
29 void OnRenderEvent(const plRenderWorldRenderEvent& e);
30 void CreateDebugResources();
31};
32
33class PL_RENDERERCORE_DLL plBakedProbesComponent : public plSettingsComponent
34{
36
37public:
40
41 virtual void OnActivated() override;
42 virtual void OnDeactivated() override;
43
44 plBakingSettings m_Settings; // [ property ]
45
46 void SetShowDebugOverlay(bool bShow); // [ property ]
47 bool GetShowDebugOverlay() const { return m_bShowDebugOverlay; } // [ property ]
48
49 void SetShowDebugProbes(bool bShow); // [ property ]
50 bool GetShowDebugProbes() const { return m_bShowDebugProbes; } // [ property ]
51
52 void SetUseTestPosition(bool bUse); // [ property ]
53 bool GetUseTestPosition() const { return m_bUseTestPosition; } // [ property ]
54
55 void SetTestPosition(const plVec3& vPos); // [ property ]
56 const plVec3& GetTestPosition() const { return m_vTestPosition; } // [ property ]
57
58 void OnUpdateLocalBounds(plMsgUpdateLocalBounds& ref_msg);
59 void OnExtractRenderData(plMsgExtractRenderData& ref_msg) const;
60
61 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
62 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
63
64private:
65 void RenderDebugOverlay();
66 void OnObjectCreated(const plAbstractObjectNode& node);
67
68 plHashedString m_sProbeTreeResourcePrefix;
69
70 bool m_bShowDebugOverlay = false;
71 bool m_bShowDebugProbes = false;
72 bool m_bUseTestPosition = false;
73 plVec3 m_vTestPosition = plVec3::MakeZero();
74
75 struct RenderDebugViewTask;
76 plSharedPtr<RenderDebugViewTask> m_pRenderDebugViewTask;
77
78 plGALTextureHandle m_hDebugViewTexture;
79};
Definition AbstractObjectGraph.h:17
Definition BakedProbesComponent.h:34
Definition BakedProbesComponent.h:16
Definition RendererFoundationDLL.h:411
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
Base class for settings components, of which only one per type should exist in each world.
Definition SettingsComponent.h:13
A component manager that does no update at all on components and expects only a single instance to be...
Definition SettingsComponentManager.h:14
A Shared ptr manages a shared object and destroys that object when no one references it anymore....
Definition SharedPtr.h:10
static plVec3Template< float > MakeZero()
Definition Vec3.h:38
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
virtual void Initialize()
This method is called after the constructor. A derived type can override this method to do initializa...
Definition WorldModule.h:98
virtual void Deinitialize()
This method is called before the destructor. A derived type can override this method to do deinitiali...
Definition WorldModule.h:101
Reads a world description from a stream. Allows to instantiate that world multiple times in different...
Definition WorldReader.h:47
Stores an entire plWorld in a stream.
Definition WorldWriter.h:13
Definition BakingInterface.h:8
Definition RenderData.h:116
Definition UpdateLocalBoundsMessage.h:9
Definition RenderWorld.h:24
Definition WorldModule.h:33