Plasma Engine  2.0
Loading...
Searching...
No Matches
AmbientLightComponent.h
1#pragma once
2
3#include <Core/World/SettingsComponent.h>
4#include <Core/World/SettingsComponentManager.h>
5#include <RendererCore/RendererCoreDLL.h>
6
8
10
11class PL_RENDERERCORE_DLL plAmbientLightComponent : public plSettingsComponent
12{
14
16 // plComponent
17
18public:
19 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
20 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
21
22protected:
23 virtual void Deinitialize() override;
24 virtual void OnActivated() override;
25 virtual void OnDeactivated() override;
26
27
29 // plAmbientLightComponent
30
31public:
34
35 void SetTopColor(plColorGammaUB color); // [ property ]
36 plColorGammaUB GetTopColor() const; // [ property ]
37
38 void SetBottomColor(plColorGammaUB color); // [ property ]
39 plColorGammaUB GetBottomColor() const; // [ property ]
40
41 void SetIntensity(float fIntensity); // [ property ]
42 float GetIntensity() const; // [ property ]
43
44private:
45 void OnUpdateLocalBounds(plMsgUpdateLocalBounds& msg);
46 void UpdateSkyIrradiance();
47
48 plColorGammaUB m_TopColor = plColor(0.2f, 0.2f, 0.3f);
49 plColorGammaUB m_BottomColor = plColor(0.1f, 0.1f, 0.15f);
50 float m_fIntensity = 1.0f;
51};
Definition AmbientLightComponent.h:12
A 8bit per channel unsigned normalized (values interpreted as 0-1) color storage format that represen...
Definition Color8UNorm.h:99
plColor represents an RGBA color in linear color space. Values are stored as float,...
Definition Color.h:44
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 OnDeactivated()
This method is called when the component gets deactivated.
Definition Component.cpp:142
virtual void Deinitialize()
This method is called before the component is destroyed. A derived type can override this method to d...
Definition Component.cpp:133
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 OnActivated()
This method is called when the component gets activated.
Definition Component.cpp:140
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
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 UpdateLocalBoundsMessage.h:9