Cogs.Core
Extensions
Casing
Source
TrajectoryCrossSectionsSystem.h
1
#pragma once
2
3
#include "Systems/ComponentSystem.h"
4
#include "Resources/VertexFormats.h"
5
6
#include "TrajectoryCrossSectionsComponent.h"
7
8
#include "Foundation/Geometry/BoundingBox.hpp"
9
10
namespace
Cogs
11
{
12
namespace
Core
13
{
14
class
Context;
15
16
struct
TrajectoryCrossSectionsData
17
{
18
Geometry::BoundingBox
boundingBox
;
19
Geometry::BoundingBox
trajectoryBoundingBox
;
20
float
startMeasuredDepth = 0.f;
21
float
stopMeasuredDepth = 1.f;
22
int
index0
= 0;
23
int
index1
= 0;
24
int
rings
= 0;
25
int
samples
= 0;
26
bool
generate
=
false
;
27
//std::vector<uint8_t> currInclude; ///< True for each index to include (size()=rings).
28
//std::vector<uint8_t> prevInclude; ///< Copy from previous iteration, used to determine if geometry must be regenerated.
29
};
30
31
class
TrajectoryCrossSectionsSystem
32
:
public
ComponentSystemWithDataPool
<TrajectoryCrossSectionsComponent, TrajectoryCrossSectionsData>
33
{
34
public
:
35
TrajectoryCrossSectionsSystem
(
Memory::Allocator
* allocator,
SizeType
capacity) :
ComponentSystemWithDataPool
(allocator, capacity) {}
36
37
void
update
(
Context
*
context
);
38
39
private
:
40
glm::vec2
currentViewport
;
41
std::vector<glm::vec2>
positionsScreen
;
42
std::vector<glm::ivec2>
ranges
;
43
};
44
}
// of namespace Core
45
}
// of namespace Cogs
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::TrajectoryCrossSectionsSystem
Definition:
TrajectoryCrossSectionsSystem.h:33
Cogs::Core::TrajectoryCrossSectionsSystem::positionsScreen
std::vector< glm::vec2 > positionsScreen
Temporary positions in window coordinates.
Definition:
TrajectoryCrossSectionsSystem.h:41
Cogs::Core::TrajectoryCrossSectionsSystem::currentViewport
glm::vec2 currentViewport
Used to detect viewport changes.
Definition:
TrajectoryCrossSectionsSystem.h:40
Cogs::Core::TrajectoryCrossSectionsSystem::ranges
std::vector< glm::ivec2 > ranges
Temporary set of ranges.
Definition:
TrajectoryCrossSectionsSystem.h:42
Cogs::Memory::Allocator
Base allocator implementation.
Definition:
Allocator.h:30
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Cogs::SizeType
ComponentIndex SizeType
Type used to track the size of pools.
Definition:
Component.h:19
Cogs::Core::TrajectoryCrossSectionsData
Definition:
TrajectoryCrossSectionsSystem.h:17
Cogs::Core::TrajectoryCrossSectionsData::index0
int index0
Start index along trajectory.
Definition:
TrajectoryCrossSectionsSystem.h:22
Cogs::Core::TrajectoryCrossSectionsData::samples
int samples
Number of perimeter samples used when cross sections were created.
Definition:
TrajectoryCrossSectionsSystem.h:25
Cogs::Core::TrajectoryCrossSectionsData::generate
bool generate
True if cross sections must be recalculated on next update.
Definition:
TrajectoryCrossSectionsSystem.h:26
Cogs::Core::TrajectoryCrossSectionsData::trajectoryBoundingBox
Geometry::BoundingBox trajectoryBoundingBox
Model-space bounding box of the trajectory sub-section that we cover.
Definition:
TrajectoryCrossSectionsSystem.h:19
Cogs::Core::TrajectoryCrossSectionsData::boundingBox
Geometry::BoundingBox boundingBox
Model-space bounding box of cross-section data.
Definition:
TrajectoryCrossSectionsSystem.h:18
Cogs::Core::TrajectoryCrossSectionsData::rings
int rings
Number of rings around trajectory in tessellation.
Definition:
TrajectoryCrossSectionsSystem.h:24
Cogs::Core::TrajectoryCrossSectionsData::index1
int index1
Stop index along trajectory.
Definition:
TrajectoryCrossSectionsSystem.h:23
Generated by
1.9.6