-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(engine): implement active component for cameras and light
- Loading branch information
1 parent
69c606d
commit ff7aef1
Showing
16 changed files
with
246 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// @file | ||
/// @brief Component @ref cubos::engine::Active | ||
/// @ingroup render-active-plugin | ||
#pragma once | ||
|
||
#include <cubos/core/reflection/reflect.hpp> | ||
|
||
namespace cubos::engine | ||
{ | ||
/// @brief Component which stores the active state for an entity. | ||
/// @note Added automatically once a specific camera or light is added. | ||
/// @ingroup render-active-plugin | ||
struct Active | ||
{ | ||
CUBOS_REFLECT; | ||
|
||
/// @brief Whether the entity is active. | ||
bool active = true; | ||
}; | ||
} // namespace cubos::engine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
#include <cubos/engine/api.hpp> | ||
#include <cubos/engine/prelude.hpp> | ||
#include <cubos/engine/render/active/active.hpp> | ||
|
||
namespace cubos::engine | ||
{ | ||
CUBOS_ENGINE_API void activePlugin(Cubos& cubos); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <cubos/core/ecs/reflection.hpp> | ||
#include <cubos/core/reflection/external/primitives.hpp> | ||
|
||
#include <cubos/engine/render/active/active.hpp> | ||
|
||
CUBOS_REFLECT_IMPL(cubos::engine::Active) | ||
{ | ||
return core::ecs::TypeBuilder<Active>("cubos::engine::Active").withField("active", &Active::active).build(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <cubos/engine/render/active/active.hpp> | ||
#include <cubos/engine/render/active/plugin.hpp> | ||
|
||
void cubos::engine::activePlugin(Cubos& cubos) | ||
{ | ||
cubos.component<Active>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.