Plasma Engine  2.0
Loading...
Searching...
No Matches
PointLightComponent.h
1#pragma once
2
3#include <RendererCore/Lights/LightComponent.h>
4#include <RendererCore/Pipeline/Declarations.h>
5#include <RendererCore/Textures/TextureCubeResource.h>
6
8
10class PL_RENDERERCORE_DLL plPointLightRenderData : public plLightRenderData
11{
12 PL_ADD_DYNAMIC_REFLECTION(plPointLightRenderData, plLightRenderData);
13
14public:
15 float m_fRange;
16 float m_fFalloff;
17 // plTextureCubeResourceHandle m_hProjectedTexture;
18};
19
24class PL_RENDERERCORE_DLL plPointLightComponent : public plLightComponent
25{
27
29 // plComponent
30
31public:
32 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
33 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
34
35
37 // plRenderComponent
38
39public:
40 virtual plResult GetLocalBounds(plBoundingBoxSphere& ref_bounds, bool& ref_bAlwaysVisible, plMsgUpdateLocalBounds& ref_msg) override;
41
43 // plPointLightComponent
44
45public:
48
50 void SetRange(float fRange); // [ property ]
51 float GetRange() const; // [ property ]
52
54 float GetEffectiveRange() const;
55
56 void SetFalloff(float fFalloff); // [ property ]
57 float GetFalloff() const; // [ property ]
58
59 // void SetProjectedTextureFile(const char* szFile); // [ property ]
60 // const char* GetProjectedTextureFile() const; // [ property ]
61
62 // void SetProjectedTexture(const plTextureCubeResourceHandle& hProjectedTexture);
63 // const plTextureCubeResourceHandle& GetProjectedTexture() const;
64
65protected:
66 void OnMsgExtractRenderData(plMsgExtractRenderData& msg) const;
67
68 float m_fRange = 0.0f;
69 float m_fEffectiveRange = 0.0f;
70 float m_fFalloff = 0.0f;
71
72 // plTextureCubeResourceHandle m_hProjectedTexture;
73};
74
77{
79
80public:
82 plPointLightVisualizerAttribute(const char* szRangeProperty, const char* szIntensityProperty, const char* szColorProperty);
83
84 const plUntrackedString& GetRangeProperty() const { return m_sProperty1; }
85 const plUntrackedString& GetIntensityProperty() const { return m_sProperty2; }
86 const plUntrackedString& GetColorProperty() const { return m_sProperty3; }
87};
Definition ComponentManager.h:88
Base class for dynamic light components.
Definition LightComponent.h:26
Base class for light render data objects.
Definition LightComponent.h:10
Adds a dynamic point light to the scene, optionally casting shadows.
Definition PointLightComponent.h:25
The render data object for point lights.
Definition PointLightComponent.h:11
A special visualizer attribute for point lights.
Definition PointLightComponent.h:77
Definition PropertyAttributes.h:780
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