From f1dec90759f5439ee52c744786fdc4523d27c386 Mon Sep 17 00:00:00 2001 From: Ricardo Antunes Date: Tue, 21 Nov 2023 12:57:11 +0000 Subject: [PATCH] chore: remove quadrados-gen attributes --- core/tests/ecs/utils.hpp | 12 ++++++------ docs/pages/2_features/ecs.md | 8 ++++++-- engine/include/cubos/engine/collisions/collider.hpp | 2 +- .../include/cubos/engine/collisions/shapes/box.hpp | 2 +- .../cubos/engine/collisions/shapes/capsule.hpp | 2 +- .../physics/components/accumulated_correction.hpp | 2 +- .../cubos/engine/physics/components/physics_mass.hpp | 2 +- .../engine/physics/components/physics_velocity.hpp | 2 +- .../engine/physics/components/previous_position.hpp | 2 +- engine/include/cubos/engine/renderer/camera.hpp | 2 +- .../cubos/engine/renderer/directional_light.hpp | 2 +- engine/include/cubos/engine/renderer/plugin.hpp | 8 ++++---- engine/include/cubos/engine/renderer/point_light.hpp | 2 +- engine/include/cubos/engine/renderer/spot_light.hpp | 2 +- .../cubos/engine/transform/local_to_world.hpp | 2 +- engine/include/cubos/engine/transform/position.hpp | 2 +- engine/include/cubos/engine/transform/rotation.hpp | 2 +- engine/include/cubos/engine/transform/scale.hpp | 2 +- engine/samples/hello-cubos/components.hpp | 2 +- engine/samples/scene/components.hpp | 4 ++-- 20 files changed, 34 insertions(+), 30 deletions(-) diff --git a/core/tests/ecs/utils.hpp b/core/tests/ecs/utils.hpp index 9f8ee4376..f785922d6 100644 --- a/core/tests/ecs/utils.hpp +++ b/core/tests/ecs/utils.hpp @@ -9,7 +9,7 @@ #include "../utils.hpp" /// A component which stores a single integer. -struct [[cubos::component("integer")]] IntegerComponent +struct IntegerComponent { CUBOS_REFLECT; @@ -17,7 +17,7 @@ struct [[cubos::component("integer")]] IntegerComponent }; /// A component which references another entity. -struct [[cubos::component("parent")]] ParentComponent +struct ParentComponent { CUBOS_REFLECT; @@ -25,21 +25,21 @@ struct [[cubos::component("parent")]] ParentComponent }; /// A component used to test if components are destructed properly. -struct [[cubos::component("detect_destructor")]] DetectDestructorComponent +struct DetectDestructorComponent { CUBOS_REFLECT; - [[cubos::ignore]] DetectDestructor detect; + DetectDestructor detect; }; -struct [[cubos::component("entity_array")]] EntityArrayComponent +struct EntityArrayComponent { CUBOS_REFLECT; std::vector vec; }; -struct [[cubos::component("entity_dictionary")]] EntityDictionaryComponent +struct EntityDictionaryComponent { CUBOS_REFLECT; diff --git a/docs/pages/2_features/ecs.md b/docs/pages/2_features/ecs.md index 4e9097b96..fe737d3c0 100644 --- a/docs/pages/2_features/ecs.md +++ b/docs/pages/2_features/ecs.md @@ -88,13 +88,17 @@ In **CUBOS.** there are no game objects. Instead, we would define two components and a `DeltaTime` resource: ```cpp -struct [[cubos::component("position")]] Position +struct Position { + CUBOS_REFLECT; + glm::vec3 vec = { 0.0f, 0.0f, 0.0f }; }; -struct [[cubos::component("velocity")]] Velocity +struct Velocity { + CUBOS_REFLECT; + glm::vec3 vec = { 0.0f, 0.0f, 0.0f }; }; diff --git a/engine/include/cubos/engine/collisions/collider.hpp b/engine/include/cubos/engine/collisions/collider.hpp index 1472c7f53..f2609ce27 100644 --- a/engine/include/cubos/engine/collisions/collider.hpp +++ b/engine/include/cubos/engine/collisions/collider.hpp @@ -13,7 +13,7 @@ namespace cubos::engine { /// @brief Component which adds a collider to an entity. /// @ingroup collisions-plugin - struct [[cubos::component("cubos/collider", VecStorage)]] Collider + struct Collider { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/collisions/shapes/box.hpp b/engine/include/cubos/engine/collisions/shapes/box.hpp index 89e1f791a..7db852f06 100644 --- a/engine/include/cubos/engine/collisions/shapes/box.hpp +++ b/engine/include/cubos/engine/collisions/shapes/box.hpp @@ -11,7 +11,7 @@ namespace cubos::engine { /// @brief Component which adds a box collision shape to an entity, used with a @ref Collider component. /// @ingroup collisions-plugin - struct [[cubos::component("cubos/box_collision_shape", VecStorage)]] BoxCollisionShape + struct BoxCollisionShape { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/collisions/shapes/capsule.hpp b/engine/include/cubos/engine/collisions/shapes/capsule.hpp index b373237f3..ea951eedd 100644 --- a/engine/include/cubos/engine/collisions/shapes/capsule.hpp +++ b/engine/include/cubos/engine/collisions/shapes/capsule.hpp @@ -11,7 +11,7 @@ namespace cubos::engine { /// @brief Component which adds a capsule collision shape to an entity, used with a @ref Collider component. /// @ingroup collisions-plugin - struct [[cubos::component("cubos/capsule_collision_shape", VecStorage)]] CapsuleCollisionShape + struct CapsuleCollisionShape { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/physics/components/accumulated_correction.hpp b/engine/include/cubos/engine/physics/components/accumulated_correction.hpp index 03cb9b33b..a7be7daa7 100644 --- a/engine/include/cubos/engine/physics/components/accumulated_correction.hpp +++ b/engine/include/cubos/engine/physics/components/accumulated_correction.hpp @@ -12,7 +12,7 @@ namespace cubos::engine { /// @brief Component which holds the corrections accumulated from the constraints solving. /// @ingroup physics-plugin - struct [[cubos::component("cubos/accumulated_correction", VecStorage)]] AccumulatedCorrection + struct AccumulatedCorrection { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/physics/components/physics_mass.hpp b/engine/include/cubos/engine/physics/components/physics_mass.hpp index 97d96eafb..f60d32ba2 100644 --- a/engine/include/cubos/engine/physics/components/physics_mass.hpp +++ b/engine/include/cubos/engine/physics/components/physics_mass.hpp @@ -12,7 +12,7 @@ namespace cubos::engine { /// @brief Component which defines the mass of a particle. /// @ingroup physics-plugin - struct [[cubos::component("cubos/physics_mass", VecStorage)]] PhysicsMass + struct PhysicsMass { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/physics/components/physics_velocity.hpp b/engine/include/cubos/engine/physics/components/physics_velocity.hpp index bc5e4c89e..6d0edc6c4 100644 --- a/engine/include/cubos/engine/physics/components/physics_velocity.hpp +++ b/engine/include/cubos/engine/physics/components/physics_velocity.hpp @@ -13,7 +13,7 @@ namespace cubos::engine /// @brief Component which holds velocity and forces applied on a particle. /// @note Should be used with @ref PhysicsMass and @ref Position. /// @ingroup physics-plugin - struct [[cubos::component("cubos/physics_velocity", VecStorage)]] PhysicsVelocity + struct PhysicsVelocity { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/physics/components/previous_position.hpp b/engine/include/cubos/engine/physics/components/previous_position.hpp index dc75f090d..8d2517cd6 100644 --- a/engine/include/cubos/engine/physics/components/previous_position.hpp +++ b/engine/include/cubos/engine/physics/components/previous_position.hpp @@ -13,7 +13,7 @@ namespace cubos::engine /// @brief Component which holds the previous position of the entity. /// Used for the integrator on the update velocity step. /// @ingroup physics-plugin - struct [[cubos::component("cubos/previous_position", VecStorage)]] PreviousPosition + struct PreviousPosition { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/renderer/camera.hpp b/engine/include/cubos/engine/renderer/camera.hpp index 0ffeade19..38e622f84 100644 --- a/engine/include/cubos/engine/renderer/camera.hpp +++ b/engine/include/cubos/engine/renderer/camera.hpp @@ -11,7 +11,7 @@ namespace cubos::engine /// @brief Component which defines parameters of a camera used to render the world. /// @note Should be used with @ref LocalToWorld. /// @ingroup renderer-plugin - struct [[cubos::component("cubos/camera", VecStorage)]] Camera + struct Camera { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/renderer/directional_light.hpp b/engine/include/cubos/engine/renderer/directional_light.hpp index b0e584cc8..81b1dc729 100644 --- a/engine/include/cubos/engine/renderer/directional_light.hpp +++ b/engine/include/cubos/engine/renderer/directional_light.hpp @@ -14,7 +14,7 @@ namespace cubos::engine /// @note Should be used with @ref LocalToWorld. /// @todo In what direction does the light point for an identity transform? /// @ingroup renderer-plugin - struct [[cubos::component("cubos/directional_light", VecStorage)]] DirectionalLight + struct DirectionalLight { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/renderer/plugin.hpp b/engine/include/cubos/engine/renderer/plugin.hpp index 04be62196..3969fbeeb 100644 --- a/engine/include/cubos/engine/renderer/plugin.hpp +++ b/engine/include/cubos/engine/renderer/plugin.hpp @@ -68,13 +68,13 @@ namespace cubos::engine /// @brief Component which makes a voxel grid be rendered by the renderer plugin. /// @note Should be used with @ref LocalToWorld. /// @ingroup renderer-plugin - struct [[cubos::component("cubos/renderable_grid", VecStorage)]] RenderableGrid + struct RenderableGrid { CUBOS_REFLECT; - Asset asset; ///< Handle to the grid asset to be rendered. - glm::vec3 offset = {0.0F, 0.0F, 0.0F}; ///< Translation applied to the voxel grid before any other. - [[cubos::ignore]] RendererGrid handle = nullptr; ///< Handle to the uploaded grid - set automatically. + Asset asset; ///< Handle to the grid asset to be rendered. + glm::vec3 offset = {0.0F, 0.0F, 0.0F}; ///< Translation applied to the voxel grid before any other. + RendererGrid handle = nullptr; ///< Handle to the uploaded grid - set automatically. }; /// @brief Resource which identifies the camera entities to be used by the renderer. diff --git a/engine/include/cubos/engine/renderer/point_light.hpp b/engine/include/cubos/engine/renderer/point_light.hpp index 842aeb8de..95365a744 100644 --- a/engine/include/cubos/engine/renderer/point_light.hpp +++ b/engine/include/cubos/engine/renderer/point_light.hpp @@ -13,7 +13,7 @@ namespace cubos::engine /// @brief Component which makes an entity behave like a point light. /// @note Should be used with @ref LocalToWorld. /// @ingroup renderer-plugin - struct [[cubos::component("cubos/point_light", VecStorage)]] PointLight + struct PointLight { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/renderer/spot_light.hpp b/engine/include/cubos/engine/renderer/spot_light.hpp index bd4ea6171..489ef015b 100644 --- a/engine/include/cubos/engine/renderer/spot_light.hpp +++ b/engine/include/cubos/engine/renderer/spot_light.hpp @@ -14,7 +14,7 @@ namespace cubos::engine /// @note Should be used with @ref LocalToWorld. /// @todo In what direction does the spot light point for an identity transform? /// @ingroup renderer-plugin - struct [[cubos::component("cubos/spot_light", VecStorage)]] SpotLight + struct SpotLight { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/transform/local_to_world.hpp b/engine/include/cubos/engine/transform/local_to_world.hpp index 976c11236..9e0a16625 100644 --- a/engine/include/cubos/engine/transform/local_to_world.hpp +++ b/engine/include/cubos/engine/transform/local_to_world.hpp @@ -21,7 +21,7 @@ namespace cubos::engine /// @sa Rotation Applies a rotation to this matrix. /// @sa Scale Applies a scaling to this matrix. /// @ingroup transform-plugin - struct [[cubos::component("cubos/local_to_world", VecStorage)]] LocalToWorld + struct LocalToWorld { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/transform/position.hpp b/engine/include/cubos/engine/transform/position.hpp index b4742bdef..9f4dc05b4 100644 --- a/engine/include/cubos/engine/transform/position.hpp +++ b/engine/include/cubos/engine/transform/position.hpp @@ -13,7 +13,7 @@ namespace cubos::engine /// @brief Component which assigns a position to an entity. /// @sa LocalToWorld Holds the resulting transform matrix. /// @ingroup transform-plugin - struct [[cubos::component("cubos/position", VecStorage)]] Position + struct Position { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/transform/rotation.hpp b/engine/include/cubos/engine/transform/rotation.hpp index 6f8337ddf..5c61dae58 100644 --- a/engine/include/cubos/engine/transform/rotation.hpp +++ b/engine/include/cubos/engine/transform/rotation.hpp @@ -13,7 +13,7 @@ namespace cubos::engine /// @brief Component which assigns a rotation to an entity. /// @sa LocalToWorld Holds the resulting transform matrix. /// @ingroup transform-plugin - struct [[cubos::component("cubos/rotation", VecStorage)]] Rotation + struct Rotation { CUBOS_REFLECT; diff --git a/engine/include/cubos/engine/transform/scale.hpp b/engine/include/cubos/engine/transform/scale.hpp index 738cf13b9..916d426ed 100644 --- a/engine/include/cubos/engine/transform/scale.hpp +++ b/engine/include/cubos/engine/transform/scale.hpp @@ -11,7 +11,7 @@ namespace cubos::engine /// @brief Component which assigns a uniform scale to an entity. /// @sa LocalToWorld Holds the resulting transform matrix. /// @ingroup transform-plugin - struct [[cubos::component("cubos/scale", VecStorage)]] Scale + struct Scale { CUBOS_REFLECT; diff --git a/engine/samples/hello-cubos/components.hpp b/engine/samples/hello-cubos/components.hpp index 96cd8e1fd..11c782f65 100644 --- a/engine/samples/hello-cubos/components.hpp +++ b/engine/samples/hello-cubos/components.hpp @@ -3,7 +3,7 @@ #include #include -struct [[cubos::component("num", VecStorage)]] Num +struct Num { CUBOS_REFLECT; diff --git a/engine/samples/scene/components.hpp b/engine/samples/scene/components.hpp index 38279c9db..45ddc33db 100644 --- a/engine/samples/scene/components.hpp +++ b/engine/samples/scene/components.hpp @@ -3,14 +3,14 @@ #include #include -struct [[cubos::component("num", VecStorage)]] Num +struct Num { CUBOS_REFLECT; int value; }; -struct [[cubos::component("parent", VecStorage)]] Parent +struct Parent { CUBOS_REFLECT;