Cogs.Core
Extensions
HighlightRegion
Source
HighlightRegionSystem.h
1
#pragma once
2
3
#include "Rendering/Common.h"
4
5
#include "Resources/Resources.h"
6
7
#include "Systems/ComponentSystem.h"
8
9
#include "HighlightRegionComponent.h"
10
11
namespace
Cogs::Core
{
12
13
struct
HighlightRegionBounds;
14
struct
HighlightRegionPicker;
15
struct
HighlightRegionRenderer;
16
struct
RenderMaterialInstance;
17
18
struct
HighlightRegionInstanceData
19
{
20
glm::mat4 data0;
21
glm::mat4 data1;
22
};
23
24
struct
HighlightRegionData
25
{
26
MaterialInstanceHandle
materialInstance;
27
RenderMaterialInstance
* renderMaterialInstance =
nullptr
;
28
29
Cogs::BufferHandle
instanceDataHandle;
30
31
std::vector<HighlightRegionInstanceData> instanceData;
32
glm::vec3 boundsMin;
33
glm::vec3 boundsMax;
34
glm::mat4 worldMatrix;
35
36
bool
instanceDataUpdated =
false
;
37
bool
debugForceNoSplit =
false
;
38
};
39
40
struct
HighlightRegionSystem
:
public
ComponentSystemWithDataPool
<HighlightRegionComponent, HighlightRegionData>
41
{
42
public
:
43
HighlightRegionSystem
(
Memory::Allocator
* allocator,
SizeType
capacity) :
ComponentSystemWithDataPool
(allocator, capacity) {}
44
45
void
update
(
Context
*
context
)
override
;
46
47
ComponentHandle
createComponent
()
override
;
48
49
void
destroyComponent
(
ComponentHandle
component)
override
;
50
51
MaterialHandle
material;
52
HighlightRegionBounds
* bounds =
nullptr
;
53
HighlightRegionPicker
* picker =
nullptr
;
54
HighlightRegionRenderer
* renderer =
nullptr
;
55
};
56
}
Cogs::Core::ComponentSystemBase::context
Context * context
Pointer to the Context instance the system lives in.
Definition:
ComponentSystem.h:136
Cogs::Core::ComponentSystemBase::update
void update()
Updates the system state to that of the current frame.
Definition:
ComponentSystem.h:65
Cogs::Core::ComponentSystemWithDataPool
Component system with parallel data per component stored in a pool similar to how the components them...
Definition:
ComponentSystem.h:365
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Memory::Allocator
Base allocator implementation.
Definition:
Allocator.h:30
Cogs::Core
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
Definition:
ComponentFunctions.h:10
Cogs::SizeType
ComponentIndex SizeType
Type used to track the size of pools.
Definition:
Component.h:19
Cogs::ComponentModel::ComponentHandle
Handle to a Component instance.
Definition:
Component.h:67
Cogs::Core::HighlightRegionBounds
Definition:
HighlightRegionBounds.h:11
Cogs::Core::HighlightRegionData
Definition:
HighlightRegionSystem.h:25
Cogs::Core::HighlightRegionInstanceData
Definition:
HighlightRegionSystem.h:19
Cogs::Core::HighlightRegionPicker
Definition:
HighlightRegionPicker.h:10
Cogs::Core::HighlightRegionRenderer
Definition:
HighlightRegionRenderer.h:16
Cogs::Core::HighlightRegionSystem
Definition:
HighlightRegionSystem.h:41
Cogs::Core::HighlightRegionSystem::destroyComponent
void destroyComponent(ComponentHandle component) override
Definition:
HighlightRegionSystem.cpp:114
Cogs::Core::HighlightRegionSystem::createComponent
ComponentHandle createComponent() override
Definition:
HighlightRegionSystem.cpp:90
Cogs::Core::RenderMaterialInstance
Definition:
RenderMaterialInstance.h:21
Cogs::Core::ResourceHandle_t< MaterialInstance >
Cogs::Handle_t< BufferTag >
Generated by
1.9.6