Cogs.Core
Source
Systems
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
8
namespace
Cogs::Core
{
9
10
struct
ClipShapeData
11
{
12
glm::vec4
planes
[6];
13
Cogs::Geometry::BoundingBox
clipBounds
;
14
uint32_t planeCount = 0;
15
ClipShapeType
shape =
ClipShapeType::None
;
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
}
Cogs::Core::ClipShapeRefSystem
Definition:
ClipShapeSystem.h:32
Cogs::Core::ClipShapeSystem
Definition:
ClipShapeSystem.h:19
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::ComponentSystemBase::preUpdate
void preUpdate()
Run the pre-update method of the system.
Definition:
ComponentSystem.h:57
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::ComponentSystem
Typed component system managing a pool of components with the given ComponentType.
Definition:
ComponentSystem.h:144
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::Core::ClipShapeType
ClipShapeType
Specifices what kind of shape a clip shape has.
Definition:
ClipShapeComponent.h:12
Cogs::Core::ClipShapeType::None
@ None
No clipping at all.
Cogs::SizeType
ComponentIndex SizeType
Type used to track the size of pools.
Definition:
Component.h:19
Cogs::Core::ClipShapeData
Definition:
ClipShapeSystem.h:11
Cogs::Core::ClipShapeData::clipBounds
Cogs::Geometry::BoundingBox clipBounds
Bounds on clip shape in world space, empty if clip shape is open.
Definition:
ClipShapeSystem.h:13
Cogs::Core::ClipShapeData::planes
glm::vec4 planes[6]
Clipping planes in world space.
Definition:
ClipShapeSystem.h:12
Generated by
1.9.6