Cogs.Core
MarkerPointSetSystem.h
1#pragma once
2
3#include "Systems/ComponentSystem.h"
4#include "Components/Geometry/MarkerPointSetComponent.h"
5
6#include "MarkerPointSetPicker.h"
7
8namespace Cogs::Core
9{
10 class Context;
11
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
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}
Context * context
Pointer to the Context instance the system lives in.
void update()
Updates the system state to that of the current frame.
Component system with parallel data per component stored in a pool similar to how the components them...
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
void initialize(Context *context) override
Initialize the system.
ComponentHandle createComponent() override
void destroyComponent(ComponentHandle componentHandle) override
Base allocator implementation.
Definition: Allocator.h:30
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
uint16_t VariableKey
Used to lookup material properties.
Definition: Resources.h:46
ComponentIndex SizeType
Type used to track the size of pools.
Definition: Component.h:19
Handle to a Component instance.
Definition: Component.h:67