Cogs.Core
Source
Systems
Core
LodSystem.h
1
#pragma once
2
3
#include "Systems/ComponentSystem.h"
4
5
#include "Components/Core/LodComponent.h"
6
7
namespace
Cogs
8
{
9
namespace
Core
10
{
11
class
Context;
12
14
struct
LodData
15
{
16
LodData
() =
default
;
17
LodData
(
const
LodData
& other) =
delete
;
18
19
uint8_t currentLodIndex = 0;
20
uint8_t previousLodIndex = (uint8_t)-1;
21
float
detailLevel = 1;
22
23
glm::mat4 localToClip;
24
glm::mat4 clipToLocal;
25
};
26
37
class
LodSystem
:
public
ComponentSystemWithDataPools
<LodComponent, LodData>
38
{
39
public
:
40
LodSystem
(
Memory::Allocator
* allocator,
SizeType
capacity) :
ComponentSystemWithDataPools
(allocator, capacity) {}
41
43
void
update
(
Context
*
context
);
44
46
float
previousFrameStickyness
= 0.1f;
47
49
GeometricErrorKind
geometricErrorKind
= GeometricErrorKind::AreaBased;
50
};
51
}
52
}
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::ComponentSystemWithDataPools
Component system template with multiple parallel structures per component stored in separate pools si...
Definition:
ComponentSystem.h:252
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Core::LodSystem
The LodSystem is responsible for calculating common basic level of detail data for all entities with ...
Definition:
LodSystem.h:38
Cogs::Core::LodSystem::geometricErrorKind
GeometricErrorKind geometricErrorKind
Specifies what kind of error measure that is preferred.
Definition:
LodSystem.h:49
Cogs::Core::LodSystem::previousFrameStickyness
float previousFrameStickyness
A number in [0,1] that indicates resilience to change, used to minimize popping.
Definition:
LodSystem.h:46
Cogs::Memory::Allocator
Base allocator implementation.
Definition:
Allocator.h:30
Cogs::Core::GeometricErrorKind
GeometricErrorKind
Defines kinds of geometric error calculations.
Definition:
LodComponent.h:27
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::LodData
Defines level of detail data calculated by the LodSystem.
Definition:
LodSystem.h:15
Generated by
1.9.6