1#include <Core/World/GameObject.h>
3PL_ALWAYS_INLINE plRenderData::Category::Category() =
default;
5PL_ALWAYS_INLINE plRenderData::Category::Category(plUInt16 uiValue)
10PL_ALWAYS_INLINE
bool plRenderData::Category::operator==(
const Category& other)
const
12 return m_uiValue == other.m_uiValue;
15PL_ALWAYS_INLINE
bool plRenderData::Category::operator!=(
const Category& other)
const
17 return m_uiValue != other.m_uiValue;
23PL_FORCE_INLINE
const plRenderer* plRenderData::GetCategoryRenderer(Category category,
const plRTTI* pRenderDataType)
25 if (s_bRendererInstancesDirty)
27 CreateRendererInstances();
30 auto& categoryData = s_CategoryData[category.m_uiValue];
33 if (categoryData.m_TypeToRendererIndex.TryGetValue(pRenderDataType, uiIndex))
35 return s_RendererInstances[uiIndex].Borrow();
42PL_FORCE_INLINE
plHashedString plRenderData::GetCategoryName(Category category)
44 if (category.m_uiValue < s_CategoryData.
GetCount())
46 return s_CategoryData[category.m_uiValue].m_sName;
52PL_FORCE_INLINE plUInt64 plRenderData::GetCategorySortingKey(Category category,
const plCamera& camera)
const
54 return s_CategoryData[category.m_uiValue].m_sortingKeyFunc(
this, camera);
60static T* plCreateRenderDataForThisFrame(
const plGameObject* pOwner)
62 static_assert(PL_IS_DERIVED_FROM_STATIC(
plRenderData, T));
64 T* pRenderData = PL_NEW(plFrameAllocator::GetCurrentAllocator(), T);
66 if (pOwner !=
nullptr)
68 pRenderData->m_hOwner = pOwner->
GetHandle();
71#if PL_ENABLED(PL_COMPILE_FOR_DEVELOPMENT)
72 pRenderData->m_pOwner = pOwner;
plUInt32 GetCount() const
Returns the number of active elements in the array.
Definition ArrayBase_inl.h:172
A camera class that stores the orientation and some basic camera settings.
Definition Camera.h:41
This class represents an object inside the world.
Definition GameObject.h:32
plGameObjectHandle GetHandle() const
Returns a handle to this object.
Definition GameObject_inl.h:64
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
Base class for all render data. Render data must contain all information that is needed to render the...
Definition RenderData.h:14
This is the base class for types that handle rendering of different object types.
Definition Renderer.h:9