Cogs.Core
ClipShapeSystem.h
1#pragma once
2
3#include "Systems/ComponentSystem.h"
4#include "Foundation/Geometry/BoundingBox.hpp"
5
6#include "Components/Core/ClipShapeComponent.h"
7
8namespace Cogs::Core {
9
11 {
12 glm::vec4 planes[6];
13 Cogs::Geometry::BoundingBox clipBounds;
14 uint32_t planeCount = 0;
16 };
17
18 class ClipShapeSystem : public ComponentSystemWithDataPool<ClipShapeComponent, ClipShapeData>
19 {
20 public:
21 ClipShapeSystem(Memory::Allocator* allocator, SizeType capacity) :
22 ComponentSystemWithDataPool(allocator, capacity)
23 {}
24
25 void preUpdate(Context* context) override;
26
27 void update(Context* context) override;
28
29 };
30
31 class ClipShapeRefSystem : public ComponentSystem<ClipShapeRefComponent>
32 {
33 public:
34 ClipShapeRefSystem(Memory::Allocator* allocator, SizeType capacity) :
35 ComponentSystem(allocator, capacity)
36 {}
37 };
38
39}
Context * context
Pointer to the Context instance the system lives in.
void update()
Updates the system state to that of the current frame.
void preUpdate()
Run the pre-update method of the system.
Component system with parallel data per component stored in a pool similar to how the components them...
Typed component system managing a pool of components with the given ComponentType.
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 the Engine, Renderer, resource managers and other systems needed to run Cogs....
ClipShapeType
Specifices what kind of shape a clip shape has.
@ None
No clipping at all.
ComponentIndex SizeType
Type used to track the size of pools.
Definition: Component.h:19
Cogs::Geometry::BoundingBox clipBounds
Bounds on clip shape in world space, empty if clip shape is open.
glm::vec4 planes[6]
Clipping planes in world space.