Plasma Engine  2.0
Loading...
Searching...
No Matches
ExtractedRenderData.h
1#pragma once
2
3#include <Core/Graphics/Camera.h>
4#include <RendererCore/Debug/DebugRendererContext.h>
5#include <RendererCore/Pipeline/RenderData.h>
6#include <RendererCore/Pipeline/RenderDataBatch.h>
7#include <RendererCore/Pipeline/ViewData.h>
8
9class PL_RENDERERCORE_DLL plExtractedRenderData
10{
11public:
13
14 PL_ALWAYS_INLINE void SetCamera(const plCamera& camera) { m_Camera = camera; }
15 PL_ALWAYS_INLINE const plCamera& GetCamera() const { return m_Camera; }
16
17 PL_ALWAYS_INLINE void SetLodCamera(const plCamera& camera) { m_LodCamera = camera; }
18 PL_ALWAYS_INLINE const plCamera& GetLodCamera() const { return m_LodCamera; }
19
20 PL_ALWAYS_INLINE void SetViewData(const plViewData& viewData) { m_ViewData = viewData; }
21 PL_ALWAYS_INLINE const plViewData& GetViewData() const { return m_ViewData; }
22
23 PL_ALWAYS_INLINE void SetWorldTime(plTime time) { m_WorldTime = time; }
24 PL_ALWAYS_INLINE plTime GetWorldTime() const { return m_WorldTime; }
25
26 PL_ALWAYS_INLINE void SetWorldDebugContext(const plDebugRendererContext& debugContext) { m_WorldDebugContext = debugContext; }
27 PL_ALWAYS_INLINE const plDebugRendererContext& GetWorldDebugContext() const { return m_WorldDebugContext; }
28
29 PL_ALWAYS_INLINE void SetViewDebugContext(const plDebugRendererContext& debugContext) { m_ViewDebugContext = debugContext; }
30 PL_ALWAYS_INLINE const plDebugRendererContext& GetViewDebugContext() const { return m_ViewDebugContext; }
31
32 void AddRenderData(const plRenderData* pRenderData, plRenderData::Category category);
33 void AddFrameData(const plRenderData* pFrameData);
34
35 void SortAndBatch();
36
37 void Clear();
38
39 plRenderDataBatchList GetRenderDataBatchesWithCategory(
41
42 template <typename T>
43 PL_ALWAYS_INLINE const T* GetFrameData() const
44 {
45 return static_cast<const T*>(GetFrameData(plGetStaticRTTI<T>()));
46 }
47
48private:
49 const plRenderData* GetFrameData(const plRTTI* pRtti) const;
50
51 struct DataPerCategory
52 {
55 };
56
57 plCamera m_Camera;
58 plCamera m_LodCamera; // Temporary until we have a real LOD system
59 plViewData m_ViewData;
60 plTime m_WorldTime;
61
62 plDebugRendererContext m_WorldDebugContext;
63 plDebugRendererContext m_ViewDebugContext;
64
65 plHybridArray<DataPerCategory, 16> m_DataPerCategory;
67};
A camera class that stores the orientation and some basic camera settings.
Definition Camera.h:41
Used in plDebugRenderer to determine where debug geometry should be rendered.
Definition DebugRendererContext.h:11
Definition DynamicArray.h:81
Definition ExtractedRenderData.h:10
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
Definition RenderDataBatch.h:64
Base class for all render data. Render data must contain all information that is needed to render the...
Definition RenderData.h:14
Definition RenderData.h:19
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12
Holds view data like the viewport, view and projection matrices.
Definition ViewData.h:11