Cogs.Core
ExtrusionSystem.h
1#pragma once
2
3#include "Systems/ComponentSystem.h"
4
5#include "Components/Geometry/ExtrusionComponent.h"
6
7namespace Cogs
8{
9 namespace Core
10 {
11 class Context;
12
14 {
15 ExtrusionData() = default;
16 ExtrusionData(const ExtrusionData & other) = delete;
17
18 std::vector<float> depthList;
19 std::vector<float> samples;
20
21 std::vector<glm::vec3> basePositions;
22 std::vector<glm::vec3> baseDirections;
23 };
24
26 {
27 ExtrusionLogData() = default;
28 ExtrusionLogData(const ExtrusionLogData & other) = delete;
29
30 std::vector<float> values;
31
32 float radius = 0.0f;
33 };
34
35 class ExtrusionSystem : public ComponentSystemWithDataPools<ExtrusionComponent, ExtrusionData, ExtrusionLogData>
36 {
37 public:
38 ExtrusionSystem(Memory::Allocator * allocator, SizeType capacity) : ComponentSystemWithDataPools(allocator, capacity) {}
39
40 void update(Context * context);
41
42 private:
43 void updateExtrusion(const ExtrusionComponent & component, struct Mesh * mesh);
44 void updateLogExtrusion(const ExtrusionComponent & component, Context * context, struct Mesh * mesh);
45 void updateHighlightExtrusion(const ExtrusionComponent & component, Context * context, struct Mesh * mesh);
46 };
47 }
48}
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 template with multiple parallel structures per component stored in separate pools si...
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Base allocator implementation.
Definition: Allocator.h:30
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
ComponentIndex SizeType
Type used to track the size of pools.
Definition: Component.h:19
Meshes contain streams of vertex data in addition to index data and options defining geometry used fo...
Definition: Mesh.h:265