Cogs.Core
Source
Systems
Geometry
MarkerPointSetSystem.h
1
#pragma once
2
3
#include "Systems/ComponentSystem.h"
4
#include "Components/Geometry/MarkerPointSetComponent.h"
5
6
#include "MarkerPointSetPicker.h"
7
8
namespace
Cogs::Core
9
{
10
class
Context;
11
12
struct
MarkerPointSetData
13
{
14
glm::vec4 viewPlaneLocal;
15
glm::vec3 viewXLocal;
16
glm::vec3 viewYLocal;
17
18
MaterialInstanceHandle
materialInstance;
19
20
bool
initialized =
false
;
21
};
22
23
class
MarkerPointSetSystem
:
public
ComponentSystemWithDataPool
<MarkerPointSetComponent, MarkerPointSetData>
24
{
25
public
:
26
MarkerPointSetSystem
(
Memory::Allocator
* allocator,
SizeType
capacity) :
ComponentSystemWithDataPool
(allocator, capacity) {}
27
28
void
initialize
(
Context
*
context
)
override
;
29
30
ComponentHandle
createComponent
()
override
;
31
void
destroyComponent
(
ComponentHandle
componentHandle)
override
;
32
void
update
(
Context
*
/*context*/
)
override
;
33
34
private
:
35
MeshHandle
quad;
36
37
MaterialHandle
pointMaterial;
38
VariableKey
diffuseColorKey = NoProperty;
39
VariableKey
outlineColorKey = NoProperty;
40
VariableKey
viewPlaneLocalKey = NoProperty;
41
VariableKey
viewXLocalKey = NoProperty;
42
VariableKey
viewYLocalKey = NoProperty;
43
VariableKey
pointSizeKey = NoProperty;
44
VariableKey
outlineRelativeRadiusSquaredKey = NoProperty;
45
VariableKey
nearDistanceKey = NoProperty;
46
VariableKey
farDistanceKey = NoProperty;
47
48
struct
{
49
glm::vec2 viewportSize = glm::vec2(0.f);
50
float
dpiScale = 0.f;
51
}
52
prevCameraState;
53
54
55
std::unique_ptr<MarkerPointSetPicker> picker;
56
};
57
58
}
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::Core::MarkerPointSetSystem
Definition:
MarkerPointSetSystem.h:24
Cogs::Core::MarkerPointSetSystem::initialize
void initialize(Context *context) override
Initialize the system.
Definition:
MarkerPointSetSystem.cpp:25
Cogs::Core::MarkerPointSetSystem::createComponent
ComponentHandle createComponent() override
Definition:
MarkerPointSetSystem.cpp:46
Cogs::Core::MarkerPointSetSystem::destroyComponent
void destroyComponent(ComponentHandle componentHandle) override
Definition:
MarkerPointSetSystem.cpp:72
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::Core::VariableKey
uint16_t VariableKey
Used to lookup material properties.
Definition:
Resources.h:46
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::MarkerPointSetData
Definition:
MarkerPointSetSystem.h:13
Cogs::Core::ResourceHandle_t< MaterialInstance >
Generated by
1.9.6