Plasma Engine  2.0
Loading...
Searching...
No Matches
RenderComponent.h
1#pragma once
2
3#include <Core/Messages/UpdateLocalBoundsMessage.h>
4#include <Core/World/World.h>
5#include <RendererCore/RendererCoreDLL.h>
6
8class PL_RENDERERCORE_DLL plRenderComponent : public plComponent
9{
10 PL_DECLARE_ABSTRACT_COMPONENT_TYPE(plRenderComponent, plComponent);
11
13 // plComponent
14
15protected:
16 virtual void Deinitialize() override;
17 virtual void OnActivated() override;
18 virtual void OnDeactivated() override;
19
20
22 // plRenderComponent
23
24public:
27
31 virtual plResult GetLocalBounds(plBoundingBoxSphere& ref_bounds, bool& ref_bAlwaysVisible, plMsgUpdateLocalBounds& ref_msg) = 0;
32
34 void TriggerLocalBoundsUpdate();
35
37 static plUInt32 GetUniqueIdForRendering(const plComponent& component, plUInt32 uiInnerIndex = 0, plUInt32 uiInnerIndexShift = 24);
38
40 PL_ALWAYS_INLINE plUInt32 GetUniqueIdForRendering(plUInt32 uiInnerIndex = 0, plUInt32 uiInnerIndexShift = 24) const
41 {
42 return GetUniqueIdForRendering(*this, uiInnerIndex, uiInnerIndexShift);
43 }
44
45protected:
46 void OnUpdateLocalBounds(plMsgUpdateLocalBounds& msg);
47 void InvalidateCachedRenderData();
48};
Base class of all component types.
Definition Component.h:25
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 OnActivated()
This method is called when the component gets activated.
Definition Component.cpp:140
Base class for objects that should be rendered.
Definition RenderComponent.h:9
PL_ALWAYS_INLINE plUInt32 GetUniqueIdForRendering(plUInt32 uiInnerIndex=0, plUInt32 uiInnerIndexShift=24) const
Computes a unique ID for the given component, that is usually given to the renderer to distinguish ob...
Definition RenderComponent.h:40
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...
Definition UpdateLocalBoundsMessage.h:9
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54