Cogs.Core
FogSystem.h
1#pragma once
2
3#include "Systems/ComponentSystem.h"
4
5#include "Components/Core/FogComponent.h"
6
7namespace 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
36
37 private:
40 };
41 }
42}
Context * context
Pointer to the Context instance the system lives in.
void update()
Updates the system state to that of the current frame.
Component system with parallel data per component stored in a pool similar to how the components them...
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Contains data to describe fog.
Definition: FogComponent.h:17
The fog system manages fog instances, in addition to special handling a single fog component as the g...
Definition: FogSystem.h:24
FogComponent * getGlobalFog() const
Get the global fog component.
Definition: FogSystem.h:35
void setGlobalFog(ComponentModel::ComponentHandle fogComponent)
Set the global fog component, used to control fog for the entire scene.
Definition: FogSystem.h:32
ComponentModel::ComponentHandle globalFog
Global fog handle.
Definition: FogSystem.h:39
Base allocator implementation.
Definition: Allocator.h:30
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
ComponentIndex SizeType
Type used to track the size of pools.
Definition: Component.h:19
Handle to a Component instance.
Definition: Component.h:67
static ComponentHandle Empty()
Returns an empty, invalid handle. Will evaluate to false if tested against using operator bool().
Definition: Component.h:119
ComponentType * resolveComponent() const
Definition: Component.h:90
Holds calculated data for a single fog instance.
Definition: FogSystem.h:15