Skip to content

Commit

Permalink
chore: remove quadrados-gen attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Nov 27, 2023
1 parent eac100c commit f1dec90
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 30 deletions.
12 changes: 6 additions & 6 deletions core/tests/ecs/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@
#include "../utils.hpp"

/// A component which stores a single integer.
struct [[cubos::component("integer")]] IntegerComponent
struct IntegerComponent
{
CUBOS_REFLECT;

int value;
};

/// A component which references another entity.
struct [[cubos::component("parent")]] ParentComponent
struct ParentComponent
{
CUBOS_REFLECT;

cubos::core::ecs::Entity id;
};

/// 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<cubos::core::ecs::Entity> vec;
};

struct [[cubos::component("entity_dictionary")]] EntityDictionaryComponent
struct EntityDictionaryComponent
{
CUBOS_REFLECT;

Expand Down
8 changes: 6 additions & 2 deletions docs/pages/2_features/ecs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
};
Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/collisions/collider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/collisions/shapes/box.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/collisions/shapes/capsule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/renderer/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/renderer/directional_light.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions engine/include/cubos/engine/renderer/plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<VoxelGrid> 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<VoxelGrid> 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.
Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/renderer/point_light.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/renderer/spot_light.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/transform/local_to_world.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/transform/position.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/transform/rotation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion engine/include/cubos/engine/transform/scale.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion engine/samples/hello-cubos/components.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <cubos/core/ecs/world.hpp>
#include <cubos/core/reflection/reflect.hpp>

struct [[cubos::component("num", VecStorage)]] Num
struct Num
{
CUBOS_REFLECT;

Expand Down
4 changes: 2 additions & 2 deletions engine/samples/scene/components.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
#include <cubos/core/ecs/entity/entity.hpp>
#include <cubos/core/reflection/reflect.hpp>

struct [[cubos::component("num", VecStorage)]] Num
struct Num
{
CUBOS_REFLECT;

int value;
};

struct [[cubos::component("parent", VecStorage)]] Parent
struct Parent
{
CUBOS_REFLECT;

Expand Down

0 comments on commit f1dec90

Please sign in to comment.