Cogs.Core
Source
Systems
Core
FogSystem.h
1
#pragma once
2
3
#include "Systems/ComponentSystem.h"
4
5
#include "Components/Core/FogComponent.h"
6
7
namespace
Cogs
8
{
9
namespace
Core
10
{
11
class
Context;
12
14
struct
FogData
15
{
16
// Reserved for future use, for fog volumes etc.
17
};
18
23
class
FogSystem
:
public
ComponentSystemWithDataPool
<FogComponent, FogData>
24
{
25
public
:
26
FogSystem
(
Memory::Allocator
* allocator,
SizeType
capacity) :
ComponentSystemWithDataPool
(allocator, capacity) {}
27
29
void
update
(
Context
*
context
);
30
32
void
setGlobalFog
(
ComponentModel::ComponentHandle
fogComponent) {
globalFog
= fogComponent; }
33
35
FogComponent
*
getGlobalFog
()
const
{
return
globalFog
.
resolveComponent
<
FogComponent
>(); }
36
37
private
:
39
ComponentModel::ComponentHandle
globalFog
=
ComponentModel::ComponentHandle::Empty
();
40
};
41
}
42
}
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::FogComponent
Contains data to describe fog.
Definition:
FogComponent.h:17
Cogs::Core::FogSystem
The fog system manages fog instances, in addition to special handling a single fog component as the g...
Definition:
FogSystem.h:24
Cogs::Core::FogSystem::getGlobalFog
FogComponent * getGlobalFog() const
Get the global fog component.
Definition:
FogSystem.h:35
Cogs::Core::FogSystem::setGlobalFog
void setGlobalFog(ComponentModel::ComponentHandle fogComponent)
Set the global fog component, used to control fog for the entire scene.
Definition:
FogSystem.h:32
Cogs::Core::FogSystem::globalFog
ComponentModel::ComponentHandle globalFog
Global fog handle.
Definition:
FogSystem.h:39
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::ComponentModel::ComponentHandle
Handle to a Component instance.
Definition:
Component.h:67
Cogs::ComponentModel::ComponentHandle::Empty
static ComponentHandle Empty()
Returns an empty, invalid handle. Will evaluate to false if tested against using operator bool().
Definition:
Component.h:119
Cogs::ComponentModel::ComponentHandle::resolveComponent
ComponentType * resolveComponent() const
Definition:
Component.h:90
Cogs::Core::FogData
Holds calculated data for a single fog instance.
Definition:
FogSystem.h:15
Generated by
1.9.6