CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Environment.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
11
12#include "Scene.hpp"
13
15
19
20namespace CeresEngine {
21
23 struct EnvironmentComponent final : public Component<EnvironmentComponent> {
25 struct Accessor;
26
30
31 public: // Reflection
34 template<typename Processor> static constexpr void reflect(Processor&& RTTI) { CE_REFL_DATA(skybox); }
35 };
36
38 struct EnvironmentComponent::Accessor : public Component<EnvironmentComponent>::Accessor {
40
41 public:
44 const HTexture& getSkybox() const { return read(&C::skybox); }
45
49
50 public: // Reflection
53 template<typename Processor> static constexpr void reflect(Processor&& RTTI) { CE_REFL_DATA_GETSET(skybox, getSkybox, setSkybox); }
54 };
55
58 class Environment final : public EntityObject<EnvironmentComponent> {
60 };
61
62} // namespace CeresEngine
63
66
69
#define CE_EXTERN_COMPONENT(T)
Definition Component.hpp:600
#define CE_ENTITY_OBJECT_HASH(T)
Definition Entity.hpp:784
#define CE_REFLECTABLE_STRUCT
Definition IReflectable.hpp:47
#define CE_REFL_DATA_GETSET(N, G, S)
Definition Macros.hpp:549
#define CE_REFL_DATA(N)
Definition Macros.hpp:541
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
A type-safe entity type.
Definition Entity.hpp:538
EntityObject()=default
Creates a new entity object.
The Environment object is a mixin entity from a Scene that holds the environment to be rendered on th...
Definition Environment.hpp:58
Definition Application.hpp:19
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Accessor(const Entity &entity)
Definition Component.hpp:181
auto mutate(T C::*ptr)
Accesses an element from an existing Component.
const T & read(const T C::*ptr) const
Accesses an element from an existing Component.
Components serve as the base for data storage for an entity.
Definition Component.hpp:68
The accessor class for EnvironmentComponent.
Definition Environment.hpp:38
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition Environment.hpp:53
const HTexture & getSkybox() const
A texture that contains the skybox to be used by the environment renderer.
Definition Environment.hpp:44
void setSkybox(const HTexture &skybox)
A texture that contains the skybox to be used by the environment renderer.
Definition Environment.hpp:48
The Environment component.
Definition Environment.hpp:23
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition Environment.hpp:34
HTexture skybox
A texture that contains the skybox to be used by the environment renderer.
Definition Environment.hpp:29