Cogs.Core
Source
Systems
Core
StaticModelSystem.h
1
#pragma once
2
3
#include "Components/Core/StaticModelComponent.h"
4
5
#include "Systems/ComponentSystem.h"
6
7
namespace
Cogs::Core
8
{
9
struct
StaticModelData
10
{
11
StaticModelData
() =
default
;
12
StaticModelData
(
StaticModelData
&) =
delete
;
13
StaticModelData
(
StaticModelData
&&) =
default
;
14
~StaticModelData
();
15
16
void
setGeneration(uint8_t generation) { this->generation = generation; }
17
bool
isGeneration(uint8_t generation)
const
{
return
this->generation == generation; }
18
19
std::vector<MaterialInstanceHandle> materials;
20
21
std::shared_ptr<struct StaticModelContext> modelContext;
22
23
std::vector<ComponentModel::Entity *> roots;
24
25
private
:
26
uint8_t generation = 0;
27
};
28
29
class
COGSCORE_DLL_API
StaticModelSystem
:
public
ComponentSystemWithDataPool
<StaticModelComponent, StaticModelData>
30
{
31
public
:
32
StaticModelSystem
(
Memory::Allocator
* allocator,
SizeType
capacity) :
ComponentSystemWithDataPool
(allocator, capacity)
33
{
34
35
}
36
37
~StaticModelSystem
();
38
39
void
update(
Context
* context)
override
;
40
41
class
RenderSystem
* getRenderSystem(
StaticModelComponent
* modelComponent);
42
class
MeshSystem
* getMeshSystem(
StaticModelComponent
* modelComponent);
43
struct
RenderBatch
* getRenderBatch(
StaticModelComponent
* modelComponent);
44
45
void
initializeCulling(
struct
CullingSource
* cullingSource);
46
47
private
:
48
void
loadModel(
Context
* context,
const
StaticModelComponent
& component,
StaticModelData
& modelData,
Model
* model);
49
};
50
}
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::MeshSystem
Definition:
MeshSystem.h:14
Cogs::Core::RenderSystem
The mesh render system handles MeshRenderComponents.
Definition:
RenderSystem.h:75
Cogs::Core::StaticModelSystem
Definition:
StaticModelSystem.h:30
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::SizeType
ComponentIndex SizeType
Type used to track the size of pools.
Definition:
Component.h:19
Cogs::Core::CullingSource
Definition:
CullingData.h:17
Cogs::Core::Model
Model resources define a template for a set of connected entities, with resources such as meshes,...
Definition:
Model.h:56
Cogs::Core::RenderBatch
Definition:
RenderList.h:245
Cogs::Core::StaticModelComponent
Definition:
StaticModelComponent.h:10
Cogs::Core::StaticModelData
Definition:
StaticModelSystem.h:10
Generated by
1.9.6