Plasma Engine  2.0
Loading...
Searching...
No Matches
SkyBoxComponent.h
1#pragma once
2
3#include <Core/World/World.h>
4#include <RendererCore/Meshes/MeshComponent.h>
5
8
16class PL_RENDERERCORE_DLL plSkyBoxComponent : public plRenderComponent
17{
19
21 // plComponent
22
23public:
24 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
25 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
26
27protected:
28 virtual void Initialize() override;
29 virtual void OnActivated() override;
30
32 // plRenderComponent
33
34public:
35 virtual plResult GetLocalBounds(plBoundingBoxSphere& ref_bounds, bool& ref_bAlwaysVisible, plMsgUpdateLocalBounds& ref_msg) override;
36
38 // plSkyBoxComponent
39
40public:
43
45 void SetExposureBias(float fExposureBias); // [ property ]
46 float GetExposureBias() const { return m_fExposureBias; } // [ property ]
47
49 void SetInverseTonemap(bool bInverseTonemap); // [ property ]
50 bool GetInverseTonemap() const { return m_bInverseTonemap; } // [ property ]
51
53 void SetUseFog(bool bUseFog); // [ property ]
54 bool GetUseFog() const { return m_bUseFog; } // [ property ]
55
57 void SetVirtualDistance(float fVirtualDistance); // [ property ]
58 float GetVirtualDistance() const { return m_fVirtualDistance; } // [ property ]
59
60 void SetCubeMapFile(const char* szFile); // [ property ]
61 const char* GetCubeMapFile() const; // [ property ]
62
63 void SetCubeMap(const plTextureCubeResourceHandle& hCubeMap);
64 const plTextureCubeResourceHandle& GetCubeMap() const;
65
66private:
67 void OnMsgExtractRenderData(plMsgExtractRenderData& msg) const;
68 void UpdateMaterials();
69
70 float m_fExposureBias = 0.0f;
71 float m_fVirtualDistance = 1000.0f;
72 bool m_bInverseTonemap = false;
73 bool m_bUseFog = true;
74
76
78 plMaterialResourceHandle m_hCubeMapMaterial;
79};
virtual void SerializeComponent(plWorldWriter &inout_stream) const
Override this to save the current state of the component to the given stream.
Definition Component.cpp:54
virtual void DeserializeComponent(plWorldReader &inout_stream)
Override this to load the current state of the component from the given stream.
Definition Component.cpp:58
virtual void Initialize()
Can be overridden for basic initialization that depends on a valid hierarchy and position.
Definition Component.cpp:131
Definition ComponentManager.h:88
Base class for objects that should be rendered.
Definition RenderComponent.h:9
virtual void OnActivated() override
This method is called when the component gets activated.
Definition RenderComponent.cpp:33
virtual plResult GetLocalBounds(plBoundingBoxSphere &ref_bounds, bool &ref_bAlwaysVisible, plMsgUpdateLocalBounds &ref_msg)=0
Called by plRenderComponent::OnUpdateLocalBounds(). If PL_SUCCESS is returned, bounds and bAlwaysVisi...
Adds a static image of a sky to the scene.
Definition SkyBoxComponent.h:17
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 RenderData.h:116
Definition UpdateLocalBoundsMessage.h:9
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54