From 0544047cd56786def317731ac17e88abe6b08d71 Mon Sep 17 00:00:00 2001 From: Dacops Date: Tue, 30 Jan 2024 15:31:32 +0000 Subject: [PATCH] =?UTF-8?q?Deploy=20preview=20for=20PR=20862=20?= =?UTF-8?q?=F0=9F=9B=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs-preview/pr-862/access_8hpp.html | 134 ++++ docs-preview/pr-862/annotated.html | 101 ++- .../pr-862/archetype__graph_8hpp.html | 134 ++++ docs-preview/pr-862/archetype__id_8hpp.html | 138 ++++ docs-preview/pr-862/blueprint_8hpp.html | 2 +- ...ubos_1_1core_1_1ecs_1_1ArchetypeGraph.html | 334 ++++++++ ...lasscubos_1_1core_1_1ecs_1_1Blueprint.html | 131 +++- ...cubos_1_1core_1_1ecs_1_1CommandBuffer.html | 225 +++--- ...classcubos_1_1core_1_1ecs_1_1Commands.html | 344 +++++++-- ...> classcubos_1_1core_1_1ecs_1_1Cubos.html} | 118 +-- ...asscubos_1_1core_1_1ecs_1_1DenseTable.html | 391 ++++++++++ ...1_1core_1_1ecs_1_1DenseTableRegistry.html} | 118 ++- ...sscubos_1_1core_1_1ecs_1_1EntityPool.html} | 142 ++-- ... => classcubos_1_1core_1_1ecs_1_1Opt.html} | 134 +++- .../classcubos_1_1core_1_1ecs_1_1Query.html | 137 ++-- ...lasscubos_1_1core_1_1ecs_1_1QueryData.html | 286 +++++++ ...scubos_1_1core_1_1ecs_1_1QueryFetcher.html | 254 ++++++ ...scubos_1_1core_1_1ecs_1_1QueryFilter.html} | 121 +-- ...cubos_1_1core_1_1ecs_1_1RelationTable.html | 451 ----------- ...bos_1_1core_1_1ecs_1_1ResourceManager.html | 4 +- ...1_1core_1_1ecs_1_1SparseRelationTable.html | 715 +++++++++++++++++ ...1_1ecs_1_1SparseRelationTableRegistry.html | 415 ++++++++++ ...seRelationTableRegistry_1_1TypeIndex.html} | 104 ++- ...ubos_1_1core_1_1ecs_1_1SystemBuilder.html} | 38 +- ... classcubos_1_1core_1_1ecs_1_1Tables.html} | 103 ++- ...sscubos_1_1core_1_1ecs_1_1TagBuilder.html} | 32 +- ...scubos_1_1core_1_1ecs_1_1TypeBuilder.html} | 82 +- .../classcubos_1_1core_1_1ecs_1_1Types.html | 400 ++++++++++ .../classcubos_1_1core_1_1ecs_1_1World.html | 720 ++++++++++++++++-- ...scubos_1_1core_1_1memory_1_1AnyVector.html | 139 ++++ .../classcubos_1_1engine_1_1BaseRenderer.html | 34 +- ...sscubos_1_1engine_1_1DeferredRenderer.html | 20 +- ...classcubos_1_1engine_1_1RendererFrame.html | 16 +- .../classcubos_1_1engine_1_1ScreenPicker.html | 2 +- docs-preview/pr-862/column_8hpp.html | 134 ++++ docs-preview/pr-862/command__buffer_8hpp.html | 136 ++++ docs-preview/pr-862/commands_8hpp.html | 14 +- docs-preview/pr-862/cubos_8hpp.html | 24 +- docs-preview/pr-862/data_8hpp.html | 135 ++++ docs-preview/pr-862/dense_2registry_8hpp.html | 134 ++++ docs-preview/pr-862/dense_2table_8hpp.html | 134 ++++ .../dir_0b39c986537c7114081f36bbdae17547.html | 132 ++++ .../dir_1849b6590c20a7c40f18c0337f505edf.html | 6 +- .../dir_26a5878ebb5e9988b6ffa6f152301254.html | 130 ++++ .../dir_3764e76d8ec4e739fc24b5bb90adc3af.html | 6 + ...dir_57aff98960b24114775613a58ec786ad.html} | 10 +- .../dir_649da4752b4164834ba68d7c258c03a8.html | 2 - .../dir_6e3f4c3139d5f8b4a400c5df04d1a451.html | 4 +- ...dir_9f228de11f2fc2633236213a3ef5c992.html} | 19 +- .../dir_b6daa990b896c2c0c53126427e4d978d.html | 14 +- .../dir_bafb7af0e03e95b24a45ff63060ab57b.html | 12 +- ...dir_c1b5957eb0512b9978230dfb34d9655b.html} | 14 +- ...2engine_2screen__picker_2plugin_8hpp.html} | 6 +- .../pr-862/examples-engine-assets-bridge.html | 8 +- .../pr-862/examples-engine-assets-json.html | 8 +- .../pr-862/examples-engine-assets-saving.html | 10 +- .../pr-862/examples-engine-events.html | 10 +- .../pr-862/examples-engine-gizmos.html | 54 +- .../pr-862/examples-engine-hello-cubos.html | 22 +- .../pr-862/examples-engine-imgui.html | 12 +- .../pr-862/examples-engine-input.html | 26 +- .../pr-862/examples-engine-renderer.html | 26 +- .../pr-862/examples-engine-scene.html | 6 +- .../pr-862/examples-engine-settings.html | 6 +- .../pr-862/examples-engine-voxels.html | 10 +- docs-preview/pr-862/examples-engine.html | 2 +- docs-preview/pr-862/features-ecs.html | 14 +- docs-preview/pr-862/features-plugins.html | 8 +- ...reflection_8hpp.html => fetcher_8hpp.html} | 10 +- docs-preview/pr-862/files.html | 54 +- docs-preview/pr-862/filter_8hpp.html | 138 ++++ .../pr-862/fixed__delta__time_8hpp.html | 2 +- .../pr-862/group__collisions-plugin.html | 6 + .../pr-862/group__core-ecs-component.html | 2 - .../pr-862/group__core-ecs-entity.html | 18 + .../pr-862/group__core-ecs-query.html | 164 ++++ .../pr-862/group__core-ecs-system.html | 44 +- .../pr-862/group__core-ecs-table.html | 161 ++++ docs-preview/pr-862/group__core-ecs.html | 49 +- docs-preview/pr-862/group__engine.html | 30 +- .../pr-862/group__physics-plugin.html | 6 +- ....html => group__screen-picker-plugin.html} | 8 +- .../pr-862/group__settings-plugin.html | 2 +- ...oup__tesseratos-asset-explorer-plugin.html | 4 +- ...group__tesseratos-debug-camera-plugin.html | 4 +- ...p__tesseratos-entity-inspector-plugin.html | 4 +- ...up__tesseratos-entity-selector-plugin.html | 4 +- ...roup__tesseratos-metrics-panel-plugin.html | 4 +- ...group__tesseratos-scene-editor-plugin.html | 4 +- ..._tesseratos-settings-inspector-plugin.html | 4 +- .../group__tesseratos-toolbox-plugin.html | 4 +- ...up__tesseratos-transform-gizmo-plugin.html | 4 +- ...esseratos-voxel-palette-editor-plugin.html | 4 +- ...up__tesseratos-world-inspector-plugin.html | 4 +- docs-preview/pr-862/group__tesseratos.html | 4 +- docs-preview/pr-862/group__window-plugin.html | 2 +- docs-preview/pr-862/id_8hpp.html | 140 ++++ docs-preview/pr-862/modules.html | 5 +- .../pr-862/namespacecubos_1_1core_1_1ecs.html | 203 ++++- ...namespacecubos_1_1core_1_1ecs_1_1impl.html | 5 - .../pr-862/namespacecubos_1_1engine.html | 209 ++--- docs-preview/pr-862/namespacetesseratos.html | 24 +- ...nt_2reflection_8hpp.html => opt_8hpp.html} | 10 +- docs-preview/pr-862/pages.html | 2 +- docs-preview/pr-862/pool_8hpp.html | 134 ++++ ...=> potentially__colliding__with_8hpp.html} | 14 +- docs-preview/pr-862/query_8hpp.html | 20 +- .../{table_8hpp.html => reflection_8hpp.html} | 19 +- .../pr-862/resources_2gravity_8hpp.html | 2 +- ...ker_8hpp.html => screen__picker_8hpp.html} | 4 +- docs-preview/pr-862/searchdata-v2.js | 2 +- .../sparse__relation_2registry_8hpp.html | 138 ++++ ...html => sparse__relation_2table_8hpp.html} | 26 +- ...ctcubos_1_1core_1_1ecs_1_1ArchetypeId.html | 173 +++++ ...os_1_1core_1_1ecs_1_1ArchetypeIdHash.html} | 8 +- ...uctcubos_1_1core_1_1ecs_1_1Arguments.html} | 12 +- ...tructcubos_1_1core_1_1ecs_1_1ColumnId.html | 271 +++++++ ...ctcubos_1_1core_1_1ecs_1_1DataTypeId.html} | 51 +- ...ubos_1_1core_1_1ecs_1_1DataTypeIdHash.html | 103 +++ ...uctcubos_1_1core_1_1ecs_1_1DeltaTime.html} | 12 +- ...ctcubos_1_1core_1_1ecs_1_1QueryAccess.html | 171 +++++ ...ryFilter_1_1View_1_1Iterator_1_1Match.html | 123 +++ ...ructcubos_1_1core_1_1ecs_1_1QueryTerm.html | 532 +++++++++++++ ...core_1_1ecs_1_1QueryTerm_1_1Component.html | 131 ++++ ..._1core_1_1ecs_1_1QueryTerm_1_1Entity.html} | 18 +- ...1core_1_1ecs_1_1QueryTerm_1_1Relation.html | 131 ++++ ...ctcubos_1_1core_1_1ecs_1_1ShouldQuit.html} | 12 +- ...core_1_1ecs_1_1SparseRelationTableId.html} | 99 ++- ...e_1_1ecs_1_1SparseRelationTableIdHash.html | 103 +++ ...eRelationTable_1_1Iterator_1_1Output.html} | 20 +- ...nTable_1_1View_1_1Iterator_1_1Output.html} | 20 +- ...ubos_1_1core_1_1ecs_1_1SymmetricTrait.html | 104 +++ ...uctcubos_1_1core_1_1ecs_1_1SystemInfo.html | 8 - ...uctcubos_1_1core_1_1ecs_1_1TreeTrait.html} | 22 +- ...1core_1_1ecs_1_1impl_1_1SystemFetcher.html | 6 +- ...cubos_1_1core_1_1gl_1_1BlendStateDesc.html | 8 +- ...tcubos_1_1core_1_1gl_1_1VertexElement.html | 4 +- ...bos_1_1engine_1_1BroadPhaseCandidates.html | 246 ------ ...ructcubos_1_1engine_1_1FixedDeltaTime.html | 2 +- .../structcubos_1_1engine_1_1Gravity.html | 2 +- ...1_1engine_1_1PotentiallyCollidingWith.html | 103 +++ ...1_1engine_1_1RendererFrame_1_1DrawCmd.html | 4 + .../structcubos_1_1engine_1_1Substeps.html | 2 +- docs-preview/pr-862/substeps_8hpp.html | 2 +- docs-preview/pr-862/tables_8hpp.html | 134 ++++ docs-preview/pr-862/term_8hpp.html | 158 ++++ ...seratos_2asset__explorer_2plugin_8hpp.html | 2 +- ...esseratos_2debug__camera_2plugin_8hpp.html | 2 +- ...ratos_2entity__inspector_2plugin_8hpp.html | 2 +- ...eratos_2entity__selector_2plugin_8hpp.html | 2 +- ...sseratos_2metrics__panel_2plugin_8hpp.html | 2 +- ...tos_2include_2tesseratos_2plugin_8hpp.html | 2 +- ...esseratos_2scene__editor_2plugin_8hpp.html | 2 +- ...tos_2settings__inspector_2plugin_8hpp.html | 2 +- ...ude_2tesseratos_2toolbox_2plugin_8hpp.html | 2 +- ...eratos_2transform__gizmo_2plugin_8hpp.html | 2 +- ..._2voxel__palette__editor_2plugin_8hpp.html | 2 +- ...eratos_2world__inspector_2plugin_8hpp.html | 2 +- docs-preview/pr-862/types_8hpp.html | 142 ++++ docs-preview/pr-862/world_8hpp.html | 2 - 160 files changed, 10247 insertions(+), 2224 deletions(-) create mode 100644 docs-preview/pr-862/access_8hpp.html create mode 100644 docs-preview/pr-862/archetype__graph_8hpp.html create mode 100644 docs-preview/pr-862/archetype__id_8hpp.html create mode 100644 docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1ArchetypeGraph.html rename docs-preview/pr-862/{classcubos_1_1engine_1_1Cubos.html => classcubos_1_1core_1_1ecs_1_1Cubos.html} (61%) create mode 100644 docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1DenseTable.html rename docs-preview/pr-862/{classcubos_1_1core_1_1ecs_1_1ComponentTypeBuilder.html => classcubos_1_1core_1_1ecs_1_1DenseTableRegistry.html} (60%) rename docs-preview/pr-862/{classcubos_1_1core_1_1ecs_1_1BlueprintBuilder.html => classcubos_1_1core_1_1ecs_1_1EntityPool.html} (52%) rename docs-preview/pr-862/{classcubos_1_1core_1_1ecs_1_1OptWrite.html => classcubos_1_1core_1_1ecs_1_1Opt.html} (55%) create mode 100644 docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1QueryData.html create mode 100644 docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1QueryFetcher.html rename docs-preview/pr-862/{classcubos_1_1core_1_1ecs_1_1OptRead.html => classcubos_1_1core_1_1ecs_1_1QueryFilter.html} (56%) delete mode 100644 docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1RelationTable.html create mode 100644 docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SparseRelationTable.html create mode 100644 docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SparseRelationTableRegistry.html rename docs-preview/pr-862/{classcubos_1_1core_1_1ecs_1_1EntityBuilder.html => classcubos_1_1core_1_1ecs_1_1SparseRelationTableRegistry_1_1TypeIndex.html} (60%) rename docs-preview/pr-862/{classcubos_1_1engine_1_1SystemBuilder.html => classcubos_1_1core_1_1ecs_1_1SystemBuilder.html} (75%) rename docs-preview/pr-862/{classcubos_1_1core_1_1ecs_1_1Write.html => classcubos_1_1core_1_1ecs_1_1Tables.html} (58%) rename docs-preview/pr-862/{classcubos_1_1engine_1_1TagBuilder.html => classcubos_1_1core_1_1ecs_1_1TagBuilder.html} (77%) rename docs-preview/pr-862/{classcubos_1_1core_1_1ecs_1_1RelationTypeBuilder.html => classcubos_1_1core_1_1ecs_1_1TypeBuilder.html} (64%) create mode 100644 docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Types.html create mode 100644 docs-preview/pr-862/column_8hpp.html create mode 100644 docs-preview/pr-862/command__buffer_8hpp.html create mode 100644 docs-preview/pr-862/data_8hpp.html create mode 100644 docs-preview/pr-862/dense_2registry_8hpp.html create mode 100644 docs-preview/pr-862/dense_2table_8hpp.html create mode 100644 docs-preview/pr-862/dir_0b39c986537c7114081f36bbdae17547.html create mode 100644 docs-preview/pr-862/dir_26a5878ebb5e9988b6ffa6f152301254.html rename docs-preview/pr-862/{dir_cae59223029cd41c022c5f7665ca4fec.html => dir_57aff98960b24114775613a58ec786ad.html} (92%) rename docs-preview/pr-862/{group__core-ecs-relation.html => dir_9f228de11f2fc2633236213a3ef5c992.html} (80%) rename docs-preview/pr-862/{dir_23da5564a3f2709d1d4bc8981f00e961.html => dir_c1b5957eb0512b9978230dfb34d9655b.html} (87%) rename docs-preview/pr-862/{engine_2include_2cubos_2engine_2screenpicker_2plugin_8hpp.html => engine_2include_2cubos_2engine_2screen__picker_2plugin_8hpp.html} (94%) rename docs-preview/pr-862/{relation_2reflection_8hpp.html => fetcher_8hpp.html} (90%) create mode 100644 docs-preview/pr-862/filter_8hpp.html create mode 100644 docs-preview/pr-862/group__core-ecs-query.html create mode 100644 docs-preview/pr-862/group__core-ecs-table.html rename docs-preview/pr-862/{group__screenpicker-plugin.html => group__screen-picker-plugin.html} (94%) create mode 100644 docs-preview/pr-862/id_8hpp.html rename docs-preview/pr-862/{component_2reflection_8hpp.html => opt_8hpp.html} (90%) create mode 100644 docs-preview/pr-862/pool_8hpp.html rename docs-preview/pr-862/{candidates_8hpp.html => potentially__colliding__with_8hpp.html} (89%) rename docs-preview/pr-862/{table_8hpp.html => reflection_8hpp.html} (83%) rename docs-preview/pr-862/{screenpicker_8hpp.html => screen__picker_8hpp.html} (96%) create mode 100644 docs-preview/pr-862/sparse__relation_2registry_8hpp.html rename docs-preview/pr-862/{accessors_8hpp.html => sparse__relation_2table_8hpp.html} (77%) create mode 100644 docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ArchetypeId.html rename docs-preview/pr-862/{structcubos_1_1engine_1_1BroadPhaseCandidates_1_1CandidateHash.html => structcubos_1_1core_1_1ecs_1_1ArchetypeIdHash.html} (90%) rename docs-preview/pr-862/{structcubos_1_1engine_1_1Arguments.html => structcubos_1_1core_1_1ecs_1_1Arguments.html} (90%) create mode 100644 docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ColumnId.html rename docs-preview/pr-862/{classcubos_1_1core_1_1ecs_1_1Query_1_1Iterator.html => structcubos_1_1core_1_1ecs_1_1DataTypeId.html} (69%) create mode 100644 docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1DataTypeIdHash.html rename docs-preview/pr-862/{structcubos_1_1engine_1_1DeltaTime.html => structcubos_1_1core_1_1ecs_1_1DeltaTime.html} (92%) create mode 100644 docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryAccess.html create mode 100644 docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryFilter_1_1View_1_1Iterator_1_1Match.html create mode 100644 docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm.html create mode 100644 docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Component.html rename docs-preview/pr-862/{structcubos_1_1core_1_1ecs_1_1QueryInfo.html => structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Entity.html} (88%) create mode 100644 docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Relation.html rename docs-preview/pr-862/{structcubos_1_1engine_1_1ShouldQuit.html => structcubos_1_1core_1_1ecs_1_1ShouldQuit.html} (91%) rename docs-preview/pr-862/{classcubos_1_1core_1_1ecs_1_1Read.html => structcubos_1_1core_1_1ecs_1_1SparseRelationTableId.html} (65%) create mode 100644 docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1SparseRelationTableIdHash.html rename docs-preview/pr-862/{structcubos_1_1core_1_1ecs_1_1RelationTable_1_1Iterator_1_1Output.html => structcubos_1_1core_1_1ecs_1_1SparseRelationTable_1_1Iterator_1_1Output.html} (84%) rename docs-preview/pr-862/{structcubos_1_1core_1_1ecs_1_1RelationTable_1_1View_1_1Iterator_1_1Output.html => structcubos_1_1core_1_1ecs_1_1SparseRelationTable_1_1View_1_1Iterator_1_1Output.html} (82%) create mode 100644 docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1SymmetricTrait.html rename docs-preview/pr-862/{structcubos_1_1core_1_1ecs_1_1impl_1_1QueryFetcher.html => structcubos_1_1core_1_1ecs_1_1TreeTrait.html} (83%) delete mode 100644 docs-preview/pr-862/structcubos_1_1engine_1_1BroadPhaseCandidates.html create mode 100644 docs-preview/pr-862/structcubos_1_1engine_1_1PotentiallyCollidingWith.html create mode 100644 docs-preview/pr-862/tables_8hpp.html create mode 100644 docs-preview/pr-862/term_8hpp.html create mode 100644 docs-preview/pr-862/types_8hpp.html diff --git a/docs-preview/pr-862/access_8hpp.html b/docs-preview/pr-862/access_8hpp.html new file mode 100644 index 000000000..3a71d36ed --- /dev/null +++ b/docs-preview/pr-862/access_8hpp.html @@ -0,0 +1,134 @@ + + + + + core/ecs/query/access.hpp file | CUBOS. Docs + + + + + + + +
+
+ + + + + + diff --git a/docs-preview/pr-862/annotated.html b/docs-preview/pr-862/annotated.html index 4b38f5543..a7ef2e930 100644 --- a/docs-preview/pr-862/annotated.html +++ b/docs-preview/pr-862/annotated.html @@ -104,23 +104,31 @@

Classes

namespace impl Contains functions used internally by the implementation of the ECS.
  • class AnySystemWrapper Base class for system wrappers.
  • -
  • class Blueprint final Collection of entities and their respective components.
  • -
  • class BlueprintBuilder final Used to edit a blueprint spawned by a Commands object.
  • +
  • struct ArchetypeId Identifies an archetype.
  • +
  • struct ArchetypeIdHash Hash functor for ArchetypeId.
  • +
  • struct Arguments Resource which stores the command-line arguments.
  • +
  • class Blueprint final Collection of entities and their respective components and relations.
  • +
  • struct ColumnId Identifies a data column type.
  • +
  • class CommandBuffer final Stores commands to execute them later.
  • class Commands final System argument used to write ECS commands and execute them at a later time.
  • class ComponentManager final Holds and manages components.
  • -
  • class ComponentTypeBuilder Builder for reflection::Type objects which represent component types.
  • +
  • class Cubos final Represents the engine itself, and exposes the interface with which the game developer interacts with. Ties up all the different parts of the engine together.
  • +
  • struct DataTypeId Identifies a data type registered in the world.
  • +
  • struct DataTypeIdHash Hash functor for DataTypeId.
  • +
  • struct DeltaTime Resource which stores the time since the last iteration of the main loop started.
  • +
  • class DenseTable final Stores the dense data associated to entities of a given archetype.
  • +
  • class DenseTableRegistry final Stores the dense tables of a given world.
  • struct Entity Identifies an entity.
  • -
  • class EntityBuilder final Allows editing an entity created by a Commands object.
  • struct EntityHash Used to hash Entity objects.
  • class Iterator Used to iterate over all entities in a manager with a certain component mask.
  • +
  • class EventWriter System argument which allows the system to send events of type T to other systems.
  • -
  • class OptRead System argument which provides read access to the resource T if it exists, or query argument which provides read access to the component T if it exists.
  • -
  • class OptWrite System argument which provides write access to the resource T if it exists, or query argument which provides write access to the component T if it exists.
  • +
  • class Opt Wrapper for reference types to indicate that the given argument type is optional in a query.
  • +
  • class Query System argument which holds the result of a query over all entities in world which match the given arguments.
  • +
  • struct QueryAccess Describes the types of data a query accesses.
  • +
  • class QueryData Holds the data necessary to execute a query.
  • +
  • class QueryFetcher Type meant to be specialized which implements for each argument type the necessary logic to extract it from the tables.
  • -
  • struct QueryInfo Describes a query.
  • -
  • class Read System argument which provides read access to the resource T, or query argument which provides read access to the component T.
  • -
  • class ReadResource Utility struct used to reference a resource of type T for reading.
  • -
  • class RelationTypeBuilder Builder for reflection::Type objects which represent relation types.
  • +
  • class ReadResource Utility struct used to reference a resource of type T for reading.
  • +
  • struct ShouldQuit Resource used as a flag to indicate whether the main loop should stop running.
  • + +
  • struct SparseRelationTableId Identifies a sparse relation table.
  • +
  • struct SparseRelationTableIdHash Hash functor for SparseRelationTableId.
  • +
  • class Storage final Stores the components of a given type.
  • +
  • struct SymmetricTrait Trait used to identify symmetric relations.
  • +
  • class SystemBuilder Used to chain configurations related to systems.
  • struct SystemInfo Describes a system.
  • class SystemWrapper final Wrapper for a system of type F.
  • +
  • class Tables final Stores the tables of a given world.
  • +
  • class TagBuilder Used to chain configurations related to tags.
  • +
  • struct TreeTrait Trait used to identify tree relations.
  • +
  • class TypeBuilder Builder for reflection::Type objects which represent ECS types.
  • +
  • class World Holds entities, their components and resources.
  • -
  • class Write System argument which provides write access to the resource T, or query argument which provides write access to the component T.
  • class WriteResource Utility struct used to reference a resource of type T for writing.
  • @@ -347,7 +389,6 @@

    Classes

  • struct ActiveCameras Resource which identifies the camera entities to be used by the renderer.
  • struct ActiveVoxelPalette Resource which holds an asset handle to the currently active palette.
  • class AnyAsset Handle to an asset of any type. May either be weak or strong. Weak handles do not guarantee the asset is loaded, while strong handles do.
  • -
  • struct Arguments Resource which stores the command-line arguments.
  • class Asset Handle to an asset of a specific type.
  • class AssetBridge Bridges are the objects responsible for loading and saving assets from/to disk. They form the bridge between the asset manager and the virtual file system.
  • class BinaryBridge Bridge for loading and saving assets which are serialized to and from a binary file.
  • struct BoxCollisionShape Component which adds a box collision shape to an entity, used with a Collider component.
  • -
  • struct Camera Component which defines parameters of a camera used to render the world.
  • struct CapsuleCollisionShape Component which adds a capsule collision shape to an entity, used with a Collider component.
  • struct Collider Component which adds a collider to an entity.
  • struct CollisionEvent Represents a collision event.
  • -
  • class Cubos final Represents the engine itself, and exposes the interface with which the game developer interacts with. Ties up all the different parts of the engine together.
  • struct Damping Resource which holds the damping value for integration.
  • class DataInspector final Resource which allows the user to inspect or modify any reflectable value on the UI.
  • class DeferredRenderer Renderer implementation which uses deferred rendering.
  • -
  • struct DeltaTime Resource which stores the time since the last iteration of the main loop started.
  • struct DirectionalLight Component which makes an entity behave like a directional light.
  • class FileBridge Abstract bridge type defined to reduce boilerplate code in bridge implementations which open a single file to load and save assets.
  • -
  • struct FixedDeltaTime Resouce which holds the value of the fixed delta for the physics update.
  • +
  • struct FixedDeltaTime Resource which holds the value of the fixed delta for the physics update.
  • struct FreeCameraController Component which moves the camera.
  • class Gizmo Class that describes a type of gizmo.
  • -
  • struct Gravity Resouce which holds the global value of gravity.
  • +
  • struct Gravity Resource which holds the global value of gravity.
  • class Input final Resource which stores the input bindings for multiple players.
  • class InputAction final Stores the state of a single input action, such as "jump" or "attack".
  • class InputAxis final Stores the state of a single input axis, such as "move forward" or "move right".
  • @@ -411,6 +444,7 @@

    Classes

  • class PostProcessingCopy A simple post processing pass that copies the input texture to the output.
  • class PostProcessingManager final Responsible for managing the post processing passes.
  • class PostProcessingPass A generic post processing pass.
  • +
  • struct PotentiallyCollidingWith Component which represents a potential collisions.
  • struct PreviousPosition Component which holds the previous position of the entity. Used for the integrator on the update velocity step.
  • struct RenderableGrid Component which makes a voxel grid be rendered by the renderer plugin.
  • struct RendererEnvironment Resource which stores the renderer's ambient light and sky colors.
  • @@ -426,11 +460,8 @@

    Classes

  • class SceneBridge Bridge which loads and saves Scene assets.
  • class ScreenPicker final Resource which provides a texture to store entity/gizmo ids, for selection with a mouse.
  • class Settings final Stores settings as key-value pairs and provides methods to retrieve them.
  • -
  • struct ShouldQuit Resource used as a flag to indicate whether the main loop should stop running.
  • struct SpotLight Component which makes an entity emit a spot light.
  • -
  • struct Substeps Resouce which holds the amount of substeps for the physics update.
  • -
  • class SystemBuilder Used to chain configurations related to systems.
  • -
  • class TagBuilder Used to chain configurations related to tags.
  • +
  • struct Substeps Resource which holds the amount of substeps for the physics update.
  • struct Viewport Component which defines parameters of a viewport, the actual screen space that will be used by the camera it is attached to. Useful for having multiple camera views shown on screen.
  • class VoxelGrid final Represents a voxel object using a 3D grid.
  • struct VoxelMaterial Describes a voxel material.
  • diff --git a/docs-preview/pr-862/archetype__graph_8hpp.html b/docs-preview/pr-862/archetype__graph_8hpp.html new file mode 100644 index 000000000..fe73a7b7b --- /dev/null +++ b/docs-preview/pr-862/archetype__graph_8hpp.html @@ -0,0 +1,134 @@ + + + + + core/ecs/entity/archetype_graph.hpp file | CUBOS. Docs + + + + + + + +
    +
    + + + + + + diff --git a/docs-preview/pr-862/archetype__id_8hpp.html b/docs-preview/pr-862/archetype__id_8hpp.html new file mode 100644 index 000000000..838ba6f06 --- /dev/null +++ b/docs-preview/pr-862/archetype__id_8hpp.html @@ -0,0 +1,138 @@ + + + + + core/ecs/entity/archetype_id.hpp file | CUBOS. Docs + + + + + + + +
    +
    + + + + + + diff --git a/docs-preview/pr-862/blueprint_8hpp.html b/docs-preview/pr-862/blueprint_8hpp.html index 8aba2abdd..41e1c0531 100644 --- a/docs-preview/pr-862/blueprint_8hpp.html +++ b/docs-preview/pr-862/blueprint_8hpp.html @@ -78,7 +78,7 @@

    Classes

    class cubos::core::ecs::Blueprint
    -
    Collection of entities and their respective components.
    +
    Collection of entities and their respective components and relations.
    diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1ArchetypeGraph.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1ArchetypeGraph.html new file mode 100644 index 000000000..502385b36 --- /dev/null +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1ArchetypeGraph.html @@ -0,0 +1,334 @@ + + + + + cubos::core::ecs::ArchetypeGraph class | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + cubos::core::ecs::ArchetypeGraph class + +

    +

    Stores which column types each archetype holds and the edges which connect them.

    + +

    These edges are bidirectional and indicate the addition or removal of column types, depending on the direction being taken. Neighboring archetypes (which have only one differing column type) are not always connected by an edge, as they are only generated the first time the traversal is done between those two archetypes.

    In practice, this means that the first time a component is added to an entity of a given archetype, even if the target archetype already exists, a slow lookup must first be made. We cache the result of the lookup as a new edge, such that the next time the same component type is added, we just traverse the edge to find the target archetype's id.

    +
    +

    Constructors, destructors, conversion operators

    +
    +
    + ArchetypeGraph() +
    +
    Constructs.
    +
    +
    +
    +

    Public functions

    +
    +
    + auto contains(ArchetypeId archetype, + ColumnId id) const -> bool +
    +
    Checks if the given archetype contains the column type with the given id.
    +
    + auto with(ArchetypeId source, + ColumnId id) -> ArchetypeId +
    +
    Returns an archetype with same identifiers as the given source archetype, but with an extra column type with the given id.
    +
    + auto without(ArchetypeId source, + ColumnId id) -> ArchetypeId +
    +
    Returns an archetype with same identifiers as the given source archetype, except for the column type with the given id, which is excluded.
    +
    + auto first(ArchetypeId archetype) const -> ColumnId +
    +
    Returns the first column type in the set of column types held by the given archetype.
    +
    + auto next(ArchetypeId archetype, + ColumnId id) const -> ColumnId +
    +
    Returns the next column type in the set of column types held by the given archetype.
    +
    + auto collect(ArchetypeId archetype, + std::vector<ArchetypeId>& supersets, + std::size_t seen = 0) -> std::size_t +
    +
    Collects all of the archetypes which are supersets of the given archetype.
    +
    +
    +
    +

    Function documentation

    +
    +

    + bool cubos::core::ecs::ArchetypeGraph::contains(ArchetypeId archetype, + ColumnId id) const +

    +

    Checks if the given archetype contains the column type with the given id.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    archetypeArchetype.
    idColumn type identifier.
    ReturnsWhether the archetype contains the column type.
    +
    +
    +

    + ArchetypeId cubos::core::ecs::ArchetypeGraph::with(ArchetypeId source, + ColumnId id) +

    +

    Returns an archetype with same identifiers as the given source archetype, but with an extra column type with the given id.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    sourceSource archetype.
    idExtra column type identifier.
    ReturnsTarget archetype.
    +

    The column type with the given id must not already be present in source.

    +
    +
    +

    + ArchetypeId cubos::core::ecs::ArchetypeGraph::without(ArchetypeId source, + ColumnId id) +

    +

    Returns an archetype with same identifiers as the given source archetype, except for the column type with the given id, which is excluded.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    sourceSource archetype.
    idExcluded column type identifier.
    ReturnsTarget archetype.
    +

    The given column type with the given id must be present in source.

    +
    +
    +

    + ColumnId cubos::core::ecs::ArchetypeGraph::first(ArchetypeId archetype) const +

    +

    Returns the first column type in the set of column types held by the given archetype.

    + + + + + + + + + + + + + + + + +
    Parameters
    archetypeArchetype.
    ReturnsFirst column type, or ColumnId::Invalid if the archetype is Empty.
    +
    +
    +

    + ColumnId cubos::core::ecs::ArchetypeGraph::next(ArchetypeId archetype, + ColumnId id) const +

    +

    Returns the next column type in the set of column types held by the given archetype.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    archetypeArchetype.
    idCurrent column type.
    ReturnsNext column type, or ColumnId::Invalid if there is no next column type.
    +
    +
    +

    + std::size_t cubos::core::ecs::ArchetypeGraph::collect(ArchetypeId archetype, + std::vector<ArchetypeId>& supersets, + std::size_t seen = 0) +

    +

    Collects all of the archetypes which are supersets of the given archetype.

    + + + + + + + + + + + + + + + + + + + + + + + + +
    Parameters
    archetypeBase archetype.
    supersets outSet to insert new found archetypes into.
    seenMaximum previously seen archetype. To be used after the first call to this.
    ReturnsMaximum seen archetype.
    +

    Returns the largest identifier checked during the call, which can then be used to only check new archetypes in later calls.

    +
    +
    +
    +
    +
    +
    + + + + + + diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Blueprint.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Blueprint.html index 555aa756c..c968c7a8e 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Blueprint.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Blueprint.html @@ -49,7 +49,7 @@

    cubos::core::ecs::Blueprint class final

    -

    Collection of entities and their respective components.

    +

    Collection of entities and their respective components and relations.

    -

    Blueprints are in a way the 'Prefab' of CUBOS. They act as a tiny World which can then be spawned into an actual World, as many times as needed.

    When a blueprint is spawned, all of its components are scanned using the Reflection system for any references to other entities in the blueprint. These references are then replaced with the actual spawned entities. This has the side effect that if you do not expose an Entity field to the Reflection system, it will not be replaced and thus continue referencing the original entity in the blueprint.

    +

    Blueprints are in a way the 'Prefab' of CUBOS. They act as a tiny World which can then be spawned into an actual World, as many times as needed.

    When a blueprint is spawned, all of its components and relations are scanned using the Reflection system for any references to other entities in the blueprint. These references are then replaced with the actual spawned entities. This has the side effect that if you do not expose an Entity field to the Reflection system, it will not be replaced and thus continue referencing the original entity in the blueprint.

    Public types

    using Create = Entity(*)(void*userData, std::string name)
    -
    Function used by instantiate to create entities.
    +
    Function used by instantiate to create entities.
    using Add = void(*)(void*userData, Entity entity, memory::AnyValue component)
    -
    Function used by instantiate to add components to entities.
    +
    Function used by instantiate to add components to entities.
    +
    + using Relate = void(*)(void*userData, Entity fromEntity, Entity toEntity, memory::AnyValue relation) +
    +
    Function used by instantiate to add relations to entities.
    @@ -118,6 +122,19 @@

    Public functions

    Ts... components)
    Adds components to an entity. Overwrites the existing components, if there's any.
    +
    + void relate(Entity fromEntity, + Entity toEntity, + memory::AnyValue relation) +
    +
    Adds a relation between two entities. Overwrites the existing relation, if there's any.
    +
    + + void relate(Entity fromEntity, + Entity toEntity, + T relation) +
    +
    Adds a relation between two entities. Overwrites the existing relation, if there's any.
    void merge(const std::string& prefix, const Blueprint& other) @@ -132,15 +149,17 @@

    Public functions

    Returns a bimap which maps entities to their names.
    - void instantiate(void* userData, + void instantiate(void* userData, Create create, - Add add) const + Add add, + Relate relate) const
    Instantiates the blueprint by calling the given functions.
    -
    template<typename C, typename A>
    - void instantiate(C create, - A add) const +
    template<typename C, typename A, typename R>
    + void instantiate(C create, + A add, + R relate) const
    Instantiates the blueprint by calling the given functors.
    @@ -259,6 +278,72 @@

    +
    +

    + void cubos::core::ecs::Blueprint::relate(Entity fromEntity, + Entity toEntity, + memory::AnyValue relation) +

    +

    Adds a relation between two entities. Overwrites the existing relation, if there's any.

    + + + + + + + + + + + + + + + + + + +
    Parameters
    fromEntityFrom entity.
    toEntityTo entity.
    relationRelation to move.
    +
    +
    +

    +
    + template<reflection::Reflectable T> +
    + void cubos::core::ecs::Blueprint::relate(Entity fromEntity, + Entity toEntity, + T relation) +

    +

    Adds a relation between two entities. Overwrites the existing relation, if there's any.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Template parameters
    TRelation type.
    Parameters
    fromEntityFrom entity.
    toEntityTo entity.
    relationRelation to move.
    +

    void cubos::core::ecs::Blueprint::merge(const std::string& prefix, @@ -296,11 +381,12 @@

    -
    +

    - void cubos::core::ecs::Blueprint::instantiate(void* userData, + void cubos::core::ecs::Blueprint::instantiate(void* userData, Create create, - Add add) const + Add add, + Relate relate) const

    Instantiates the blueprint by calling the given functions.

    @@ -320,16 +406,21 @@

    + + + +
    add Function used to add components to entities.
    relateFunction used to add relations to entities.
    -
    +

    - template<typename C, typename A> + template<typename C, typename A, typename R>
    - void cubos::core::ecs::Blueprint::instantiate(C create, - A add) const + void cubos::core::ecs::Blueprint::instantiate(C create, + A add, + R relate) const

    Instantiates the blueprint by calling the given functors.

    @@ -345,6 +436,10 @@

    + + + + @@ -358,6 +453,10 @@

    + + + +
    A Add functor type.
    RRelate functor type.
    Parameters
    add Functor used to add components to entities.
    relateFunctor used to add relations to entities.
    diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1CommandBuffer.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1CommandBuffer.html index b39bb2ec7..01297b8f9 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1CommandBuffer.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1CommandBuffer.html @@ -47,7 +47,7 @@

    cubos::core::ecs::CommandBuffer class final - +

    Stores commands to execute them later.

    -
    +

    - void cubos::core::ecs::CommandBuffer::add(Entity entity, - const reflection::Type& type, - void* component) + Entity cubos::core::ecs::CommandBuffer::create()

    -

    Adds a component to an entity.

    +

    Creates a new entity.

    + + + + + + + +
    ReturnsEntity identifier.
    +
    +
    +

    + void cubos::core::ecs::CommandBuffer::destroy(Entity entity) +

    +

    Destroys an entity.

    @@ -147,155 +165,158 @@

    - - - - - - - - - +
    Parameters
    entityEntity.
    typeComponent type.
    componentComponent value to be moved.Entity identifier.
    -
    +

    -
    - template<typename... ComponentTypes> -
    - void cubos::core::ecs::CommandBuffer::add(Entity entity, - ComponentTypes && ... components) + std::unordered_map<std::string, Entity> cubos::core::ecs::CommandBuffer::spawn(const Blueprint& blueprint)

    -

    Adds components to an entity.

    +

    Spawns a blueprint into the world.

    - + - - + + + + + + + + +
    Template parameters
    Parameters
    ComponentTypesComponent types.blueprintBlueprint to spawn.
    ReturnsMap of entity names to their identifiers.
    +
    +
    +

    + void cubos::core::ecs::CommandBuffer::add(Entity entity, + const reflection::Type& type, + void* value) +

    +

    Adds a component to an entity.

    + - + - - + + + + + +
    Parameters
    entityentity Entity identifier.
    componentsComponents to add.typeComponent type.
    valueComponent value to be moved.
    -
    +

    -
    - template<typename... ComponentTypes> -
    - void cubos::core::ecs::CommandBuffer::remove(Entity entity) + void cubos::core::ecs::CommandBuffer::remove(Entity entity, + const reflection::Type& type)

    -

    Removes components from an entity.

    +

    Removes a component from an entity.

    - - - - - - - - - - + + + + +
    Template parameters
    ComponentTypesComponent types.
    Parameters
    entityentity Entity identifier.
    typeComponent type.
    -
    +

    -
    - template<typename... ComponentTypes> -
    - EntityBuilder cubos::core::ecs::CommandBuffer::create(ComponentTypes && ... components) + void cubos::core::ecs::CommandBuffer::relate(Entity from, + Entity to, + const reflection::Type& type, + void* value)

    -

    Creates a new entity with the given components.

    +

    Inserts a relation between the two given entities.

    - + - - + + - - - - - - - + + - - - - + + - + + + + +
    Template parameters
    Parameters
    ComponentTypesComponent types.fromFrom entity.
    Parameters
    componentsComponents to create with.toTo entity.
    ReturnsEntity identifier.typeRelation type.
    valueRelation value to move.
    +

    If the relation already exists, it is overwritten.

    -
    +

    - void cubos::core::ecs::CommandBuffer::destroy(Entity entity) + void cubos::core::ecs::CommandBuffer::unrelate(Entity from, + Entity to, + const reflection::Type& type)

    -

    Destroys an entity.

    +

    Removes the relation, if there's any, between the two given entities.

    - - + + + + + + + + + +
    Parameters
    entityEntity identifier.fromFrom entity.
    toTo entity.
    typeRelation type.
    -
    +

    - BlueprintBuilder cubos::core::ecs::CommandBuffer::spawn(const Blueprint& blueprint) + void cubos::core::ecs::CommandBuffer::push(memory::Function<void(World&)> command)

    -

    Spawns a blueprint into the world.

    +

    Pushes a command.

    - - + + - - - - - -
    Parameters
    blueprintBlueprint to spawn.commandCommand function.
    ReturnsBlueprint builder.
    diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Commands.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Commands.html index c58fdf00c..470245636 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Commands.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Commands.html @@ -80,29 +80,65 @@

    Constructors, destructors, conversion operators<

    Public functions

    -
    template<typename... ComponentTypes>
    - void add(Entity entity, - ComponentTypes && ... components) + auto create() -> EntityBuilder
    -
    Adds components to an entity.
    +
    Creates a new entity.
    -
    template<typename... ComponentTypes>
    - void remove(Entity entity) + void destroy(Entity entity)
    -
    Removes components from an entity.
    +
    Destroys an entity.
    -
    template<typename... ComponentTypes>
    - auto create(ComponentTypes && ... components) -> EntityBuilder + auto spawn(const Blueprint& blueprint) -> BlueprintBuilder
    -
    Creates a new entity with the given components.
    +
    Spawns a blueprint into the world.
    - void destroy(Entity entity) + auto add(Entity entity, + const reflection::Type& type, + void* value) -> Commands&
    -
    Destroys an entity.
    +
    Adds a component to an entity.
    - auto spawn(const Blueprint& blueprint) -> BlueprintBuilder + + auto add(Entity entity, + T value) -> Commands&
    -
    Spawns a blueprint into the world.
    +
    Adds a component to an entity.
    +
    + auto remove(Entity entity, + const reflection::Type& type) -> Commands& +
    +
    Removes a component from an entity.
    +
    + + auto remove(Entity entity) -> Commands& +
    +
    Removes a component from an entity.
    +
    + auto relate(Entity from, + Entity to, + const reflection::Type& type, + void* value) -> Commands& +
    +
    Inserts a relation between the two given entities.
    +
    + + auto relate(Entity from, + Entity to, + T value) -> Commands& +
    +
    Inserts a relation between the two given entities.
    +
    + auto unrelate(Entity from, + Entity to, + const reflection::Type& type) -> Commands& +
    +
    Removes the relation, if there's any, between the two given entities.
    +
    + + auto unrelate(Entity from, + Entity to) -> Commands& +
    +
    Removes the relation, if there's any, between the two given entities.

    @@ -124,23 +160,110 @@

    -
    +
    +

    + EntityBuilder cubos::core::ecs::Commands::create() +

    +

    Creates a new entity.

    + + + + + + + +
    ReturnsBuilder which can be used to modify the created entity.
    +
    +
    +

    + void cubos::core::ecs::Commands::destroy(Entity entity) +

    +

    Destroys an entity.

    + + + + + + + + + + +
    Parameters
    entityEntity identifier.
    +
    +
    +

    + BlueprintBuilder cubos::core::ecs::Commands::spawn(const Blueprint& blueprint) +

    +

    Spawns a blueprint into the world.

    + + + + + + + + + + + + + + + + +
    Parameters
    blueprintBlueprint to spawn.
    ReturnsBlueprint builder.
    +
    +
    +

    + Commands& cubos::core::ecs::Commands::add(Entity entity, + const reflection::Type& type, + void* value) +

    +

    Adds a component to an entity.

    + + + + + + + + + + + + + + + + + + + + + + + + +
    Parameters
    entityEntity identifier.
    typeComponent type.
    valueComponent value.
    ReturnsCommands.
    +
    +

    - template<typename... ComponentTypes> + template<reflection::Reflectable T>
    - void cubos::core::ecs::Commands::add(Entity entity, - ComponentTypes && ... components) + Commands& cubos::core::ecs::Commands::add(Entity entity, + T value)

    -

    Adds components to an entity.

    +

    Adds a component to an entity.

    - - + + @@ -152,28 +275,62 @@

    - - + + + + + + + +
    Template parameters
    ComponentTypesComponent types.TComponent type.
    Entity identifier.
    componentsComponents to add.valueComponent value.
    ReturnsCommands.
    -
    +
    +

    + Commands& cubos::core::ecs::Commands::remove(Entity entity, + const reflection::Type& type) +

    +

    Removes a component from an entity.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    entityEntity identifier.
    typeComponent type.
    ReturnsCommands.
    +
    +

    - template<typename... ComponentTypes> + template<reflection::Reflectable T>
    - void cubos::core::ecs::Commands::remove(Entity entity) + Commands& cubos::core::ecs::Commands::remove(Entity entity)

    -

    Removes components from an entity.

    +

    Removes a component from an entity.

    - - + + @@ -185,24 +342,71 @@

    + + + + + +
    Template parameters
    ComponentTypesComponent types.TComponent type.
    Entity identifier.
    ReturnsCommands.
    -
    +
    +

    + Commands& cubos::core::ecs::Commands::relate(Entity from, + Entity to, + const reflection::Type& type, + void* value) +

    +

    Inserts a relation between the two given entities.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Parameters
    fromFrom entity.
    toTo entity.
    typeRelation type.
    valueRelation value to move.
    ReturnsCommands.
    +

    If the relation already exists, it is overwritten.

    +
    +

    - template<typename... ComponentTypes> + template<reflection::Reflectable T>
    - EntityBuilder cubos::core::ecs::Commands::create(ComponentTypes && ... components) + Commands& cubos::core::ecs::Commands::relate(Entity from, + Entity to, + T value)

    -

    Creates a new entity with the given components.

    +

    Inserts a relation between the two given entities.

    - - + + @@ -210,54 +414,96 @@

    - - + + + + + + + + + + - +
    Template parameters
    ComponentTypesComponent types.TRelation type.
    componentsComponents to create with.fromFrom entity.
    toTo entity.
    valueRelation value.
    ReturnsEntity identifier.Commands.
    +

    If the relation already exists, it is overwritten.

    -
    +

    - void cubos::core::ecs::Commands::destroy(Entity entity) + Commands& cubos::core::ecs::Commands::unrelate(Entity from, + Entity to, + const reflection::Type& type)

    -

    Destroys an entity.

    +

    Removes the relation, if there's any, between the two given entities.

    - - + + + + + + + + + + + + + + + +
    Parameters
    entityEntity identifier.fromFrom entity.
    toTo entity.
    typeRelation type.
    ReturnsCommands.
    -
    +

    - BlueprintBuilder cubos::core::ecs::Commands::spawn(const Blueprint& blueprint) +
    + template<reflection::Reflectable T> +
    + Commands& cubos::core::ecs::Commands::unrelate(Entity from, + Entity to)

    -

    Spawns a blueprint into the world.

    +

    Removes the relation, if there's any, between the two given entities.

    + + + + + + + + + - - + + + + + + - +
    Template parameters
    TRelation type.
    Parameters
    blueprintBlueprint to spawn.fromFrom entity.
    toTo entity.
    ReturnsBlueprint builder.Commands.
    diff --git a/docs-preview/pr-862/classcubos_1_1engine_1_1Cubos.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Cubos.html similarity index 61% rename from docs-preview/pr-862/classcubos_1_1engine_1_1Cubos.html rename to docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Cubos.html index 9e4c8e0a3..1b84235e4 100644 --- a/docs-preview/pr-862/classcubos_1_1engine_1_1Cubos.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Cubos.html @@ -2,7 +2,7 @@ - cubos::engine::Cubos class | CUBOS. Docs + cubos::core::ecs::Cubos class | CUBOS. Docs @@ -46,8 +46,8 @@

    - cubos::engine::Cubos class final - + cubos::core::ecs::Cubos class final +

    Represents the engine itself, and exposes the interface with which the game developer interacts with. Ties up all the different parts of the engine together.

    -

    While the Write demands that the resource or component exists, this argument does not. Can be used as a pointer with both the -> and * operators.

    Constructors, destructors, conversion operators

    +
    + Opt() +
    +
    Constructs without a value.
    +
    + Opt(T value) +
    +
    Constructs with a value.
    - OptWrite(T* ptr) + Opt(const Opt<T>& other)
    -
    Creates a new optional write argument. ptr should be null if the resource or component does not exist.
    +
    Copy constructor.
    - operator bool() const + operator bool() const
    -
    Checks if the resource or component exists.
    +
    Checks if the optional contains a value.

    Public functions

    - auto operator->() -> T* + auto contains() const -> bool +
    +
    Checks if the optional contains a value.
    +
    + auto value() -> T& +
    +
    Gets the underlying value.
    +
    + auto operator*() -> T&
    -
    Accesses the resource or component, aborting if it does not exist.
    +
    Gets the underlying value.
    - auto operator*() -> T& + auto operator->() -> T*
    -
    Accesses the resource or component, aborting if it does not exist.
    +
    Gets the underlying value.

    Function documentation

    -
    +
    +

    +
    + template<typename T> +
    + cubos::core::ecs::Opt<T>::Opt(T value) +

    +

    Constructs with a value.

    + + + + + + + + + + +
    Parameters
    valueValue.
    +
    +

    template<typename T>
    - cubos::core::ecs::OptWrite<T>::OptWrite(T* ptr) + cubos::core::ecs::Opt<T>::Opt(const Opt<T>& other)

    -

    Creates a new optional write argument. ptr should be null if the resource or component does not exist.

    +

    Copy constructor.

    - - + +
    Parameters
    ptrPointer to the resource or component.otherOther optional.
    -
    +
    +

    +
    + template<typename T> +
    + cubos::core::ecs::Opt<T>::operator bool() const +

    +

    Checks if the optional contains a value.

    + + + + + + + +
    ReturnsWhether the optional contains a value.
    +
    +
    +

    +
    + template<typename T> +
    + bool cubos::core::ecs::Opt<T>::contains() const +

    +

    Checks if the optional contains a value.

    + + + + + + + +
    ReturnsWhether the optional contains a value.
    +
    +

    template<typename T>
    - cubos::core::ecs::OptWrite<T>::operator bool() const + T& cubos::core::ecs::Opt<T>::value()

    -

    Checks if the resource or component exists.

    +

    Gets the underlying value.

    - +
    ReturnsWhether the resource or component exists.Reference to value.
    +

    Aborts if there's no value.

    -
    +

    template<typename T>
    - T* cubos::core::ecs::OptWrite<T>::operator->() + T& cubos::core::ecs::Opt<T>::operator*()

    -

    Accesses the resource or component, aborting if it does not exist.

    +

    Gets the underlying value.

    - +
    ReturnsReference to the resource or component.Reference to value.
    +

    Aborts if there's no value.

    -
    +

    template<typename T>
    - T& cubos::core::ecs::OptWrite<T>::operator*() + T* cubos::core::ecs::Opt<T>::operator->()

    -

    Accesses the resource or component, aborting if it does not exist.

    +

    Gets the underlying value.

    - +
    ReturnsReference to the resource or component.Reference to value.
    +

    Aborts if there's no value.

    diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Query.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Query.html index cf804d6c3..e3606919d 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Query.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Query.html @@ -47,7 +47,7 @@

    -
    template<typename... ComponentTypes>
    +
    template<typename... Ts>
    cubos::core::ecs::Query class

    System argument which holds the result of a query over all entities in world which match the given arguments.

    @@ -57,8 +57,8 @@

    - ComponentTypes - Component accessor types to be queried. + Ts + Argument types. @@ -68,154 +68,153 @@

    Contents

  • Reference
  • -

    An example of a valid query is:

    Query<Write<Position>, Read<Velocity>, OptWrite<Rotation>, OptRead<Scale>>

    This query will return all entities with a Position and Velocity component. Accessors to Rotation and Scale components are also passed but may be null if the component is not present in the entity. Whenever mutability is not needed, Read/OptRead should be used.

    -
    -

    Public types

    -
    -
    - class Iterator -
    -
    Used to iterate over the results of a query.
    -
    -
    -
    -

    Public static functions

    -
    -
    - static auto info() -> QueryInfo -
    -
    Gets information about the query.
    -
    -
    +

    An example of a valid query is:

    Query<Position&, const Velocity&, Opt<Rotation&>, Opt<const Scale&>>

    This query will return all entities with a Position and Velocity component. Accessors to Rotation and Scale components are also passed but may be null if the component is not present in the entity. Whenever mutability is not needed, const should be used.

    Constructors, destructors, conversion operators

    - Query(World& world) + Query(QueryData<Ts...>& data)
    -
    Constructs a query over the given world.
    +
    Constructs.

    Public functions

    - auto begin() -> Iterator + auto begin() -> Iterator
    -
    Gets an iterator to the first entity which matches the query.
    +
    Returns an iterator pointing to the first query match.
    - auto end() -> Iterator + auto end() -> Iterator
    -
    Gets an iterator to the end of the query.
    +
    Returns an out of bounds iterator representing the end of the query matches.
    - auto operator[](Entity entity) -> std::optional<std::tuple<ComponentTypes...>> + auto at(Entity entity) -> Opt<std::tuple<Ts...>>
    -
    Accesses an entity's components directly, without iterating over the query.
    +
    Accesses the match for the given entity, if there is one.
    +
    + auto at(Entity firstEntity, + Entity secondEntity) -> Opt<std::tuple<Ts...>> +
    +
    Accesses the match for the given entities, if there is one.

    Function documentation

    -
    +

    - template<typename... ComponentTypes> + template<typename... Ts>
    - static QueryInfo cubos::core::ecs::Query<ComponentTypes>::info() + cubos::core::ecs::Query<Ts>::Query(QueryData<Ts...>& data)

    -

    Gets information about the query.

    +

    Constructs.

    - + + + + - - + + - +
    Parameters
    ReturnsQuery information.dataQuery data.
    -
    +

    - template<typename... ComponentTypes> + template<typename... Ts>
    - cubos::core::ecs::Query<ComponentTypes>::Query(World& world) + Iterator cubos::core::ecs::Query<Ts>::begin()

    -

    Constructs a query over the given world.

    +

    Returns an iterator pointing to the first query match.

    - - - - + - - + + - +
    Parameters
    worldWorld to query.ReturnsIterator.
    -
    +

    - template<typename... ComponentTypes> + template<typename... Ts>
    - Iterator cubos::core::ecs::Query<ComponentTypes>::begin() + Iterator cubos::core::ecs::Query<Ts>::end()

    -

    Gets an iterator to the first entity which matches the query.

    +

    Returns an out of bounds iterator representing the end of the query matches.

    - +
    ReturnsIterator.Iterator.
    -
    +

    - template<typename... ComponentTypes> + template<typename... Ts>
    - Iterator cubos::core::ecs::Query<ComponentTypes>::end() + Opt<std::tuple<Ts...>> cubos::core::ecs::Query<Ts>::at(Entity entity)

    -

    Gets an iterator to the end of the query.

    +

    Accesses the match for the given entity, if there is one.

    + + + + + + + + + - - + +
    Parameters
    entityEntity.
    ReturnsIterator.ReturnsRequested components, or nothing if the entity does not match the query.
    -
    +

    - template<typename... ComponentTypes> + template<typename... Ts>
    - std::optional<std::tuple<ComponentTypes...>> cubos::core::ecs::Query<ComponentTypes>::operator[](Entity entity) + Opt<std::tuple<Ts...>> cubos::core::ecs::Query<Ts>::at(Entity firstEntity, + Entity secondEntity)

    -

    Accesses an entity's components directly, without iterating over the query.

    +

    Accesses the match for the given entities, if there is one.

    - - + + + + + + - +
    Parameters
    entityEntity to access.firstEntityEntity for the first target.
    secondEntityEntity for the second target.
    ReturnsRequested components, or std::nullopt if the entity does not match the query.Requested data, or nothing if the entities do not match the query.
    diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1QueryData.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1QueryData.html new file mode 100644 index 000000000..2dfce8564 --- /dev/null +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1QueryData.html @@ -0,0 +1,286 @@ + + + + + cubos::core::ecs::QueryData class | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + +
    template<typename... Ts>
    + cubos::core::ecs::QueryData class +

    +

    Holds the data necessary to execute a query.

    + + + + + + + + + + +
    Template parameters
    TsArgument types.
    + +

    The argument types of the query specify exactly what data will be accessed during iteration. For example, the query might have been constructed with properties such that a given column must be present on the entity. That doesn't mean that the data will actually end up being accessed.

    If an argument type is present which requires a certain column to be present, then that column is automatically added to the query properties, if it isn't there already.

    +
    +

    Constructors, destructors, conversion operators

    +
    +
    + QueryData(World& world, + const std::vector<QueryTerm>& extraTerms) +
    +
    Constructs.
    +
    + QueryData(QueryData&& other) noexcept +
    +
    Move constructs.
    +
    +
    +
    +

    Public functions

    +
    +
    + void update() +
    +
    Fetches any new matching archetypes that have been added since the last call to this function.
    +
    + auto view() -> View +
    +
    Returns a view which can be used to iterate over the matches.
    +
    + auto at(Entity entity) -> Opt<std::tuple<Ts...>> +
    +
    Accesses the match for the given entity, if there is one.
    +
    + auto at(Entity firstEntity, + Entity secondEntity) -> Opt<std::tuple<Ts...>> +
    +
    Accesses the match for the given entities, if there is one.
    +
    +
    +
    +

    Function documentation

    +
    +

    +
    + template<typename... Ts> +
    + cubos::core::ecs::QueryData<Ts>::QueryData(World& world, + const std::vector<QueryTerm>& extraTerms) +

    +

    Constructs.

    + + + + + + + + + + + + + + +
    Parameters
    worldWorld being queried.
    extraTermsExtra query terms.
    +
    +
    +

    +
    + template<typename... Ts> +
    + cubos::core::ecs::QueryData<Ts>::QueryData(QueryData&& other) noexcept +

    +

    Move constructs.

    + + + + + + + + + + +
    Parameters
    otherOther query data.
    +
    +
    +

    +
    + template<typename... Ts> +
    + View cubos::core::ecs::QueryData<Ts>::view() +

    +

    Returns a view which can be used to iterate over the matches.

    + + + + + + + +
    ReturnsView.
    +
    +
    +

    +
    + template<typename... Ts> +
    + Opt<std::tuple<Ts...>> cubos::core::ecs::QueryData<Ts>::at(Entity entity) +

    +

    Accesses the match for the given entity, if there is one.

    + + + + + + + + + + + + + + + + +
    Parameters
    entityEntity.
    ReturnsRequested data, or nothing if the entity does not match the query.
    +
    +
    +

    +
    + template<typename... Ts> +
    + Opt<std::tuple<Ts...>> cubos::core::ecs::QueryData<Ts>::at(Entity firstEntity, + Entity secondEntity) +

    +

    Accesses the match for the given entities, if there is one.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    firstEntityEntity for the first target.
    secondEntityEntity for the second target.
    ReturnsRequested data, or nothing if the entities do not match the query.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1QueryFetcher.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1QueryFetcher.html new file mode 100644 index 000000000..27ad79a02 --- /dev/null +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1QueryFetcher.html @@ -0,0 +1,254 @@ + + + + + cubos::core::ecs::QueryFetcher class | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + +
    template<typename T>
    + cubos::core::ecs::QueryFetcher class +

    +

    Type meant to be specialized which implements for each argument type the necessary logic to extract it from the tables.

    + + + + + + + + + + +
    Template parameters
    TArgument type.
    + +
    +

    Public static functions

    +
    +
    + static auto term(World& world) -> QueryTerm +
    +
    Creates a query term with unspecified targets for the argument type.
    +
    +
    +
    +

    Constructors, destructors, conversion operators

    +
    +
    + QueryFetcher(World& world, + const QueryTerm& term) +
    +
    Called when a query is constructed for the first time.
    +
    +
    +
    +

    Public functions

    +
    +
    + void prepare(const ArchetypeId* targetArchetypes) +
    +
    Called when iteration starts for the given archetypes. Always called before fetch(), which may be called multiple times after this.
    +
    + auto fetch(std::size_t row) -> T +
    +
    Called to get the actual desired data for a specific match. Always called after prepare() has been called at least once.
    +
    +
    +
    +

    Function documentation

    +
    +

    +
    + template<typename T> +
    + static QueryTerm cubos::core::ecs::QueryFetcher<T>::term(World& world) +

    +

    Creates a query term with unspecified targets for the argument type.

    + + + + + + + + + + + + + + + + +
    Parameters
    worldWorld being queried.
    ReturnsTerm information.
    +
    +
    +

    +
    + template<typename T> +
    + cubos::core::ecs::QueryFetcher<T>::QueryFetcher(World& world, + const QueryTerm& term) +

    +

    Called when a query is constructed for the first time.

    + + + + + + + + + + + + + + +
    Parameters
    worldWorld being queried.
    termTerm corresponding to the argument being fetched, with specified targets.
    +
    +
    +

    +
    + template<typename T> +
    + void cubos::core::ecs::QueryFetcher<T>::prepare(const ArchetypeId* targetArchetypes) +

    +

    Called when iteration starts for the given archetypes. Always called before fetch(), which may be called multiple times after this.

    + + + + + + + + + + +
    Parameters
    targetArchetypesPointer to array with the archetype identifiers for the targets.
    +
    +
    +

    +
    + template<typename T> +
    + T cubos::core::ecs::QueryFetcher<T>::fetch(std::size_t row) +

    +

    Called to get the actual desired data for a specific match. Always called after prepare() has been called at least once.

    + + + + + + + + + + +
    Parameters
    rowRow to fetch.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1OptRead.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1QueryFilter.html similarity index 56% rename from docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1OptRead.html rename to docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1QueryFilter.html index 3ec742674..f6234a423 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1OptRead.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1QueryFilter.html @@ -2,7 +2,7 @@ - cubos::core::ecs::OptRead class | CUBOS. Docs + cubos::core::ecs::QueryFilter class | CUBOS. Docs @@ -46,129 +46,138 @@

    - -
    template<typename T>
    - cubos::core::ecs::OptRead class + cubos::core::ecs::QueryFilter class +

    -

    System argument which provides read access to the resource T if it exists, or query argument which provides read access to the component T if it exists.

    - - - - - - - - - - -
    Template parameters
    TResource or component type.
    +

    Used to find matches for the given query terms. Essentially contains the non-templated part of the query logic.

    -

    While the Read demands that the resource or component exists, this argument does not. Can be used as a pointer with both the -> and * operators.

    +
    +

    Public static variables

    +
    +
    + static int MaxTargetCount constexpr +
    +
    Maximum number of targets per match allowed in a single query.
    +
    + static int MaxLinkCount constexpr +
    +
    Maximum number of links per query.
    +
    +

    Constructors, destructors, conversion operators

    - OptRead(const T* ptr) + QueryFilter(World& world, + const std::vector<QueryTerm>& terms)
    -
    Creates a new optional read argument. ptr should be null if the resource or component does not exist.
    -
    - operator bool() const -
    -
    Checks if the resource or component exists.
    +
    Constructs.

    Public functions

    - auto operator->() const -> const T* + auto cursorIndex(std::size_t termIndex) const -> std::size_t +
    +
    Gets the cursor index for the given term index.
    +
    + void update() +
    +
    Fetches any new matching archetypes that have been added since the last call to this function.
    +
    + auto view() -> View
    -
    Accesses the resource or component, aborting if it does not exist.
    +
    Returns a view which can be used to iterate over the matches.
    - auto operator*() const -> const T& + auto targetCount() const -> int
    -
    +
    Gets the number of targets.

    Function documentation

    -
    +

    -
    - template<typename T> -
    - cubos::core::ecs::OptRead<T>::OptRead(const T* ptr) + cubos::core::ecs::QueryFilter::QueryFilter(World& world, + const std::vector<QueryTerm>& terms)

    -

    Creates a new optional read argument. ptr should be null if the resource or component does not exist.

    +

    Constructs.

    - - + + + + + +
    Parameters
    ptrPointer to the resource or component.worldWorld being queried.
    termsQuery terms.
    -
    +

    -
    - template<typename T> -
    - cubos::core::ecs::OptRead<T>::operator bool() const + std::size_t cubos::core::ecs::QueryFilter::cursorIndex(std::size_t termIndex) const

    -

    Checks if the resource or component exists.

    +

    Gets the cursor index for the given term index.

    + + + + + + + + + - - + +
    Parameters
    termIndexTerm index.
    ReturnsWhether the resource or component exists.ReturnsCursor index.
    -
    +

    -
    - template<typename T> -
    - const T* cubos::core::ecs::OptRead<T>::operator->() const + View cubos::core::ecs::QueryFilter::view()

    -

    Accesses the resource or component, aborting if it does not exist.

    +

    Returns a view which can be used to iterate over the matches.

    - +
    ReturnsReference to the resource or component.View.
    -
    +

    -
    - template<typename T> -
    - const T& cubos::core::ecs::OptRead<T>::operator*() const + int cubos::core::ecs::QueryFilter::targetCount() const

    +

    Gets the number of targets.

    - +
    ReturnsReference to the resource or component, aborting if it does not exist.Target count.
    diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1RelationTable.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1RelationTable.html deleted file mode 100644 index 9fa695027..000000000 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1RelationTable.html +++ /dev/null @@ -1,451 +0,0 @@ - - - - - cubos::core::ecs::RelationTable class | CUBOS. Docs - - - - - - - -
    -
    -
    -
    -
    -

    - cubos::core::ecs::RelationTable class final - -

    -

    A table which stores relations. Allows for quick insertion, deletion and iteration.

    - -

    Internally, the table is stored simply as a vector of relations and their data. Each row in this table stores:

    • the 'from' entity index;
    • the 'to' entity index;
    • the previous and next rows with the same 'from' index;
    • the previous and next rows with the same 'to' index;
    • the relation data itself.

    To make random accesses more efficient, we also store an hashtable which maps entity index pairs to rows. This way, we can quickly check if a relation exists or where it's stored.

    Additionally, we store two other hashtables, one which associate 'from' and 'to' indices to rows in the table which represent the first and last nodes of linked lists, where each node is a row with the same 'from' or 'to' index, depending on the list.

    These linked lists are essential to provide fast query times, as instead of having to iterate over the entire table and filter for entity, we only need to follow the linked list chain.

    -
    -

    Constructors, destructors, conversion operators

    -
    -
    - RelationTable(const reflection::Type& relationType) -
    -
    Constructs with the given relation type.
    -
    -
    -
    -

    Public functions

    -
    -
    - auto insert(uint32_t from, - uint32_t to, - void* value) -> bool -
    -
    Adds a relation between the given indices. If it already exists, overwrites it.
    -
    - auto erase(uint32_t from, - uint32_t to) -> bool -
    -
    Removes a relation between the given indices. If it didn't exist, does nothing.
    -
    - auto eraseFrom(uint32_t from) -> std::size_t -
    -
    Removes all relations from the given index.
    -
    - auto eraseTo(uint32_t to) -> std::size_t -
    -
    Removes all relations to the given index.
    -
    - auto contains(uint32_t from, - uint32_t to) const -> bool -
    -
    Checks whether the given relation exists between the given indices.
    -
    - auto at(uint32_t from, - uint32_t to) const -> uintptr_t -
    -
    Gets a pointer to the data of the relation with the given indices.
    -
    - auto begin() const -> Iterator -
    -
    Gets an iterator to the first relation of the table.
    -
    - auto end() const -> Iterator -
    -
    Gets an iterator which represents the end of the table.
    -
    - auto viewFrom(uint32_t from) const -> View -
    -
    Returns a view of the relations with the given from index.
    -
    - auto viewTo(uint32_t to) const -> View -
    -
    Returns a view of the relations with the given to index.
    -
    - auto size() const -> std::size_t -
    -
    Returns the number of relations on the table.
    -
    -
    -
    -

    Function documentation

    -
    -

    - cubos::core::ecs::RelationTable::RelationTable(const reflection::Type& relationType) -

    -

    Constructs with the given relation type.

    - - - - - - - - - - -
    Parameters
    relationTypeRelation type.
    - -
    -
    -

    - bool cubos::core::ecs::RelationTable::insert(uint32_t from, - uint32_t to, - void* value) -

    -

    Adds a relation between the given indices. If it already exists, overwrites it.

    - - - - - - - - - - - - - - - - - - - - - - - - -
    Parameters
    fromFrom index.
    toTo index.
    valueRelation value to move from.
    ReturnsWhether the relation already existed.
    -
    -
    -

    - bool cubos::core::ecs::RelationTable::erase(uint32_t from, - uint32_t to) -

    -

    Removes a relation between the given indices. If it didn't exist, does nothing.

    - - - - - - - - - - - - - - - - - - - - -
    Parameters
    fromFrom index.
    toTo index.
    ReturnsWhether the relation existed.
    -
    -
    -

    - std::size_t cubos::core::ecs::RelationTable::eraseFrom(uint32_t from) -

    -

    Removes all relations from the given index.

    - - - - - - - - - - - - - - - - -
    Parameters
    fromFrom index.
    ReturnsHow many relations were erased.
    -
    -
    -

    - std::size_t cubos::core::ecs::RelationTable::eraseTo(uint32_t to) -

    -

    Removes all relations to the given index.

    - - - - - - - - - - - - - - - - -
    Parameters
    toTo index.
    ReturnsHow many relations were erased.
    -
    -
    -

    - bool cubos::core::ecs::RelationTable::contains(uint32_t from, - uint32_t to) const -

    -

    Checks whether the given relation exists between the given indices.

    - - - - - - - - - - - - - - - - - - - - -
    Parameters
    fromFrom index.
    toTo index.
    ReturnsWhether the relation exists.
    -
    -
    -

    - uintptr_t cubos::core::ecs::RelationTable::at(uint32_t from, - uint32_t to) const -

    -

    Gets a pointer to the data of the relation with the given indices.

    - - - - - - - - - - - - - - - - - - - - -
    Parameters
    fromFrom index.
    toTo index.
    ReturnsAddress of the data, or 0 if there's no such relation.
    -
    -
    -

    - Iterator cubos::core::ecs::RelationTable::begin() const -

    -

    Gets an iterator to the first relation of the table.

    - - - - - - - -
    ReturnsIterator.
    -
    -
    -

    - Iterator cubos::core::ecs::RelationTable::end() const -

    -

    Gets an iterator which represents the end of the table.

    - - - - - - - -
    ReturnsIterator.
    -
    -
    -

    - View cubos::core::ecs::RelationTable::viewFrom(uint32_t from) const -

    -

    Returns a view of the relations with the given from index.

    - - - - - - - - - - - - - - - - -
    Parameters
    fromFrom index.
    ReturnsRelation view.
    -
    -
    -

    - View cubos::core::ecs::RelationTable::viewTo(uint32_t to) const -

    -

    Returns a view of the relations with the given to index.

    - - - - - - - - - - - - - - - - -
    Parameters
    toTo index.
    ReturnsRelation view.
    -
    -
    -

    - std::size_t cubos::core::ecs::RelationTable::size() const -

    -

    Returns the number of relations on the table.

    - - - - - - - -
    ReturnsRelation count.
    -
    -
    -
    -
    -
    -
    - - - -
    - - diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1ResourceManager.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1ResourceManager.html index f183d2499..bca324061 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1ResourceManager.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1ResourceManager.html @@ -103,7 +103,7 @@

    TArgs - Types of the arguments of the constructor of the resource. + Types of the arguments of the constructor of the resource. @@ -112,7 +112,7 @@

    args - Arguments of the constructor of the resource. + Arguments of the constructor of the resource. diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SparseRelationTable.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SparseRelationTable.html new file mode 100644 index 000000000..6707d8872 --- /dev/null +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SparseRelationTable.html @@ -0,0 +1,715 @@ + + + + + cubos::core::ecs::SparseRelationTable class | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + cubos::core::ecs::SparseRelationTable class final + +

    +

    A table which stores relations. Allows for quick insertion, deletion and iteration.

    + +

    Internally, the table is stored simply as a vector of relations and their data. Each row in this table stores:

    • the 'from' entity index;
    • the 'to' entity index;
    • the previous and next rows with the same 'from' index;
    • the previous and next rows with the same 'to' index;
    • the relation data itself.

    To make random accesses more efficient, we also store an hashtable which maps entity index pairs to rows. This way, we can quickly check if a relation exists or where it's stored.

    Additionally, we store two other hashtables, one which associate 'from' and 'to' indices to rows in the table which represent the first and last nodes of linked lists, where each node is a row with the same 'from' or 'to' index, depending on the list.

    These linked lists are essential to provide fast query times, as instead of having to iterate over the entire table and filter for entity, we only need to follow the linked list chain.

    +
    +

    Constructors, destructors, conversion operators

    +
    +
    + SparseRelationTable(const reflection::Type& relationType) +
    +
    Constructs with the given relation type.
    +
    +
    +
    +

    Public functions

    +
    +
    + auto insert(uint32_t from, + uint32_t to, + void* value) -> bool +
    +
    Adds a relation between the given indices. If it already exists, overwrites it.
    +
    + auto erase(uint32_t from, + uint32_t to) -> bool +
    +
    Removes a relation between the given indices. If it didn't exist, does nothing.
    +
    + auto eraseFrom(uint32_t from) -> std::size_t +
    +
    Removes all relations from the given index.
    +
    + auto moveFrom(uint32_t from, + SparseRelationTable& other) -> std::size_t +
    +
    Moves all relations with the given from index to another table.
    +
    + auto eraseTo(uint32_t to) -> std::size_t +
    +
    Removes all relations to the given index.
    +
    + auto moveTo(uint32_t to, + SparseRelationTable& other) -> std::size_t +
    +
    Moves all relations with the given to index to another table.
    +
    + auto contains(uint32_t from, + uint32_t to) const -> bool +
    +
    Checks whether the given relation exists between the given indices.
    +
    + auto row(uint32_t from, + uint32_t to) const -> std::size_t +
    +
    Gets the row of the relation with the given indices, or size() if there is none.
    +
    + auto at(std::size_t row) -> void* +
    +
    Get the relation at the given row.
    +
    + auto at(std::size_t row) const -> const void* +
    +
    Get the relation at the given row.
    +
    + void indices(std::size_t row, + uint32_t& from, + uint32_t& to) const +
    +
    Get the entity indices at the given row.
    +
    + auto firstFrom(uint32_t index) const -> std::size_t +
    +
    Gets the first row with the given from index, or size() if there is none.
    +
    + auto firstTo(uint32_t index) const -> std::size_t +
    +
    Gets the first row with the given to index, or size() if there is none.
    +
    + auto nextFrom(std::size_t row) const -> std::size_t +
    +
    Gets the next row with the same from index, or size() if there is none.
    +
    + auto nextTo(std::size_t row) const -> std::size_t +
    +
    Gets the next row with the same to index, or size() if there is none.
    +
    + auto begin() const -> Iterator +
    +
    Gets an iterator to the first relation of the table.
    +
    + auto end() const -> Iterator +
    +
    Gets an iterator which represents the end of the table.
    +
    + auto viewFrom(uint32_t from) const -> View +
    +
    Returns a view of the relations with the given from index.
    +
    + auto viewTo(uint32_t to) const -> View +
    +
    Returns a view of the relations with the given to index.
    +
    + auto size() const -> std::size_t +
    +
    Returns the number of relations on the table.
    +
    +
    +
    +

    Function documentation

    +
    +

    + cubos::core::ecs::SparseRelationTable::SparseRelationTable(const reflection::Type& relationType) +

    +

    Constructs with the given relation type.

    + + + + + + + + + + +
    Parameters
    relationTypeRelation type.
    + +
    +
    +

    + bool cubos::core::ecs::SparseRelationTable::insert(uint32_t from, + uint32_t to, + void* value) +

    +

    Adds a relation between the given indices. If it already exists, overwrites it.

    + + + + + + + + + + + + + + + + + + + + + + + + +
    Parameters
    fromFrom index.
    toTo index.
    valueRelation value to move from.
    ReturnsWhether the relation already existed.
    +
    +
    +

    + bool cubos::core::ecs::SparseRelationTable::erase(uint32_t from, + uint32_t to) +

    +

    Removes a relation between the given indices. If it didn't exist, does nothing.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    fromFrom index.
    toTo index.
    ReturnsWhether the relation existed.
    +
    +
    +

    + std::size_t cubos::core::ecs::SparseRelationTable::eraseFrom(uint32_t from) +

    +

    Removes all relations from the given index.

    + + + + + + + + + + + + + + + + +
    Parameters
    fromFrom index.
    ReturnsHow many relations were erased.
    +
    +
    +

    + std::size_t cubos::core::ecs::SparseRelationTable::moveFrom(uint32_t from, + SparseRelationTable& other) +

    +

    Moves all relations with the given from index to another table.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    fromFrom index.
    otherOther table. Must have the same relation type.
    ReturnsHow many relations were erased.
    +
    +
    +

    + std::size_t cubos::core::ecs::SparseRelationTable::eraseTo(uint32_t to) +

    +

    Removes all relations to the given index.

    + + + + + + + + + + + + + + + + +
    Parameters
    toTo index.
    ReturnsHow many relations were moved.
    +
    +
    +

    + std::size_t cubos::core::ecs::SparseRelationTable::moveTo(uint32_t to, + SparseRelationTable& other) +

    +

    Moves all relations with the given to index to another table.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    toTo index index.
    otherOther table. Must have the same relation type.
    ReturnsHow many relations were moved.
    +
    +
    +

    + bool cubos::core::ecs::SparseRelationTable::contains(uint32_t from, + uint32_t to) const +

    +

    Checks whether the given relation exists between the given indices.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    fromFrom index.
    toTo index.
    ReturnsWhether the relation exists.
    +
    +
    +

    + std::size_t cubos::core::ecs::SparseRelationTable::row(uint32_t from, + uint32_t to) const +

    +

    Gets the row of the relation with the given indices, or size() if there is none.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    fromFrom index.
    toTo index.
    ReturnsRow of the data.
    +
    +
    +

    + void* cubos::core::ecs::SparseRelationTable::at(std::size_t row) +

    +

    Get the relation at the given row.

    + + + + + + + + + + + + + + + + +
    Parameters
    rowRow of the relation to get.
    ReturnsPointer to the relation.
    + +
    +
    +

    + const void* cubos::core::ecs::SparseRelationTable::at(std::size_t row) const +

    +

    Get the relation at the given row.

    + + + + + + + + + + + + + + + + +
    Parameters
    rowRow of the relation to get.
    ReturnsPointer to the relation.
    + +
    +
    +

    + void cubos::core::ecs::SparseRelationTable::indices(std::size_t row, + uint32_t& from, + uint32_t& to) const +

    +

    Get the entity indices at the given row.

    + + + + + + + + + + + + + + + + + + +
    Parameters
    rowRow to get.
    from outFrom index.
    to outTo index.
    + +
    +
    +

    + std::size_t cubos::core::ecs::SparseRelationTable::firstFrom(uint32_t index) const +

    +

    Gets the first row with the given from index, or size() if there is none.

    + + + + + + + + + + + + + + + + +
    Parameters
    indexFrom index.
    ReturnsFirst row with the given from index.
    +
    +
    +

    + std::size_t cubos::core::ecs::SparseRelationTable::firstTo(uint32_t index) const +

    +

    Gets the first row with the given to index, or size() if there is none.

    + + + + + + + + + + + + + + + + +
    Parameters
    indexTo index.
    ReturnsFirst row with the given to index.
    +
    +
    +

    + std::size_t cubos::core::ecs::SparseRelationTable::nextFrom(std::size_t row) const +

    +

    Gets the next row with the same from index, or size() if there is none.

    + + + + + + + + + + + + + + + + +
    Parameters
    rowRow to get the next from.
    ReturnsNext row with the same from index.
    +
    +
    +

    + std::size_t cubos::core::ecs::SparseRelationTable::nextTo(std::size_t row) const +

    +

    Gets the next row with the same to index, or size() if there is none.

    + + + + + + + + + + + + + + + + +
    Parameters
    rowRow to get the next to.
    ReturnsNext row with the same to index.
    +
    +
    +

    + Iterator cubos::core::ecs::SparseRelationTable::begin() const +

    +

    Gets an iterator to the first relation of the table.

    + + + + + + + +
    ReturnsIterator.
    +
    +
    +

    + Iterator cubos::core::ecs::SparseRelationTable::end() const +

    +

    Gets an iterator which represents the end of the table.

    + + + + + + + +
    ReturnsIterator.
    +
    +
    +

    + View cubos::core::ecs::SparseRelationTable::viewFrom(uint32_t from) const +

    +

    Returns a view of the relations with the given from index.

    + + + + + + + + + + + + + + + + +
    Parameters
    fromFrom index.
    ReturnsRelation view.
    +
    +
    +

    + View cubos::core::ecs::SparseRelationTable::viewTo(uint32_t to) const +

    +

    Returns a view of the relations with the given to index.

    + + + + + + + + + + + + + + + + +
    Parameters
    toTo index.
    ReturnsRelation view.
    +
    +
    +

    + std::size_t cubos::core::ecs::SparseRelationTable::size() const +

    +

    Returns the number of relations on the table.

    + + + + + + + +
    ReturnsRelation count.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SparseRelationTableRegistry.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SparseRelationTableRegistry.html new file mode 100644 index 000000000..e6b30225e --- /dev/null +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SparseRelationTableRegistry.html @@ -0,0 +1,415 @@ + + + + + cubos::core::ecs::SparseRelationTableRegistry class | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + cubos::core::ecs::SparseRelationTableRegistry class + +

    +

    Stores all of the sparse relation tables.

    + +
    +

    Public types

    +
    +
    + class TypeIndex +
    +
    Stores the ids of tables of a given type.
    +
    +
    +
    +

    Constructors, destructors, conversion operators

    +
    +
    + SparseRelationTableRegistry() +
    +
    Constructs.
    +
    +
    +
    +

    Public functions

    +
    +
    + auto contains(SparseRelationTableId id) const -> bool +
    +
    Checks if there's a table with the given identifier.
    +
    + auto create(SparseRelationTableId id, + Types& types) -> SparseRelationTable& +
    +
    Returns a reference to the table with the given identifier.
    +
    + auto at(SparseRelationTableId id) -> SparseRelationTable& +
    +
    Returns a reference to the table with the given identifier.
    +
    + auto at(SparseRelationTableId id) const -> const SparseRelationTable& +
    +
    Returns a reference to the table with the given identifier.
    +
    + auto type(DataTypeId type) const -> const TypeIndex& +
    +
    Returns the index used to search for tables of relations with a given type.
    +
    + void move(ArchetypeId source, + ArchetypeId target, + uint32_t index) +
    +
    Moves all relations of an entity from an archetype to another.
    +
    + void erase(ArchetypeId archetype, + uint32_t index) +
    +
    Removes all relations of an entity.
    +
    + auto forEach(std::size_t counter, + auto func) -> std::size_t +
    +
    Calls the given function for each new table.
    +
    + auto begin() const -> auto +
    +
    Gets an iterator to the start of the type indices of this registry.
    +
    + auto end() const -> auto +
    +
    Gets an iterator to the end of the type indices of this registry.
    +
    +
    +
    +

    Function documentation

    +
    +

    + bool cubos::core::ecs::SparseRelationTableRegistry::contains(SparseRelationTableId id) const +

    +

    Checks if there's a table with the given identifier.

    + + + + + + + + + + + + + + + + +
    Parameters
    idIdentifier.
    ReturnsWhether it contains the table or not.
    +
    +
    +

    + SparseRelationTable& cubos::core::ecs::SparseRelationTableRegistry::create(SparseRelationTableId id, + Types& types) +

    +

    Returns a reference to the table with the given identifier.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    idIdentifier.
    types
    ReturnsReference to table.
    +

    Creates the table if it doesn't exist already.

    +
    +
    +

    + SparseRelationTable& cubos::core::ecs::SparseRelationTableRegistry::at(SparseRelationTableId id) +

    +

    Returns a reference to the table with the given identifier.

    + + + + + + + + + + + + + + + + +
    Parameters
    idIdentifier.
    ReturnsReference to table.
    +

    Aborts if the table doesn't exist.

    +
    +
    +

    + const SparseRelationTable& cubos::core::ecs::SparseRelationTableRegistry::at(SparseRelationTableId id) const +

    +

    Returns a reference to the table with the given identifier.

    + + + + + + + + + + + + + + + + +
    Parameters
    idIdentifier.
    ReturnsReference to table.
    +

    Aborts if the table doesn't exist.

    +
    +
    +

    + const TypeIndex& cubos::core::ecs::SparseRelationTableRegistry::type(DataTypeId type) const +

    +

    Returns the index used to search for tables of relations with a given type.

    + + + + + + + + + + + + + + + + +
    Parameters
    typeType identifier.
    ReturnsType index.
    +
    +
    +

    + void cubos::core::ecs::SparseRelationTableRegistry::move(ArchetypeId source, + ArchetypeId target, + uint32_t index) +

    +

    Moves all relations of an entity from an archetype to another.

    + + + + + + + + + + + + + + + + + + +
    Parameters
    sourceOld archetype.
    targetNew archetype.
    indexEntity index.
    +
    +
    +

    + void cubos::core::ecs::SparseRelationTableRegistry::erase(ArchetypeId archetype, + uint32_t index) +

    +

    Removes all relations of an entity.

    + + + + + + + + + + + + + + +
    Parameters
    archetypeEntity archetype.
    indexEntity index.
    +
    +
    +

    + std::size_t cubos::core::ecs::SparseRelationTableRegistry::forEach(std::size_t counter, + auto func) +

    +

    Calls the given function for each new table.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    counterCounter previously returned by this function. Zero should be used for the first call.
    funcFunction which receives a table identifier.
    ReturnsCounter to be passed to this function in a future call.
    +
    +
    +

    + auto cubos::core::ecs::SparseRelationTableRegistry::begin() const +

    +

    Gets an iterator to the start of the type indices of this registry.

    + + + + + + + +
    ReturnsIterator.
    +
    +
    +

    + auto cubos::core::ecs::SparseRelationTableRegistry::end() const +

    +

    Gets an iterator to the end of the type indices of this registry.

    + + + + + + + +
    ReturnsIterator.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1EntityBuilder.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SparseRelationTableRegistry_1_1TypeIndex.html similarity index 60% rename from docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1EntityBuilder.html rename to docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SparseRelationTableRegistry_1_1TypeIndex.html index 7463bfa71..c2ebf3d8b 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1EntityBuilder.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SparseRelationTableRegistry_1_1TypeIndex.html @@ -2,7 +2,7 @@ - cubos::core::ecs::EntityBuilder class | CUBOS. Docs + cubos::core::ecs::SparseRelationTableRegistry::TypeIndex class | CUBOS. Docs @@ -46,10 +46,10 @@

    - cubos::core::ecs::EntityBuilder class final - + cubos::core::ecs::SparseRelationTableRegistry::TypeIndex class +

    -

    Allows editing an entity created by a Commands object.

    +

    Stores the ids of tables of a given type.

    Function documentation

    -
    +
    +

    + void cubos::core::ecs::SparseRelationTableRegistry::TypeIndex::insert(SparseRelationTableId id) +

    +

    Inserts a new table identifier into the index.

    + + + + + + + + + + +
    Parameters
    idTable identifier.
    +
    +

    - Entity cubos::core::ecs::EntityBuilder::entity() const + const auto& cubos::core::ecs::SparseRelationTableRegistry::TypeIndex::from() const

    -

    Gets the entity this builder is editing.

    +

    Returns a reference to a map which maps archetypes to the tables where it is the 'from' archetype.

    - +
    ReturnsEntity identifier.Map from archetypes to vectors of table identifiers.
    -
    +

    -
    - template<typename ComponentType> -
    - ComponentType& cubos::core::ecs::EntityBuilder::get() + const auto& cubos::core::ecs::SparseRelationTableRegistry::TypeIndex::to() const

    -

    Gets a reference to a component of the entity.

    +

    Returns a reference to a map which maps archetypes to the tables where it is the 'to' archetype.

    - - - - - - - - - - - + +
    Template parameters
    ComponentTypeComponent type.
    ReturnsReference to the component.ReturnsMap from archetypes to vectors of table identifiers.
    -
    +

    -
    - template<typename... ComponentTypes> -
    - EntityBuilder& cubos::core::ecs::EntityBuilder::add(ComponentTypes && ... components) + int cubos::core::ecs::SparseRelationTableRegistry::TypeIndex::maxDepth() const

    -

    Adds components to the entity.

    +

    Returns the maximum depth of the tables in this index.

    - - - - - - - - - - - - - - - - - - - - + +
    Template parameters
    ComponentTypesComponent types.
    Parameters
    componentsComponents to add.
    ReturnsReference to this builder, for chaining.ReturnsMaximum depth.
    diff --git a/docs-preview/pr-862/classcubos_1_1engine_1_1SystemBuilder.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SystemBuilder.html similarity index 75% rename from docs-preview/pr-862/classcubos_1_1engine_1_1SystemBuilder.html rename to docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SystemBuilder.html index d663adf51..892c0698d 100644 --- a/docs-preview/pr-862/classcubos_1_1engine_1_1SystemBuilder.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1SystemBuilder.html @@ -2,7 +2,7 @@ - cubos::engine::SystemBuilder class | CUBOS. Docs + cubos::core::ecs::SystemBuilder class | CUBOS. Docs @@ -46,8 +46,8 @@

    - cubos::engine::SystemBuilder class - + cubos::core::ecs::SystemBuilder class +

    Used to chain configurations related to systems.

    Function documentation

    -
    +

    - cubos::engine::SystemBuilder::SystemBuilder(core::ecs::Dispatcher& dispatcher, + cubos::core::ecs::SystemBuilder::SystemBuilder(core::ecs::Dispatcher& dispatcher, std::vector<std::string>& tags)

    Construct.

    @@ -109,7 +109,7 @@

    dispatcher - Dispatcher being configured. + Dispatcher being configured. tags @@ -118,9 +118,9 @@

    -
    +

    - SystemBuilder& cubos::engine::SystemBuilder::tagged(const std::string& tag) + SystemBuilder& cubos::core::ecs::SystemBuilder::tagged(const std::string& tag)

    Sets the current system's tag.

    @@ -141,9 +141,9 @@

    -
    +

    - SystemBuilder& cubos::engine::SystemBuilder::before(const std::string& tag) + SystemBuilder& cubos::core::ecs::SystemBuilder::before(const std::string& tag)

    Sets the current system to be executed before another tag.

    @@ -164,9 +164,9 @@

    -
    +

    - SystemBuilder& cubos::engine::SystemBuilder::after(const std::string& tag) + SystemBuilder& cubos::core::ecs::SystemBuilder::after(const std::string& tag)

    Sets the current system to be executed after another tag.

    @@ -187,12 +187,12 @@

    -
    +

    template<typename F>
    - SystemBuilder& cubos::engine::SystemBuilder::runIf(F func) + SystemBuilder& cubos::core::ecs::SystemBuilder::runIf(F func)

    Adds a condition to the current system. If this condition returns false, the system will not be executed. For a system to run, all conditions must return true.

    diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Write.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Tables.html similarity index 58% rename from docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Write.html rename to docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Tables.html index 31aaebfec..7086219c1 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Write.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Tables.html @@ -2,7 +2,7 @@ - cubos::core::ecs::Write class | CUBOS. Docs + cubos::core::ecs::Tables class | CUBOS. Docs @@ -46,109 +46,96 @@

    - -
    template<typename T>
    - cubos::core::ecs::Write class + cubos::core::ecs::Tables class final +

    -

    System argument which provides write access to the resource T, or query argument which provides write access to the component T.

    -
    - - - - - - - - - -
    Template parameters
    TResource or component type.
    +

    Stores the tables of a given world.

    -

    Can be used as a pointer with both the -> and * operators.

    -
    -

    Constructors, destructors, conversion operators

    -
    -
    - Write(T& ref) -
    -
    Creates a new write argument.
    -
    -

    Public functions

    - auto operator->() -> T* + auto dense() -> DenseTableRegistry&
    -
    Accesses the resource or component.
    +
    Gets a reference to the dense table registry.
    - auto operator*() -> T& + auto dense() const -> const DenseTableRegistry&
    -
    Accesses the resource or component.
    +
    Gets a reference to the dense table registry.
    +
    + auto sparseRelation() -> SparseRelationTableRegistry& +
    +
    Gets a reference to the sparse relation table registry.
    +
    + auto sparseRelation() const -> const SparseRelationTableRegistry& +
    +
    Gets a reference to the sparse relation table registry.

    Function documentation

    -
    +
    +

    + DenseTableRegistry& cubos::core::ecs::Tables::dense() +

    +

    Gets a reference to the dense table registry.

    + + + + + + + +
    ReturnsReference to dense table registry.
    +
    +

    -
    - template<typename T> -
    - cubos::core::ecs::Write<T>::Write(T& ref) + const DenseTableRegistry& cubos::core::ecs::Tables::dense() const

    -

    Creates a new write argument.

    +

    Gets a reference to the dense table registry.

    - - - - + - - + + - +
    Parameters
    refReference to the resource or component.ReturnsReference to dense table registry.
    -
    +

    -
    - template<typename T> -
    - T* cubos::core::ecs::Write<T>::operator->() + SparseRelationTableRegistry& cubos::core::ecs::Tables::sparseRelation()

    -

    Accesses the resource or component.

    +

    Gets a reference to the sparse relation table registry.

    - +
    ReturnsPointer to the resource or component.Reference to sparse relation table registry.
    -
    +

    -
    - template<typename T> -
    - T& cubos::core::ecs::Write<T>::operator*() + const SparseRelationTableRegistry& cubos::core::ecs::Tables::sparseRelation() const

    -

    Accesses the resource or component.

    +

    Gets a reference to the sparse relation table registry.

    - +
    ReturnsReference to the resource or component.Reference to sparse relation table registry.
    diff --git a/docs-preview/pr-862/classcubos_1_1engine_1_1TagBuilder.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1TagBuilder.html similarity index 77% rename from docs-preview/pr-862/classcubos_1_1engine_1_1TagBuilder.html rename to docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1TagBuilder.html index 4d0c9efdc..a55937aa0 100644 --- a/docs-preview/pr-862/classcubos_1_1engine_1_1TagBuilder.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1TagBuilder.html @@ -2,7 +2,7 @@ - cubos::engine::TagBuilder class | CUBOS. Docs + cubos::core::ecs::TagBuilder class | CUBOS. Docs @@ -46,8 +46,8 @@

    - cubos::engine::TagBuilder class - + cubos::core::ecs::TagBuilder class +

    Used to chain configurations related to tags.

    Function documentation

    -
    +

    - cubos::engine::TagBuilder::TagBuilder(core::ecs::Dispatcher& dispatcher, + cubos::core::ecs::TagBuilder::TagBuilder(core::ecs::Dispatcher& dispatcher, std::vector<std::string>& tags)

    Construct.

    @@ -105,7 +105,7 @@

    dispatcher - Dispatcher being configured + Dispatcher being configured tags @@ -120,9 +120,9 @@

    -
    +

    - TagBuilder& cubos::engine::TagBuilder::before(const std::string& tag) + TagBuilder& cubos::core::ecs::TagBuilder::before(const std::string& tag)

    Sets the current tag to be executed before another tag.

    @@ -143,9 +143,9 @@

    -
    +

    - TagBuilder& cubos::engine::TagBuilder::after(const std::string& tag) + TagBuilder& cubos::core::ecs::TagBuilder::after(const std::string& tag)

    Sets the current tag to be executed after another tag.

    @@ -166,12 +166,12 @@

    -
    +

    template<typename F>
    - TagBuilder& cubos::engine::TagBuilder::runIf(F func) + TagBuilder& cubos::core::ecs::TagBuilder::runIf(F func)

    Adds a condition to the current tag. If this condition returns false, systems with this tag will not be executed. For the tagged systems to run, all conditions must return true.

    diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1RelationTypeBuilder.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1TypeBuilder.html similarity index 64% rename from docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1RelationTypeBuilder.html rename to docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1TypeBuilder.html index e12d1e5cb..e5b4fe9ff 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1RelationTypeBuilder.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1TypeBuilder.html @@ -2,7 +2,7 @@ - cubos::core::ecs::RelationTypeBuilder class | CUBOS. Docs + cubos::core::ecs::TypeBuilder class | CUBOS. Docs @@ -46,11 +46,11 @@

    - +
    template<typename T>
    - cubos::core::ecs::RelationTypeBuilder class + cubos::core::ecs::TypeBuilder class

    -

    Builder for reflection::Type objects which represent relation types.

    +

    Builder for reflection::Type objects which represent ECS types.

    @@ -74,12 +74,12 @@

    Contents

    -

    Used to reduce the amount of boilerplate code required to define a relation type. Automatically adds the reflection::ConstructibleTrait and reflection::FieldsTrait. The type T must be default-constructible, copy-constructible and move-constructible.

    +

    Used to reduce the amount of boilerplate code required to define a ECS types. Automatically adds the reflection::ConstructibleTrait and reflection::FieldsTrait. The type T must be default-constructible, copy-constructible and move-constructible.

    Constructors, destructors, conversion operators

    - RelationTypeBuilder(std::string name) + TypeBuilder(std::string name)
    Constructs.
    @@ -87,26 +87,34 @@

    Constructors, destructors, conversion operators<

    Public functions

    +
    + auto symmetric() && -> TypeBuilder&& +
    +
    Makes the type symmetric. Only used by relation types.
    +
    + auto tree() && -> TypeBuilder&& +
    +
    Makes the type a tree relation. Only used by relation types.
    template<typename F>
    - auto withField(std::string name, - F T::* pointer) && -> RelationTypeBuilder&& + auto withField(std::string name, + F T::* pointer) && -> TypeBuilder&&
    -
    Adds a field to the relation type.
    +
    Adds a field to the type.
    - auto build() && -> reflection::Type& + auto build() && -> reflection::Type&
    -
    Builds the relation type.
    +
    Builds the type.

    Function documentation

    -
    +

    template<typename T>
    - cubos::core::ecs::RelationTypeBuilder<T>::RelationTypeBuilder(std::string name) + cubos::core::ecs::TypeBuilder<T>::TypeBuilder(std::string name)

    Constructs.

    Template parameters
    @@ -116,21 +124,55 @@

    - +
    nameRelation type name, including namespace.Type name, including namespace.
    -
    +
    +

    +
    + template<typename T> +
    + TypeBuilder&& cubos::core::ecs::TypeBuilder<T>::symmetric() && +

    +

    Makes the type symmetric. Only used by relation types.

    + + + + + + + +
    ReturnsBuilder.
    +
    +
    +

    +
    + template<typename T> +
    + TypeBuilder&& cubos::core::ecs::TypeBuilder<T>::tree() && +

    +

    Makes the type a tree relation. Only used by relation types.

    + + + + + + + +
    ReturnsBuilder.
    +
    +

    template<typename T> template<typename F>
    - RelationTypeBuilder&& cubos::core::ecs::RelationTypeBuilder<T>::withField(std::string name, + TypeBuilder&& cubos::core::ecs::TypeBuilder<T>::withField(std::string name, F T::* pointer) &&

    -

    Adds a field to the relation type.

    +

    Adds a field to the type.

    @@ -162,14 +204,14 @@

    Template parameters
    -
    +

    template<typename T>
    - reflection::Type& cubos::core::ecs::RelationTypeBuilder<T>::build() && + reflection::Type& cubos::core::ecs::TypeBuilder<T>::build() &&

    -

    Builds the relation type.

    +

    Builds the type.

    diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Types.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Types.html new file mode 100644 index 000000000..53db00c1a --- /dev/null +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Types.html @@ -0,0 +1,400 @@ + + + + + cubos::core::ecs::Types class | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + cubos::core::ecs::Types class final + +

    +

    Registry of all data types used in an ECS world.

    + +
    +

    Public functions

    +
    +
    + void addComponent(const reflection::Type& type) +
    +
    Registers a component type.
    +
    + void addRelation(const reflection::Type& type) +
    +
    Registers a relation type.
    +
    + auto id(const reflection::Type& type) const -> DataTypeId +
    +
    Gets the identifier of a data type.
    +
    + auto id(const std::string& name) const -> DataTypeId +
    +
    Gets the identifier of a data type.
    +
    + auto type(DataTypeId id) const -> const reflection::Type& +
    +
    Gets a data type from its identifier.
    +
    + auto contains(const std::string& name) const -> bool +
    +
    Checks if a data type is registered.
    +
    + auto isComponent(DataTypeId id) const -> bool +
    +
    Checks if the given data type is a component.
    +
    + auto isRelation(DataTypeId id) const -> bool +
    +
    Checks if the given data type is a relation.
    +
    + auto isSymmetricRelation(DataTypeId id) const -> bool +
    +
    Checks if the given data type is a symmetric relation.
    +
    + auto isTreeRelation(DataTypeId id) const -> bool +
    +
    Checks if the given data type is a tree relation.
    +
    + auto components() const -> reflection::TypeRegistry +
    +
    Gets a type registry with only the component types.
    +
    +
    +
    +

    Function documentation

    +
    +

    + void cubos::core::ecs::Types::addComponent(const reflection::Type& type) +

    +

    Registers a component type.

    +
    + + + + + + + + + +
    Parameters
    typeComponent type.
    +
    +
    +

    + void cubos::core::ecs::Types::addRelation(const reflection::Type& type) +

    +

    Registers a relation type.

    + + + + + + + + + + +
    Parameters
    typeRelation type.
    +
    +
    +

    + DataTypeId cubos::core::ecs::Types::id(const reflection::Type& type) const +

    +

    Gets the identifier of a data type.

    + + + + + + + + + + + + + + + + +
    Parameters
    typeData type.
    ReturnsData type identifier.
    +

    Aborts if the data type is not registered.

    +
    +
    +

    + DataTypeId cubos::core::ecs::Types::id(const std::string& name) const +

    +

    Gets the identifier of a data type.

    + + + + + + + + + + + + + + + + +
    Parameters
    nameData type name.
    ReturnsData type identifier.
    +

    Aborts if the data type is not registered.

    +
    +
    +

    + const reflection::Type& cubos::core::ecs::Types::type(DataTypeId id) const +

    +

    Gets a data type from its identifier.

    + + + + + + + + + + + + + + + + +
    Parameters
    idData type identifier.
    ReturnsData type.
    +
    +
    +

    + bool cubos::core::ecs::Types::contains(const std::string& name) const +

    +

    Checks if a data type is registered.

    + + + + + + + + + + + + + + + + +
    Parameters
    nameData type name.
    ReturnsWhether the data type is registered.
    +
    +
    +

    + bool cubos::core::ecs::Types::isComponent(DataTypeId id) const +

    +

    Checks if the given data type is a component.

    + + + + + + + + + + + + + + + + +
    Parameters
    idData type identifier.
    ReturnsWhether the identifier refers to a component.
    +
    +
    +

    + bool cubos::core::ecs::Types::isRelation(DataTypeId id) const +

    +

    Checks if the given data type is a relation.

    + + + + + + + + + + + + + + + + +
    Parameters
    idData type identifier.
    ReturnsWhether the identifier refers to a relation.
    +
    +
    +

    + bool cubos::core::ecs::Types::isSymmetricRelation(DataTypeId id) const +

    +

    Checks if the given data type is a symmetric relation.

    + + + + + + + + + + + + + + + + +
    Parameters
    idData type identifier.
    ReturnsWhether the identifier refers to a symmetric relation.
    +
    +
    +

    + bool cubos::core::ecs::Types::isTreeRelation(DataTypeId id) const +

    +

    Checks if the given data type is a tree relation.

    + + + + + + + + + + + + + + + + +
    Parameters
    idData type identifier.
    ReturnsWhether the identifier refers to a tree relation.
    +
    +
    +

    + reflection::TypeRegistry cubos::core::ecs::Types::components() const +

    +

    Gets a type registry with only the component types.

    + + + + + + + +
    ReturnsComponent type registry.
    +
    +
    +
    +
    +
    + + + + +
    + + diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1World.html b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1World.html index 5ce5541d8..1ca8dc367 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1World.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1World.html @@ -56,32 +56,12 @@

    Contents

  • Reference
  • - -
    -

    Public types

    -
    -
    - using Iterator = EntityManager::Iterator -
    -
    Used to iterate over all entities in a world.
    -
    -
    -
    -

    Constructors, destructors, conversion operators

    -
    -
    - World(std::size_t initialCapacity = 1024) -
    -
    Constructs with the given initialCapacity.
    -
    -
    +

    Public functions

    @@ -99,6 +79,39 @@

    Public functions

    void registerComponent()
    Registers a component type.
    +
    + void registerRelation(const reflection::Type& type) +
    +
    Registers a relation type.
    +
    + + void registerRelation() +
    +
    Registers a relation type.
    +
    + auto types() -> Types& +
    +
    Returns the types registry of the world.
    +
    + auto types() const -> const Types& +
    +
    Returns the types registry of the world.
    +
    + auto tables() -> Tables& +
    +
    Returns the tables of the world.
    +
    + auto tables() const -> const Tables& +
    +
    Returns the tables of the world.
    +
    + auto archetypeGraph() -> ArchetypeGraph& +
    +
    Returns the archetype graph of the world.
    +
    + auto archetypeGraph() const -> const ArchetypeGraph& +
    +
    Returns the archetype graph of the world.
    template<typename T>
    auto read() const -> ReadResource<T> @@ -113,18 +126,30 @@

    Public functions

    auto create() -> Entity
    Creates a new entity.
    +
    + void createAt(Entity entity) +
    +
    Creates a new entity with the given identifier.
    +
    + auto reserve() -> Entity +
    +
    Reserves an entity identifier, without actually creating an entity.
    void destroy(Entity entity)
    Destroys an entity.
    - auto isAlive(Entity entity) const -> bool + auto generation(uint32_t index) const -> uint32_t
    -
    Checks if an entity is still alive.
    +
    Gets the generation of the entity with the given index.
    - auto components() const -> reflection::TypeRegistry + auto archetype(Entity entity) const -> ArchetypeId +
    +
    Gets the archetype of the given entity.
    +
    + auto isAlive(Entity entity) const -> bool
    -
    Returns a type registry which contains all registered component types.
    +
    Checks if an entity is still alive.
    auto components(Entity entity) -> Components
    @@ -134,34 +159,71 @@

    Public functions

    Creates a components view for the given entity.
    - auto begin() const -> Iterator + void relate(Entity from, + Entity to, + const reflection::Type& type, + void* value) +
    +
    Inserts a relation between the two given entities.
    +
    + + void relate(Entity from, + Entity to, + T value) +
    +
    Inserts a relation between the two given entities.
    +
    + void unrelate(Entity from, + Entity to, + const reflection::Type& type) +
    +
    Removes the relation, if there's any, between the two given entities.
    +
    + + void unrelate(Entity from, + Entity to) +
    +
    Removes the relation, if there's any, between the two given entities.
    +
    + auto related(Entity from, + Entity to, + const reflection::Type& type) const -> bool +
    +
    Checks if there's a relation of the given type between the two given entities.
    +
    +
    template<typename T>
    + auto related(Entity from, + Entity to) const -> bool +
    +
    Checks if there's a relation of the given type between the two given entities.
    +
    + auto relation(Entity from, + Entity to, + const reflection::Type& type) -> void* +
    +
    Gets a pointer to the relation value between the two given entities.
    +
    + auto relation(Entity from, + Entity to, + const reflection::Type& type) const -> const void* +
    +
    Gets a pointer to the relation value between the two given entities.
    +
    +
    template<typename T>
    + auto relation(Entity from, + Entity to) -> T&
    -
    Returns an iterator which points to the first entity of the world.
    +
    Gets a reference to the relation value between the two given entities.
    - auto end() const -> Iterator +
    template<typename T>
    + auto relation(Entity from, + Entity to) const -> const T&
    -
    Returns an iterator which points to the end of the world.
    +
    Gets a reference to the relation value between the two given entities.

    Function documentation

    -
    -

    - cubos::core::ecs::World::World(std::size_t initialCapacity = 1024) -

    -

    Constructs with the given initialCapacity.

    - - - - - - - - - - -
    Parameters
    initialCapacityHow many entities to reserve space for.
    -

    @@ -181,7 +243,7 @@

    TArgs - Types of the arguments of the constructor of the resource. + Types of the arguments of the constructor of the resource. @@ -190,11 +252,11 @@

    args - Arguments of the constructor of the resource. + Arguments of the constructor of the resource. - +

    @@ -232,6 +294,128 @@

    + +

    +
    +

    + void cubos::core::ecs::World::registerRelation(const reflection::Type& type) +

    +

    Registers a relation type.

    + + + + + + + + + + +
    Parameters
    typeRelation type.
    +
    +
    +

    +
    + template<reflection::Reflectable T> +
    + void cubos::core::ecs::World::registerRelation() +

    +

    Registers a relation type.

    + + + + + + + + + + +
    Template parameters
    TRelation type.
    +
    +
    +

    + Types& cubos::core::ecs::World::types() +

    +

    Returns the types registry of the world.

    + + + + + + + +
    ReturnsTypes registry.
    +
    +
    +

    + const Types& cubos::core::ecs::World::types() const +

    +

    Returns the types registry of the world.

    + + + + + + + +
    ReturnsTypes registry.
    +
    +
    +

    + Tables& cubos::core::ecs::World::tables() +

    +

    Returns the tables of the world.

    + + + + + + + +
    ReturnsTables.
    +
    +
    +

    + const Tables& cubos::core::ecs::World::tables() const +

    +

    Returns the tables of the world.

    + + + + + + + +
    ReturnsTables.
    +
    +
    +

    + ArchetypeGraph& cubos::core::ecs::World::archetypeGraph() +

    +

    Returns the archetype graph of the world.

    + + + + + + + +
    ReturnsArchetype graph.
    +
    +
    +

    + const ArchetypeGraph& cubos::core::ecs::World::archetypeGraph() const +

    +

    Returns the archetype graph of the world.

    + + + + + + + +
    ReturnsArchetype graph.

    @@ -294,10 +478,49 @@

    Returns + Entity identifier. + + + +

    +
    +

    + void cubos::core::ecs::World::createAt(Entity entity) +

    +

    Creates a new entity with the given identifier.

    + + + + + + + + + + + + +
    Parameters
    entityEntity identifier.
    Returns Entity.
    +

    Aborts if the entity already exists.

    +
    +
    +

    + Entity cubos::core::ecs::World::reserve() +

    +

    Reserves an entity identifier, without actually creating an entity.

    + + + + + + + +
    ReturnsEntity identifier.
    +

    The entity can be later created with a call to createAt().

    @@ -317,11 +540,34 @@

    If an entity has already been destroyed, this function does nothing.

    -
    +

    - bool cubos::core::ecs::World::isAlive(Entity entity) const + uint32_t cubos::core::ecs::World::generation(uint32_t index) const

    -

    Checks if an entity is still alive.

    +

    Gets the generation of the entity with the given index.

    + + + + + + + + + + + + + + + + +
    Parameters
    indexEntity index.
    ReturnsEntity generation.
    +
    +
    +

    + ArchetypeId cubos::core::ecs::World::archetype(Entity entity) const +

    +

    Gets the archetype of the given entity.

    @@ -335,21 +581,30 @@

    - +
    Parameters
    ReturnsWhether the entity is alive.Archetype identifier.
    -
    +

    - reflection::TypeRegistry cubos::core::ecs::World::components() const + bool cubos::core::ecs::World::isAlive(Entity entity) const

    -

    Returns a type registry which contains all registered component types.

    +

    Checks if an entity is still alive.

    + + + + + + + + + - - + +
    Parameters
    entityEntity.
    ReturnsComponent type registry.ReturnsWhether the entity is alive.
    @@ -402,33 +657,362 @@

    The given entity must be alive.

    -
    +
    +

    + void cubos::core::ecs::World::relate(Entity from, + Entity to, + const reflection::Type& type, + void* value) +

    +

    Inserts a relation between the two given entities.

    + + + + + + + + + + + + + + + + + + + + + + +
    Parameters
    fromFrom entity.
    toTo entity.
    typeRelation type.
    valueRelation value to move.
    +

    If the relation already exists, it is overwritten.

    +
    +
    +

    +
    + template<reflection::Reflectable T> +
    + void cubos::core::ecs::World::relate(Entity from, + Entity to, + T value) +

    +

    Inserts a relation between the two given entities.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Template parameters
    TRelation type.
    Parameters
    fromFrom entity.
    toTo entity.
    valueRelation value.
    +

    If the relation already exists, it is overwritten.

    +
    +
    +

    + void cubos::core::ecs::World::unrelate(Entity from, + Entity to, + const reflection::Type& type) +

    +

    Removes the relation, if there's any, between the two given entities.

    + + + + + + + + + + + + + + + + + + +
    Parameters
    fromFrom entity.
    toTo entity.
    typeRelation type.
    +
    +
    +

    +
    + template<reflection::Reflectable T> +
    + void cubos::core::ecs::World::unrelate(Entity from, + Entity to) +

    +

    Removes the relation, if there's any, between the two given entities.

    + + + + + + + + + + + + + + + + + + + + + + + +
    Template parameters
    TRelation type.
    Parameters
    fromFrom entity.
    toTo entity.
    +
    +

    - Iterator cubos::core::ecs::World::begin() const + bool cubos::core::ecs::World::related(Entity from, + Entity to, + const reflection::Type& type) const

    -

    Returns an iterator which points to the first entity of the world.

    +

    Checks if there's a relation of the given type between the two given entities.

    + + + + + + + + + + + + + + + + + - - + + + + +
    Parameters
    fromFrom entity.
    toTo entity.
    typeRelation type.
    ReturnsIterator.ReturnsWhether the relation exists.
    +
    +
    +

    +
    + template<typename T> +
    + bool cubos::core::ecs::World::related(Entity from, + Entity to) const +

    +

    Checks if there's a relation of the given type between the two given entities.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Template parameters
    TRelation type.
    Parameters
    fromFrom entity.
    toTo entity.
    ReturnsWhether the relation exists.
    +
    +
    +

    + void* cubos::core::ecs::World::relation(Entity from, + Entity to, + const reflection::Type& type) +

    +

    Gets a pointer to the relation value between the two given entities.

    + + + + + + + + + + + + + + + + + + + + + +
    Parameters
    fromFrom entity.
    toTo entity.
    typeRelation type.
    ReturnsPointer to relation value.
    +

    The relation must exist.

    -
    +

    - Iterator cubos::core::ecs::World::end() const + const void* cubos::core::ecs::World::relation(Entity from, + Entity to, + const reflection::Type& type) const

    -

    Returns an iterator which points to the end of the world.

    +

    Gets a pointer to the relation value between the two given entities.

    + + + + + + + + + + + + + + + + + - - + + + + +
    Parameters
    fromFrom entity.
    toTo entity.
    typeRelation type.
    ReturnsIterator.ReturnsPointer to relation value.
    +

    The relation must exist.

    +
    +
    +

    +
    + template<typename T> +
    + T& cubos::core::ecs::World::relation(Entity from, + Entity to) +

    +

    Gets a reference to the relation value between the two given entities.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Template parameters
    TRelation type.
    Parameters
    fromFrom entity.
    toTo entity.
    ReturnsReference to relation value.
    +

    The relation must exist.

    +
    +
    +

    +
    + template<typename T> +
    + const T& cubos::core::ecs::World::relation(Entity from, + Entity to) const +

    +

    Gets a reference to the relation value between the two given entities.

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Template parameters
    TRelation type.
    Parameters
    fromFrom entity.
    toTo entity.
    ReturnsReference to relation value.
    +

    The relation must exist.

    diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1memory_1_1AnyVector.html b/docs-preview/pr-862/classcubos_1_1core_1_1memory_1_1AnyVector.html index 056745d87..ad0b5ebc4 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1memory_1_1AnyVector.html +++ b/docs-preview/pr-862/classcubos_1_1core_1_1memory_1_1AnyVector.html @@ -86,6 +86,10 @@

    Public functions

    void reserve(std::size_t capacity)
    Reserves space for at least capacity elements.
    +
    + void pushUninit() +
    +
    Pushes an uninitialized element to the back of the vector.
    void pushDefault()
    @@ -98,10 +102,33 @@

    Public functions

    void pushMove(void* value)
    Pushes a new move-constructed element to the back of the vector.
    +
    + void setDefault(std::size_t index) +
    +
    Overwrites the element at the given index with a new default-constructed element.
    +
    + void setCopy(std::size_t index, + const void* value) +
    +
    Overwrites the element at the given index with a new copy-constructed element.
    +
    + void setMove(std::size_t index, + void* value) +
    +
    Overwrites the element at the given index with a new move-constructed element.
    void pop()
    Removes the last element from the vector.
    +
    + void swapErase(std::size_t index) +
    +
    Removes the element at the given index from the vector, moving the last element to its place if it isn't the last element.
    +
    + void swapMove(std::size_t index, + void* destination) +
    +
    Moves the element at the given index from the vector into the given address, moving the last element to its place if it isn't the last element.
    void clear()
    @@ -196,6 +223,13 @@

    +

    +
    +

    + void cubos::core::memory::AnyVector::pushUninit() +

    +

    Pushes an uninitialized element to the back of the vector.

    +

    @@ -210,6 +244,70 @@

    Pushes a new copy-constructed element to the back of the vector.

    +
    +
    +

    + void cubos::core::memory::AnyVector::setDefault(std::size_t index) +

    +

    Overwrites the element at the given index with a new default-constructed element.

    + + + + + + + + + + +
    Parameters
    indexElement index.
    + +
    +
    +

    + void cubos::core::memory::AnyVector::setCopy(std::size_t index, + const void* value) +

    +

    Overwrites the element at the given index with a new copy-constructed element.

    + + + + + + + + + + + + + + +
    Parameters
    indexElement index.
    value
    + +
    +
    +

    + void cubos::core::memory::AnyVector::setMove(std::size_t index, + void* value) +

    +

    Overwrites the element at the given index with a new move-constructed element.

    + + + + + + + + + + + + + + +
    Parameters
    indexElement index.
    value
    +

    @@ -217,6 +315,47 @@

    Removes the last element from the vector.

    +
    +
    +

    + void cubos::core::memory::AnyVector::swapErase(std::size_t index) +

    +

    Removes the element at the given index from the vector, moving the last element to its place if it isn't the last element.

    + + + + + + + + + + +
    Parameters
    indexElement index.
    + +
    +
    +

    + void cubos::core::memory::AnyVector::swapMove(std::size_t index, + void* destination) +

    +

    Moves the element at the given index from the vector into the given address, moving the last element to its place if it isn't the last element.

    + + + + + + + + + + + + + + +
    Parameters
    indexElement index.
    destinationAddress to move the element to.
    +

    diff --git a/docs-preview/pr-862/classcubos_1_1engine_1_1BaseRenderer.html b/docs-preview/pr-862/classcubos_1_1engine_1_1BaseRenderer.html index d74e4627b..fa15305b4 100644 --- a/docs-preview/pr-862/classcubos_1_1engine_1_1BaseRenderer.html +++ b/docs-preview/pr-862/classcubos_1_1engine_1_1BaseRenderer.html @@ -66,7 +66,7 @@

    Contents

    -

    This abstraction allows us to, for example, switch between a raytracing and a deferred rendering method as we need to, without changing the API. This is useful since not all computers support realtime raytracing.

    +

    This abstraction allows us to, for example, switch between a raytracing and a deferred rendering method as we need to, without changing the API. This is useful since not all computers support realtime raytracing.

    Derived classes

    @@ -119,10 +119,11 @@

    Public functions

    Gets the current size of the renderer's framebuffers.
    - void render(const glm::mat4& view, + void render(const glm::mat4& view, const Viewport& viewport, const engine::Camera& camera, const RendererFrame& frame, + const core::gl::Framebuffer& pickingBuffer = nullptr, bool usePostProcessing = true, const core::gl::Framebuffer& target = nullptr)
    @@ -141,13 +142,14 @@

    Protected functions

    Called when resize() is called.
    - void onRender(const glm::mat4& view, + void onRender(const glm::mat4& view, const Viewport& viewport, const Camera& camera, const RendererFrame& frame, - core::gl::Framebuffer target) pure virtual + core::gl::Framebuffer target, + core::gl::Framebuffer pickingBuffer) pure virtual
    -
    Called when render() is called, before applying post processing effects.
    +
    Called when render() is called, before applying post processing effects.
    @@ -255,12 +257,13 @@

    -
    +

    - void cubos::engine::BaseRenderer::render(const glm::mat4& view, + void cubos::engine::BaseRenderer::render(const glm::mat4& view, const Viewport& viewport, const engine::Camera& camera, const RendererFrame& frame, + const core::gl::Framebuffer& pickingBuffer = nullptr, bool usePostProcessing = true, const core::gl::Framebuffer& target = nullptr)

    @@ -286,6 +289,10 @@

    frame Frame to draw. + + pickingBuffer + Screen picking framebuffer. + usePostProcessing Whether to use post processing. @@ -329,15 +336,16 @@

    Renderer implementations should override this function to resize their framebuffers.

    -
    +

    - void cubos::engine::BaseRenderer::onRender(const glm::mat4& view, + void cubos::engine::BaseRenderer::onRender(const glm::mat4& view, const Viewport& viewport, const Camera& camera, const RendererFrame& frame, - core::gl::Framebuffer target) pure virtual protected + core::gl::Framebuffer target, + core::gl::Framebuffer pickingBuffer) pure virtual protected

    -

    Called when render() is called, before applying post processing effects.

    +

    Called when render() is called, before applying post processing effects.

    @@ -363,6 +371,10 @@

    + + + +
    Parameters
    target Target framebuffer.
    pickingBufferScreen picking framebuffer.

    Renderer implementations should implement this function to draw the frame. When post processing is enabled, the target framebuffer will be the internal texture which will be used for post processing.

    diff --git a/docs-preview/pr-862/classcubos_1_1engine_1_1DeferredRenderer.html b/docs-preview/pr-862/classcubos_1_1engine_1_1DeferredRenderer.html index 8dc14dd66..3c68c7ae6 100644 --- a/docs-preview/pr-862/classcubos_1_1engine_1_1DeferredRenderer.html +++ b/docs-preview/pr-862/classcubos_1_1engine_1_1DeferredRenderer.html @@ -106,13 +106,14 @@

    Protected functions

    Called when resize() is called.
    - void onRender(const glm::mat4& view, + void onRender(const glm::mat4& view, const Viewport& viewport, const Camera& camera, const RendererFrame& frame, - core::gl::Framebuffer target) override + core::gl::Framebuffer target, + core::gl::Framebuffer pickingBuffer) override
    -
    Called when render() is called, before applying post processing effects.
    +
    Called when render() is called, before applying post processing effects.
    @@ -202,15 +203,16 @@

    Renderer implementations should override this function to resize their framebuffers.

    -
    +

    - void cubos::engine::DeferredRenderer::onRender(const glm::mat4& view, + void cubos::engine::DeferredRenderer::onRender(const glm::mat4& view, const Viewport& viewport, const Camera& camera, const RendererFrame& frame, - core::gl::Framebuffer target) override protected + core::gl::Framebuffer target, + core::gl::Framebuffer pickingBuffer) override protected

    -

    Called when render() is called, before applying post processing effects.

    +

    Called when render() is called, before applying post processing effects.

    @@ -236,6 +238,10 @@

    + + + +
    Parameters
    target Target framebuffer.
    pickingBufferScreen picking framebuffer.

    Renderer implementations should implement this function to draw the frame. When post processing is enabled, the target framebuffer will be the internal texture which will be used for post processing.

    diff --git a/docs-preview/pr-862/classcubos_1_1engine_1_1RendererFrame.html b/docs-preview/pr-862/classcubos_1_1engine_1_1RendererFrame.html index 3687540a7..89a627958 100644 --- a/docs-preview/pr-862/classcubos_1_1engine_1_1RendererFrame.html +++ b/docs-preview/pr-862/classcubos_1_1engine_1_1RendererFrame.html @@ -76,8 +76,9 @@

    Public types

    Public functions

    - void draw(RendererGrid grid, - glm::mat4 modelMat) + void draw(RendererGrid grid, + glm::mat4 modelMat, + uint32_t entityIndex)
    Submits a draw command.
    @@ -136,10 +137,11 @@

    Public functions

    Function documentation

    -
    +

    - void cubos::engine::RendererFrame::draw(RendererGrid grid, - glm::mat4 modelMat) + void cubos::engine::RendererFrame::draw(RendererGrid grid, + glm::mat4 modelMat, + uint32_t entityIndex)

    Submits a draw command.

    @@ -155,6 +157,10 @@

    + + + +
    modelMat Model matrix of the grid, used for applying transformations.
    entityIndexIdentifier of the entity being drawn.
    diff --git a/docs-preview/pr-862/classcubos_1_1engine_1_1ScreenPicker.html b/docs-preview/pr-862/classcubos_1_1engine_1_1ScreenPicker.html index 75cb4e1d5..d95e11cd9 100644 --- a/docs-preview/pr-862/classcubos_1_1engine_1_1ScreenPicker.html +++ b/docs-preview/pr-862/classcubos_1_1engine_1_1ScreenPicker.html @@ -47,7 +47,7 @@

    cubos::engine::ScreenPicker class final - +

    Resource which provides a texture to store entity/gizmo ids, for selection with a mouse.

    diff --git a/docs-preview/pr-862/cubos_8hpp.html b/docs-preview/pr-862/cubos_8hpp.html index aaeac5659..d701d7f23 100644 --- a/docs-preview/pr-862/cubos_8hpp.html +++ b/docs-preview/pr-862/cubos_8hpp.html @@ -2,7 +2,7 @@ - engine/cubos.hpp file | CUBOS. Docs + core/ecs/cubos.hpp file | CUBOS. Docs @@ -46,9 +46,9 @@

    - engine/cubos.hpp file + core/ecs/cubos.hpp file

    -

    Class cubos::engine::Cubos.

    +

    Class cubos::engine::Cubos.

    Classes

    - struct cubos::engine::DeltaTime + struct cubos::core::ecs::DeltaTime
    Resource which stores the time since the last iteration of the main loop started.
    - struct cubos::engine::ShouldQuit + struct cubos::core::ecs::ShouldQuit
    Resource used as a flag to indicate whether the main loop should stop running.
    - struct cubos::engine::Arguments + struct cubos::core::ecs::Arguments
    Resource which stores the command-line arguments.
    - class cubos::engine::TagBuilder + class cubos::core::ecs::TagBuilder
    Used to chain configurations related to tags.
    - class cubos::engine::SystemBuilder + class cubos::core::ecs::SystemBuilder
    Used to chain configurations related to systems.
    - class cubos::engine::Cubos + class cubos::core::ecs::Cubos
    Represents the engine itself, and exposes the interface with which the game developer interacts with. Ties up all the different parts of the engine together.
    diff --git a/docs-preview/pr-862/data_8hpp.html b/docs-preview/pr-862/data_8hpp.html new file mode 100644 index 000000000..0b64cd270 --- /dev/null +++ b/docs-preview/pr-862/data_8hpp.html @@ -0,0 +1,135 @@ + + + + + core/ecs/query/data.hpp file | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/dense_2registry_8hpp.html b/docs-preview/pr-862/dense_2registry_8hpp.html new file mode 100644 index 000000000..929f2f20e --- /dev/null +++ b/docs-preview/pr-862/dense_2registry_8hpp.html @@ -0,0 +1,134 @@ + + + + + core/ecs/table/dense/registry.hpp file | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/dense_2table_8hpp.html b/docs-preview/pr-862/dense_2table_8hpp.html new file mode 100644 index 000000000..c6a5eb9e1 --- /dev/null +++ b/docs-preview/pr-862/dense_2table_8hpp.html @@ -0,0 +1,134 @@ + + + + + core/ecs/table/dense/table.hpp file | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/dir_0b39c986537c7114081f36bbdae17547.html b/docs-preview/pr-862/dir_0b39c986537c7114081f36bbdae17547.html new file mode 100644 index 000000000..ccb9f5124 --- /dev/null +++ b/docs-preview/pr-862/dir_0b39c986537c7114081f36bbdae17547.html @@ -0,0 +1,132 @@ + + + + + core/ecs/table/ directory | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/dir_1849b6590c20a7c40f18c0337f505edf.html b/docs-preview/pr-862/dir_1849b6590c20a7c40f18c0337f505edf.html index da57d9ee1..0e3bdc045 100644 --- a/docs-preview/pr-862/dir_1849b6590c20a7c40f18c0337f505edf.html +++ b/docs-preview/pr-862/dir_1849b6590c20a7c40f18c0337f505edf.html @@ -71,14 +71,12 @@

    Directories

    Files

    -
    file accessors.hpp
    -
    Class cubos::core::ecs::Read and related types.
    file commands.hpp
    -
    Class cubos::core::ecs::Commands and related types.
    +
    Class cubos::core::ecs::Commands.
    file dispatcher.hpp
    Class cubos::core::ecs::Dispatcher.
    file query.hpp
    -
    Class cubos::core::ecs::Query and related types.
    +
    Class cubos::core::ecs::Query.
    file system.hpp
    Class cubos::core::ecs::SystemWrapper and related types.
    diff --git a/docs-preview/pr-862/dir_26a5878ebb5e9988b6ffa6f152301254.html b/docs-preview/pr-862/dir_26a5878ebb5e9988b6ffa6f152301254.html new file mode 100644 index 000000000..0d4997d7b --- /dev/null +++ b/docs-preview/pr-862/dir_26a5878ebb5e9988b6ffa6f152301254.html @@ -0,0 +1,130 @@ + + + + + core/ecs/query/ directory | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/dir_3764e76d8ec4e739fc24b5bb90adc3af.html b/docs-preview/pr-862/dir_3764e76d8ec4e739fc24b5bb90adc3af.html index 61630b2e1..3e8fef415 100644 --- a/docs-preview/pr-862/dir_3764e76d8ec4e739fc24b5bb90adc3af.html +++ b/docs-preview/pr-862/dir_3764e76d8ec4e739fc24b5bb90adc3af.html @@ -63,12 +63,18 @@

    Contents

    Files

    +
    file archetype_graph.hpp
    +
    Class cubos::core::ecs::ArchetypeGraph.
    +
    file archetype_id.hpp
    +
    Struct cubos::core::ecs::ArchetypeId.
    file entity.hpp
    Struct cubos::core::ecs::Entity.
    file hash.hpp
    Struct cubos::core::ecs::EntityHash.
    file manager.hpp
    Class cubos::core::ecs::EntityManager.
    +
    file pool.hpp
    +
    Class cubos::core::ecs::EntityPool.
    diff --git a/docs-preview/pr-862/dir_cae59223029cd41c022c5f7665ca4fec.html b/docs-preview/pr-862/dir_57aff98960b24114775613a58ec786ad.html similarity index 92% rename from docs-preview/pr-862/dir_cae59223029cd41c022c5f7665ca4fec.html rename to docs-preview/pr-862/dir_57aff98960b24114775613a58ec786ad.html index 7b81f3f1f..c4424bb49 100644 --- a/docs-preview/pr-862/dir_cae59223029cd41c022c5f7665ca4fec.html +++ b/docs-preview/pr-862/dir_57aff98960b24114775613a58ec786ad.html @@ -2,7 +2,7 @@ - engine/screenpicker/ directory | CUBOS. Docs + engine/screen_picker/ directory | CUBOS. Docs @@ -46,9 +46,9 @@

    - engine/screenpicker/ directory + engine/screen_picker/ directory

    -

    ScreenPicker plugin directory.

    +

    ScreenPicker plugin directory.

    diff --git a/docs-preview/pr-862/group__core-ecs-relation.html b/docs-preview/pr-862/dir_9f228de11f2fc2633236213a3ef5c992.html similarity index 80% rename from docs-preview/pr-862/group__core-ecs-relation.html rename to docs-preview/pr-862/dir_9f228de11f2fc2633236213a3ef5c992.html index a882f1e4e..9715743ea 100644 --- a/docs-preview/pr-862/group__core-ecs-relation.html +++ b/docs-preview/pr-862/dir_9f228de11f2fc2633236213a3ef5c992.html @@ -2,7 +2,7 @@ - Core » ECS » Relation module | CUBOS. Docs + core/ecs/table/sparse_relation/ directory | CUBOS. Docs @@ -46,10 +46,9 @@

    - Core » - ECS » - Relation module

    -

    Relation part of the ECS.

    + core/ecs/table/sparse_relation/ directory + +

    Sparse relation storage types.

    diff --git a/docs-preview/pr-862/dir_b6daa990b896c2c0c53126427e4d978d.html b/docs-preview/pr-862/dir_b6daa990b896c2c0c53126427e4d978d.html index c0847b602..038d1a19e 100644 --- a/docs-preview/pr-862/dir_b6daa990b896c2c0c53126427e4d978d.html +++ b/docs-preview/pr-862/dir_b6daa990b896c2c0c53126427e4d978d.html @@ -68,12 +68,14 @@

    Directories

    Component directory.
    directory entity/
    Entity directory.
    -
    directory relation/
    -
    Relation directory.
    +
    directory query/
    +
    Query directory.
    directory resource/
    Resource directory.
    directory system/
    System directory.
    +
    directory table/
    +
    Table directory.
    @@ -81,6 +83,14 @@

    Files

    file blueprint.hpp
    Class cubos::core::ecs::Blueprint.
    +
    file command_buffer.hpp
    +
    Class cubos::core::ecs::CommandBuffer.
    +
    file cubos.hpp
    +
    Class cubos::engine::Cubos.
    +
    file reflection.hpp
    +
    Class cubos::core::ecs::TypeBuilder.
    +
    file types.hpp
    +
    Class cubos::core::ecs::Types.
    file world.hpp
    Class cubos::core::ecs::World.
    diff --git a/docs-preview/pr-862/dir_bafb7af0e03e95b24a45ff63060ab57b.html b/docs-preview/pr-862/dir_bafb7af0e03e95b24a45ff63060ab57b.html index a6d7fba3d..bac8c25b1 100644 --- a/docs-preview/pr-862/dir_bafb7af0e03e95b24a45ff63060ab57b.html +++ b/docs-preview/pr-862/dir_bafb7af0e03e95b24a45ff63060ab57b.html @@ -56,7 +56,6 @@

    Contents

    Reference @@ -80,8 +79,8 @@

    Directories

    Renderer plugin directory.
    directory scene/
    Scene plugin directory.
    -
    directory screenpicker/
    -
    ScreenPicker plugin directory.
    +
    directory screen_picker/
    +
    ScreenPicker plugin directory.
    directory settings/
    Settings plugin directory.
    directory splitscreen/
    @@ -94,13 +93,6 @@

    Directories

    Window plugin directory.
    -
    -

    Files

    -
    -
    file cubos.hpp
    -
    Class cubos::engine::Cubos.
    -
    -
    diff --git a/docs-preview/pr-862/dir_23da5564a3f2709d1d4bc8981f00e961.html b/docs-preview/pr-862/dir_c1b5957eb0512b9978230dfb34d9655b.html similarity index 87% rename from docs-preview/pr-862/dir_23da5564a3f2709d1d4bc8981f00e961.html rename to docs-preview/pr-862/dir_c1b5957eb0512b9978230dfb34d9655b.html index 5453e893c..ee0c5c34c 100644 --- a/docs-preview/pr-862/dir_23da5564a3f2709d1d4bc8981f00e961.html +++ b/docs-preview/pr-862/dir_c1b5957eb0512b9978230dfb34d9655b.html @@ -2,7 +2,7 @@ - core/ecs/relation/ directory | CUBOS. Docs + core/ecs/table/dense/ directory | CUBOS. Docs @@ -46,9 +46,9 @@

    - core/ecs/relation/ directory + core/ecs/table/dense/ directory

    -

    Relation directory.

    +

    Dense storage types.

    diff --git a/docs-preview/pr-862/engine_2include_2cubos_2engine_2screenpicker_2plugin_8hpp.html b/docs-preview/pr-862/engine_2include_2cubos_2engine_2screen__picker_2plugin_8hpp.html similarity index 94% rename from docs-preview/pr-862/engine_2include_2cubos_2engine_2screenpicker_2plugin_8hpp.html rename to docs-preview/pr-862/engine_2include_2cubos_2engine_2screen__picker_2plugin_8hpp.html index a332a7917..2cad6b62c 100644 --- a/docs-preview/pr-862/engine_2include_2cubos_2engine_2screenpicker_2plugin_8hpp.html +++ b/docs-preview/pr-862/engine_2include_2cubos_2engine_2screen__picker_2plugin_8hpp.html @@ -2,7 +2,7 @@ - engine/screenpicker/plugin.hpp file | CUBOS. Docs + engine/screen_picker/plugin.hpp file | CUBOS. Docs @@ -46,7 +46,7 @@

    - engine/screenpicker/plugin.hpp file + engine/screen_picker/plugin.hpp file

    Plugin entry point.

    diff --git a/docs-preview/pr-862/examples-engine-events.html b/docs-preview/pr-862/examples-engine-events.html index 2e71f22bc..0b198e717 100644 --- a/docs-preview/pr-862/examples-engine-events.html +++ b/docs-preview/pr-862/examples-engine-events.html @@ -60,19 +60,19 @@

    { CUBOS_INFO("A read {}", event.value); } -}

    Now, to emit these events, we will use the EventWriter system argument. This system will emit 3 events on the first frame and another 3 on the second frame. By setting the value of the ShouldQuit resource to true on the second frame, the engine stops before reaching the third frame.

    static void secondSystem(EventWriter<MyEvent> writer, Write<State> state, Write<ShouldQuit> quit)
    +}

    Now, to emit these events, we will use the EventWriter system argument. This system will emit 3 events on the first frame and another 3 on the second frame. By setting the value of the ShouldQuit resource to true on the second frame, the engine stops before reaching the third frame.

    static void secondSystem(EventWriter<MyEvent> writer, State& state, ShouldQuit& quit)
     {
    -    state->step += 1;
    -    if (state->step == 1) // Write 1 2 3 on first run.
    +    state.step += 1;
    +    if (state.step == 1) // Write 1 2 3 on first run.
         {
             writer.push({1});
             writer.push({2});
             writer.push({3});
             CUBOS_INFO("B wrote 1 2 3");
         }
    -    else if (state->step == 2)
    +    else if (state.step == 2)
         {
    -        quit->value = true; // Stop the loop.
    +        quit.value = true; // Stop the loop.
             writer.push({4});
             writer.push({5});
             writer.push({6});
    diff --git a/docs-preview/pr-862/examples-engine-gizmos.html b/docs-preview/pr-862/examples-engine-gizmos.html
    index 52e4f9ee9..1db9fe91d 100644
    --- a/docs-preview/pr-862/examples-engine-gizmos.html
    +++ b/docs-preview/pr-862/examples-engine-gizmos.html
    @@ -52,54 +52,54 @@ 

    Using the Gizmos plugin.

    This example shows the Gizmos plugin, which allows drawing simple primitives. These are not intended for use in the final product, only in developer tools and for debugging.

    The plugin function is included from the engine/gizmos/plugin.hpp header.

        Cubos cubos{argc, argv};
    -    cubos.addPlugin(gizmosPlugin);

    To draw a gizmo, all you need to do is to get a reference to the cubos::engine::Gizmos resource, and then call the draw function on it for the gizmo you want to draw. Additionally, you can also call the cubos::engine::Gizmos::color function to set the color for future gizmos. So, for example if you want to draw an arrow in a given system, all you need to do is the following:

    static void drawStartingLineSystem(Write<Gizmos> gizmos)
    +    cubos.addPlugin(gizmosPlugin);

    To draw a gizmo, all you need to do is to get a reference to the cubos::engine::Gizmos resource, and then call the draw function on it for the gizmo you want to draw. Additionally, you can also call the cubos::engine::Gizmos::color function to set the color for future gizmos. So, for example if you want to draw an arrow in a given system, all you need to do is the following:

    static void drawStartingLineSystem(Gizmos& gizmos)
     {
    -    gizmos->color({1, 0, 1});
    -    gizmos->drawArrow("arrow", {0.6F, 0.6F, 0.0F}, {-0.1F, -0.1F, 0.0F}, 0.003F, 0.009F, 0.7F, 10.0F,
    -                      Gizmos::Space::Screen);
    -}

    This code will draw an arrow poiting at the center of the screen, and it will stay there for 10 seconds.

    In this other example, we draw lines, a box, and a wire box. Unlike the one in the previous example, this system is not a start-up system, so the draw functions get called every single frame. When this happens, you should set the lifetime of a gizmo to 0, which means it will be drawn for a single frame only. This way we avoid drawing gizmos on top of identical ones that were already there, or in the case of moving gizmos, leaving a trail of old version behind them.

    Let's start with the lines. We are using four cameras in our scene, so let's add two lines to separate each camera. These lines will be in Screen space, as we want them to be just drawn once, indepently of the number of cameras; and we want them to use screen coordinates, as they should be drawn in the middle of the screen.

        gizmos->color({1.0F, 1.0F, 1.0F});
    -    gizmos->drawLine("separator line", {1.0F, 0.5F, 0.5F}, {0.0F, 0.5F, 0.5F}, 0, Gizmos::Space::Screen);
    -    gizmos->drawLine("separator line", {0.5F, 1.0F, 0.5F}, {0.5F, 0.0F, 0.5F}, 0, Gizmos::Space::Screen);

    Let's now add a wireboxe. We want to know were exactly is the centre of each camera, so let's add a reticule. This box will be in View space, as we want it to be drawn once per camera and we want it to use view coordinates, as it should be drawn in the middle of each viewport.

        gizmos->color({1.0F, 0.5F, 1.0F});
    -    gizmos->drawBox("box", {0.4, 0.4, 0}, {0.55, 0.55, 0}, 0, Gizmos::Space::View);

    Let's add a box. This box will be in World space, as it's the last space left to cover. It will be drawn by any camera that is looking at it, much like if it was an object in the world.

        gizmos->color({0.2F, 0.2F, 1.0F});
    -    gizmos->drawWireBox("wire box", {-5, -5, -5}, {-7, -7, -7}, 0, Gizmos::Space::World);

    Finally let's add a cut cone. A cut cone is cylinder with faces that can have different radiuses. If you set one of the bases to have a radius of 0, you'll have a simple cone. If you set them both to have the same radius, you'll have a cylinder. Our cut cone will have different radiuses:

        if (gizmos->hovered("cut cone"))
    +    gizmos.color({1, 0, 1});
    +    gizmos.drawArrow("arrow", {0.6F, 0.6F, 0.0F}, {-0.1F, -0.1F, 0.0F}, 0.003F, 0.009F, 0.7F, 10.0F,
    +                     Gizmos::Space::Screen);
    +}

    This code will draw an arrow poiting at the center of the screen, and it will stay there for 10 seconds.

    In this other example, we draw lines, a box, and a wire box. Unlike the one in the previous example, this system is not a start-up system, so the draw functions get called every single frame. When this happens, you should set the lifetime of a gizmo to 0, which means it will be drawn for a single frame only. This way we avoid drawing gizmos on top of identical ones that were already there, or in the case of moving gizmos, leaving a trail of old version behind them.

    Let's start with the lines. We are using four cameras in our scene, so let's add two lines to separate each camera. These lines will be in Screen space, as we want them to be just drawn once, indepently of the number of cameras; and we want them to use screen coordinates, as they should be drawn in the middle of the screen.

        gizmos.color({1.0F, 1.0F, 1.0F});
    +    gizmos.drawLine("separator line", {1.0F, 0.5F, 0.5F}, {0.0F, 0.5F, 0.5F}, 0, Gizmos::Space::Screen);
    +    gizmos.drawLine("separator line", {0.5F, 1.0F, 0.5F}, {0.5F, 0.0F, 0.5F}, 0, Gizmos::Space::Screen);

    Let's now add a wireboxe. We want to know were exactly is the centre of each camera, so let's add a reticule. This box will be in View space, as we want it to be drawn once per camera and we want it to use view coordinates, as it should be drawn in the middle of each viewport.

        gizmos.color({1.0F, 0.5F, 1.0F});
    +    gizmos.drawBox("box", {0.4, 0.4, 0}, {0.55, 0.55, 0}, 0, Gizmos::Space::View);

    Let's add a box. This box will be in World space, as it's the last space left to cover. It will be drawn by any camera that is looking at it, much like if it was an object in the world.

        gizmos.color({0.2F, 0.2F, 1.0F});
    +    gizmos.drawWireBox("wire box", {-5, -5, -5}, {-7, -7, -7}, 0, Gizmos::Space::World);

    Finally let's add a cut cone. A cut cone is cylinder with faces that can have different radiuses. If you set one of the bases to have a radius of 0, you'll have a simple cone. If you set them both to have the same radius, you'll have a cylinder. Our cut cone will have different radiuses:

        if (gizmos.hovered("cut cone"))
         {
    -        gizmos->color({0.25F, 0.15F, 0.5F});
    +        gizmos.color({0.25F, 0.15F, 0.5F});
         }
    -    else if (gizmos->pressed("cut cone"))
    +    else if (gizmos.pressed("cut cone"))
         {
    -        gizmos->color({0.5F, 0.3F, 1});
    +        gizmos.color({0.5F, 0.3F, 1});
         }
         else
         {
    -        gizmos->color({0.1F, 0.05F, 0.25F});
    +        gizmos.color({0.1F, 0.05F, 0.25F});
         }
     
    -    gizmos->drawCutCone("cut cone", {0.7F, 0.7F, 0.7F}, 5.0F, {-3, -3, -3}, 3.0F, 0, Gizmos::Space::World);

    For the cut cone, we'll set the color a bit differently: We'll make it so the color of the cone changes depending on whether you are pressing the cone, or have your mouse over it. We'll make it a bit darker while the mouse is not over the cone, a bit lighter when it is, and even lighter when the cone is pressed.

    The whole system looks like this:

    static void drawSystem(Write<Gizmos> gizmos)
    +    gizmos.drawCutCone("cut cone", {0.7F, 0.7F, 0.7F}, 5.0F, {-3, -3, -3}, 3.0F, 0, Gizmos::Space::World);

    For the cut cone, we'll set the color a bit differently: We'll make it so the color of the cone changes depending on whether you are pressing the cone, or have your mouse over it. We'll make it a bit darker while the mouse is not over the cone, a bit lighter when it is, and even lighter when the cone is pressed.

    The whole system looks like this:

    static void drawSystem(Gizmos& gizmos)
     {
    -    gizmos->color({1.0F, 1.0F, 1.0F});
    -    gizmos->drawLine("separator line", {1.0F, 0.5F, 0.5F}, {0.0F, 0.5F, 0.5F}, 0, Gizmos::Space::Screen);
    -    gizmos->drawLine("separator line", {0.5F, 1.0F, 0.5F}, {0.5F, 0.0F, 0.5F}, 0, Gizmos::Space::Screen);
    +    gizmos.color({1.0F, 1.0F, 1.0F});
    +    gizmos.drawLine("separator line", {1.0F, 0.5F, 0.5F}, {0.0F, 0.5F, 0.5F}, 0, Gizmos::Space::Screen);
    +    gizmos.drawLine("separator line", {0.5F, 1.0F, 0.5F}, {0.5F, 0.0F, 0.5F}, 0, Gizmos::Space::Screen);
     
    -    gizmos->color({1.0F, 0.5F, 1.0F});
    -    gizmos->drawBox("box", {0.4, 0.4, 0}, {0.55, 0.55, 0}, 0, Gizmos::Space::View);
    +    gizmos.color({1.0F, 0.5F, 1.0F});
    +    gizmos.drawBox("box", {0.4, 0.4, 0}, {0.55, 0.55, 0}, 0, Gizmos::Space::View);
     
    -    gizmos->color({0.2F, 0.2F, 1.0F});
    -    gizmos->drawWireBox("wire box", {-5, -5, -5}, {-7, -7, -7}, 0, Gizmos::Space::World);
    +    gizmos.color({0.2F, 0.2F, 1.0F});
    +    gizmos.drawWireBox("wire box", {-5, -5, -5}, {-7, -7, -7}, 0, Gizmos::Space::World);
     
    -    if (gizmos->hovered("cut cone"))
    +    if (gizmos.hovered("cut cone"))
         {
    -        gizmos->color({0.25F, 0.15F, 0.5F});
    +        gizmos.color({0.25F, 0.15F, 0.5F});
         }
    -    else if (gizmos->pressed("cut cone"))
    +    else if (gizmos.pressed("cut cone"))
         {
    -        gizmos->color({0.5F, 0.3F, 1});
    +        gizmos.color({0.5F, 0.3F, 1});
         }
         else
         {
    -        gizmos->color({0.1F, 0.05F, 0.25F});
    +        gizmos.color({0.1F, 0.05F, 0.25F});
         }
     
    -    gizmos->drawCutCone("cut cone", {0.7F, 0.7F, 0.7F}, 5.0F, {-3, -3, -3}, 3.0F, 0, Gizmos::Space::World);
    +    gizmos.drawCutCone("cut cone", {0.7F, 0.7F, 0.7F}, 5.0F, {-3, -3, -3}, 3.0F, 0, Gizmos::Space::World);
     }

    diff --git a/docs-preview/pr-862/examples-engine-hello-cubos.html b/docs-preview/pr-862/examples-engine-hello-cubos.html index 1ba631e15..9afa307a6 100644 --- a/docs-preview/pr-862/examples-engine-hello-cubos.html +++ b/docs-preview/pr-862/examples-engine-hello-cubos.html @@ -50,12 +50,12 @@

    Engine » Hello CUBOS.

    -

    Using Cubos to create a simple program.

    -

    This example shows the basics of how cubos::engine::Cubos is used, by making a simple "Hello World" program.

    #include <cubos/engine/cubos.hpp>
    +        

    Using Cubos to create a simple program.

    +

    This example shows the basics of how cubos::engine::Cubos is used, by making a simple "Hello World" program.

    #include <cubos/engine/prelude.hpp>
     
     using cubos::engine::Cubos;

    First we'll need to get a Cubos object.

    int main()
     {
    -    Cubos cubos{};

    The Cubos class represents the engine. We'll need it to add functionality to our program.

    Let's start by defining what functionality we want to add.

    static void sayHelloCubosSystem()
    +    Cubos cubos{};

    The Cubos class represents the engine. We'll need it to add functionality to our program.

    Let's start by defining what functionality we want to add.

    static void sayHelloCubosSystem()
     {
         CUBOS_INFO("Hello CUBOS");
     }

    This function simply prints Hello CUBOS to the console. It uses one of CUBOS.'s logging macros. You can find more about them here. However, this function is not currently called, so we'll need to tell CUBOS. that we want it to run.

        cubos.startupSystem(sayHelloCubosSystem);

    Startup systems run only once when the engine is loaded. Now let's make things more interesting. Let's print Hello World, but split it over two different systems.

    static void sayHelloSystem()
    @@ -66,7 +66,7 @@ 

    static void sayWorldSystem() { CUBOS_INFO("World"); -}

    Instead of using startupSystem, we'll use Cubos::system. This means the systems will be called after the startup systems and repeat every cycle, instead of just once at startup.

    However, we can't just do as we did for sayHelloCubos and call it a day. We want sayHello to come before sayWorld, so we'll have to explicitly tell that to the engine, or else we risk having them in the wrong order. To do that we use tags. Let's create two tags, one for each system.

        cubos.tag("helloTag").before("worldTag");

    Cubos::tag creates a new tag, and before makes any systems tagged with it come before systems tagged with the one given as parameter. There's also an after that has the inverse effect. Now all we have to do is to assign these tags to our systems.

        cubos.system(sayHelloSystem).tagged("helloTag");
    +}

    Instead of using startupSystem, we'll use Cubos::system. This means the systems will be called after the startup systems and repeat every cycle, instead of just once at startup.

    However, we can't just do as we did for sayHelloCubos and call it a day. We want sayHello to come before sayWorld, so we'll have to explicitly tell that to the engine, or else we risk having them in the wrong order. To do that we use tags. Let's create two tags, one for each system.

        cubos.tag("helloTag").before("worldTag");

    Cubos::tag creates a new tag, and before makes any systems tagged with it come before systems tagged with the one given as parameter. There's also an after that has the inverse effect. Now all we have to do is to assign these tags to our systems.

        cubos.system(sayHelloSystem).tagged("helloTag");
         cubos.system(sayWorldSystem).tagged("worldTag");

    Now let's see a bit about entities, components and resources. First we are going to need to use a few more things. We'll go over what each does as it comes up.

    Entities have components, so let's create one to give our entities. Because of how the engine works, we cannot declare a component on our main.cpp file. We'll need to create a components.hpp for that.

    #pragma once
     
     #include <cubos/core/ecs/world.hpp>
    @@ -80,20 +80,20 @@ 

    };

    Here we create a component called "num" that stores a single integer. We'll use it as the id of the entity it is attached to. Back on our main.cpp file we'll need to include our new file.

    #include "components.hpp"

    And the component needs to be registered.

        cubos.addComponent<Num>();

    Let's create a resource now. Unlike components, resources can be declared on the main.cpp file, so let's do that.

    struct Pop
     {
         int count;
    -};

    This resource will store the total number of spawned entities, a population counter of sorts. It too needs to be registered.

        cubos.addResource<Pop>();

    Now let's create a startup system that spawns some entities.

    static void spawnEntitiesSystem(Commands cmds, Write<Pop> pop)
    +};

    This resource will store the total number of spawned entities, a population counter of sorts. It too needs to be registered.

        cubos.addResource<Pop>();

    Now let's create a startup system that spawns some entities.

    static void spawnEntitiesSystem(Commands cmds, Pop& pop)
     {
         for (int i = 0; i < 10; i++)
         {
    -        cmds.create(Num{i});
    -        pop->count += 1;
    +        cmds.create().add(Num{i});
    +        pop.count += 1;
         }
    -}

    Commands is a system argument that allows us to interact with the world, in this case, by creating entities that have a Num component.

    Write is a system argument that allows us to modify a resource, in this case Pop.

    Finally, we'll want a system that prints our entities.

    static void checkEntitiesSystem(Query<Read<Num>> query, Read<Pop> pop)
    +}

    Commands is a system argument that allows us to interact with the world, in this case, by creating entities that have a Num component.

    Write is a system argument that allows us to modify a resource, in this case Pop.

    Finally, we'll want a system that prints our entities.

    static void checkEntitiesSystem(Query<const Num&> query, const Pop& pop)
     {
    -    for (auto [entity, num] : query)
    +    for (auto [num] : query)
         {
    -        CUBOS_INFO("Entity '{}' of '{}'", num->value, pop->count);
    +        CUBOS_INFO("Entity '{}' of '{}'", num.value, pop.count);
         }
    -}

    Read is similar to Write, only it just gives us permission to read data from resources and components, we cannot alter them.

    Query allows us to access all entities with a given configuration of components. In this case, it will give us all entities with the Num component.

    To finish configuring our program, we just need to register these two new systems. We'll also have the entities be printed after our Hello World message.

        cubos.startupSystem(spawnEntitiesSystem);
    +}

    Read is similar to Write, only it just gives us permission to read data from resources and components, we cannot alter them.

    Query allows us to access all entities with a given configuration of components. In this case, it will give us all entities with the Num component.

    To finish configuring our program, we just need to register these two new systems. We'll also have the entities be printed after our Hello World message.

        cubos.startupSystem(spawnEntitiesSystem);
     
         cubos.system(checkEntitiesSystem);

    With everything properly set up, all that remains is to run the engine.

        cubos.run();
     }
    diff --git a/docs-preview/pr-862/examples-engine-imgui.html b/docs-preview/pr-862/examples-engine-imgui.html index 8efe9be71..a920183ee 100644 --- a/docs-preview/pr-862/examples-engine-imgui.html +++ b/docs-preview/pr-862/examples-engine-imgui.html @@ -119,16 +119,16 @@

    {2, 4}, {3, 6}, {4, 8}, - }});

    Well now, using the cubos::engine::DataInspector is pretty easy, all you have to do is, obviously, access the resource on your system, and use the functions DataInspector::edit and DataInspector::edit.

    static void exampleDataInspectorSystem(Write<DataInspector> inspector, Write<DummyResource> data)
    +                      }});

    Well now, using the cubos::engine::DataInspector is pretty easy, all you have to do is, obviously, access the resource on your system, and use the functions DataInspector::edit and DataInspector::edit.

    static void exampleDataInspectorSystem(DataInspector& inspector, DummyResource& data)
     {
         ImGui::Begin("Data Inspector");
         ImGui::BeginTable("id1", 2);
     
    -    inspector->show("data->integer", data->integer);
    -    inspector->edit("data->person", data->person);
    -    inspector->edit("data->persons", data->persons);
    -    inspector->edit("data->vec", data->vec);
    -    inspector->edit("data->map", data->map);
    +    inspector.show("data.integer", data.integer);
    +    inspector.edit("data.person", data.person);
    +    inspector.edit("data.persons", data.persons);
    +    inspector.edit("data.vec", data.vec);
    +    inspector.edit("data.map", data.map);
     
         ImGui::EndTable();
         ImGui::End();
    diff --git a/docs-preview/pr-862/examples-engine-input.html b/docs-preview/pr-862/examples-engine-input.html
    index 2a2b20a66..0d794de5e 100644
    --- a/docs-preview/pr-862/examples-engine-input.html
    +++ b/docs-preview/pr-862/examples-engine-input.html
    @@ -154,28 +154,28 @@ 

    } } }

    There are two types of bindings: actions and axes. An action is an input that only has two states: pressed or not pressed. This would be most keys on a keyboard. An axe is an input that has a numeric value. For example, the joysticks on a controller can go from -1 to 1, depending on how much they are tilt in which direction. Using axes can also be useful for keys with symetric behaviour. For example, in this sample, w sets the vertical axe to 1, while s sets it to -1.

    To define an action or an axe, you simply have to add it to the respective list, giving it a name. The very first action in the file is called next-showcase. Then, if it's an action, you simply have to define which keys trigger it. You can also define key combinations by using a -. To check which strings map to which keys, you check the keyToString function implementation on this file.

    Now that we have our bindings file, let's get our application to do something with it. The first thing we're going to need is a reference to the bindings asset. For the purposes of this sample we can simply use an hardcoded reference to the asset.

    static const Asset<InputBindings> BindingsAsset = AnyAsset("bf49ba61-5103-41bc-92e0-8a442d7842c3");

    To utilize the bindings, loading them is essential. This can be accomplished by establishing two startup systems: one to configure the assets.io.path path and the other to read from the asset and establish the required bindings.

        cubos.startupSystem(config).tagged("cubos.settings");
    -    cubos.startupSystem(init).tagged("cubos.assets");
    static void config(Write<Settings> settings)
    +    cubos.startupSystem(init).tagged("cubos.assets");
    static void config(Settings& settings)
     {
    -    settings->setString("assets.io.path", SAMPLE_ASSETS_FOLDER);
    +    settings.setString("assets.io.path", SAMPLE_ASSETS_FOLDER);
     }
     
    -static void init(Read<Assets> assets, Write<Input> input)
    +static void init(const Assets& assets, Input& input)
     {
    -    auto bindings = assets->read<InputBindings>(BindingsAsset);
    -    input->bind(*bindings);
    -    CUBOS_INFO("Loaded bindings: {}", input->bindings().at(0));
    -}

    Getting the input is done through the cubos::engine::Input resource. What this sample does is show in order, a series of prompt to showcase the different functionalities of the Input plugin. For this, it keeps a state integer that indicates the current prompt. Whenever the action next-showcase is triggered, it advances to the next prompt. However, as the plugin currently does not have events, we have to manually check whether the key has just been pressed, is being pressed continuously, or was just released.

    static void update(Read<Input> input, Read<Window> window, Write<State> state, Write<ShouldQuit> shouldQuit)
    +    auto bindings = assets.read<InputBindings>(BindingsAsset);
    +    input.bind(*bindings);
    +    CUBOS_INFO("Loaded bindings: {}", input.bindings().at(0));
    +}

    Getting the input is done through the cubos::engine::Input resource. What this sample does is show in order, a series of prompt to showcase the different functionalities of the Input plugin. For this, it keeps a state integer that indicates the current prompt. Whenever the action next-showcase is triggered, it advances to the next prompt. However, as the plugin currently does not have events, we have to manually check whether the key has just been pressed, is being pressed continuously, or was just released.

    static void update(const Input& input, const Window& window, State& state, ShouldQuit& shouldQuit)
     {
         // FIXME: This is an hack to have one-shot actions while we don't have input events.
    -    if (input->pressed("next-showcase"))
    +    if (input.pressed("next-showcase"))
         {
    -        state->nextPressed = true;
    +        state.nextPressed = true;
         }
    -    else if (state->nextPressed)
    +    else if (state.nextPressed)
         {
    -        state->nextPressed = false;
    -        state->explained = false;
    -        state->showcase++;
    +        state.nextPressed = false;
    +        state.explained = false;
    +        state.showcase++;
         }

    What this does is only advance the state when the return key is released. This avoids the state advancing more than once if the user presses it for more than one frame.

    Now let's see each of the prompt, to understand the full breadth of the plugin's functionalities.

    static void showcaseXZ(const Input& input, bool& explained)
     {
         if (!explained)
    diff --git a/docs-preview/pr-862/examples-engine-renderer.html b/docs-preview/pr-862/examples-engine-renderer.html
    index 3dbebee8e..108aa49af 100644
    --- a/docs-preview/pr-862/examples-engine-renderer.html
    +++ b/docs-preview/pr-862/examples-engine-renderer.html
    @@ -52,50 +52,50 @@ 

    Using the Renderer plugin.

    This example shows how the Renderer plugin can be used and configured with a simple scene, lighting and split-screen rendering.

    Image

    The plugin function is included from the engine/renderer/plugin.hpp header. You may need to include other headers, depending on what you want to access.

        cubos.addPlugin(splitscreenPlugin);
    -    cubos.addPlugin(rendererPlugin);

    The first thing we're going to worry about is setting the VoxelPalette the renderer will use. This palette would usually be loaded from a file, but for this example we'll just create it manually.

    static void setPaletteSystem(Write<Renderer> renderer)
    +    cubos.addPlugin(rendererPlugin);

    The first thing we're going to worry about is setting the VoxelPalette the renderer will use. This palette would usually be loaded from a file, but for this example we'll just create it manually.

    static void setPaletteSystem(Renderer& renderer)
     {
         // Create a simple palette with 3 materials (red, green and blue).
    -    (*renderer)->setPalette(VoxelPalette{{
    +    renderer->setPalette(VoxelPalette{{
             {{1, 0, 0, 1}},
             {{0, 1, 0, 1}},
             {{0, 0, 1, 1}},
         }});
    -}

    We should also spawn a voxel grid, so we have something to render.

    static void spawnVoxelGridSystem(Commands commands, Write<Assets> assets)
    +}

    We should also spawn a voxel grid, so we have something to render.

    static void spawnVoxelGridSystem(Commands commands, Assets& assets)
     {
         // Create a 2x2x2 grid whose voxels alternate between the materials defined in the palette.
    -    auto gridAsset = assets->create(VoxelGrid{{2, 2, 2}, {1, 2, 3, 1, 2, 3, 1, 2}});
    +    auto gridAsset = assets.create(VoxelGrid{{2, 2, 2}, {1, 2, 3, 1, 2, 3, 1, 2}});
     
         // Spawn an entity with a renderable grid component and a identity transform.
    -    commands.create(RenderableGrid{gridAsset, {-1.0F, 0.0F, -1.0F}}, LocalToWorld{});
    +    commands.create().add(RenderableGrid{gridAsset, {-1.0F, 0.0F, -1.0F}}).add(LocalToWorld{});
     }

    If we don't add any lights, the scene will be completely dark. Lets add a simple PointLight.

    static void spawnLightSystem(Commands commands)
     {
         // Spawn a point light.
         commands.create()
             .add(PointLight{.color = {1.0F, 1.0F, 1.0F}, .intensity = 1.0F, .range = 10.0F})
             .add(Position{{1.0F, 3.0F, -2.0F}});
    -}

    We can also add some ambient lighting, and even add a sky gradient, through the RendererEnvironment resource.

    static void setEnvironmentSystem(Write<RendererEnvironment> env)
    +}

    We can also add some ambient lighting, and even add a sky gradient, through the RendererEnvironment resource.

    static void setEnvironmentSystem(RendererEnvironment& env)
     {
    -    env->ambient = {0.2F, 0.2F, 0.2F};
    -    env->skyGradient[0] = {0.1F, 0.2F, 0.4F};
    -    env->skyGradient[1] = {0.6F, 0.6F, 0.8F};
    -}

    Lastly, without a camera, we won't be able to see anything. Cameras can be set using the ActiveCameras resource.

    static void spawnCamerasSystem(Commands commands, Write<ActiveCameras> camera)
    +    env.ambient = {0.2F, 0.2F, 0.2F};
    +    env.skyGradient[0] = {0.1F, 0.2F, 0.4F};
    +    env.skyGradient[1] = {0.6F, 0.6F, 0.8F};
    +}

    Lastly, without a camera, we won't be able to see anything. Cameras can be set using the ActiveCameras resource.

    static void spawnCamerasSystem(Commands commands, ActiveCameras& camera)
     {
         // Spawn the a camera entity for the first viewport.
    -    camera->entities[0] =
    +    camera.entities[0] =
             commands.create()
                 .add(Camera{.fovY = 60.0F, .zNear = 0.1F, .zFar = 100.0F})
                 .add(Position{{-3.0, 1.0F, -3.0F}})
                 .add(Rotation{glm::quatLookAt(glm::normalize(glm::vec3{1.0F, 0.0F, 1.0F}), glm::vec3{0.0F, 1.0F, 0.0F})})
                 .entity();
     
    -    camera->entities[1] =
    +    camera.entities[1] =
             commands.create()
                 .add(Camera{.fovY = 60.0F, .zNear = 0.1F, .zFar = 100.0F})
                 .add(Position{{-3.0, 1.0F, -3.0F}})
                 .add(Rotation{glm::quatLookAt(glm::normalize(glm::vec3{1.0F, 0.0F, 1.0F}), glm::vec3{0.0F, 1.0F, 0.0F})})
                 .entity();
     
    -    camera->entities[2] =
    +    camera.entities[2] =
             commands.create()
                 .add(Camera{.fovY = 60.0F, .zNear = 0.1F, .zFar = 100.0F})
                 .add(Position{{-3.0, 1.0F, -3.0F}})
    diff --git a/docs-preview/pr-862/examples-engine-scene.html b/docs-preview/pr-862/examples-engine-scene.html
    index d066811c8..3fe8783fb 100644
    --- a/docs-preview/pr-862/examples-engine-scene.html
    +++ b/docs-preview/pr-862/examples-engine-scene.html
    @@ -62,7 +62,7 @@ 

    } } } -}

    Scene files are JSON files with the extension .cubos. They must have two fields: imports and entities. The entities field is an object where each field identifies and describes the components of an entity. In this scene we have two entities, root and child. root has a single component, num, with a value of 1. child has two components, a parent and a num. In this sample, num is used so we can later identify the entities.

    Let's look at a different scene file now, this time with imports. Imports allows us to instantiate scenes within other scenes.

    {
    +}

    Scene files are JSON files with the extension .cubos. They must have two fields: imports and entities. The entities field is an object where each field identifies and describes the components of an entity. In this scene we have two entities, root and child. root has a single component, num, with a value of 1. child has two components, a parent and a num. In this sample, num is used so we can later identify the entities.

    Let's look at a different scene file now, this time with imports. Imports allows us to instantiate scenes within other scenes.

    {
       "imports": {
         "sub1": "00d86ba8-5f34-440f-a180-d9d12c8e8b91"
       },
    @@ -75,9 +75,9 @@ 

    } } } -}

    This file imports the asset with id cd007ba2-ee0d-44fd-bf36-85c829dbe66f, which is the scene we looked at in the previous file, under the name sub1. It then imports the very same scene again, but this time with the name sub2 instead. This effectively instantiates the entities of the previous scene twice in this new scene, each with their names prefixed with either sub1. or sub2.

    Under entities, we can override the entities in the sub-scenes to edit components or add new ones. For example, by referencing sub1.root we are making local changes to the root entity of that instance of the subscene. The result of the changes we make to both sub1.root and sub2.root is that the parent of these entities will be set to be the main entity.

    Now that we have our scene file, let's get our application to load it. The first thing we're going to need is a reference to the scene asset. For the purposes of this sample we can simply use an hardcoded reference to the asset.

    static const Asset<Scene> SceneAsset = AnyAsset("f0d86ba8-5f34-440f-a180-d9d12c8e8b91");

    Then we'll need a system that spawns that scene. To do this we simply get the Scene object from the asset, and then spawn its entities. Commands::spawn will create in the world a copy of every entity defined in the scene's blueprint. It won't remove the entities already there, so if you want to close a scene, you'll have to do it yourself.

    static void spawnScene(Commands commands, Read<Assets> assets)
    +}

    This file imports the asset with id cd007ba2-ee0d-44fd-bf36-85c829dbe66f, which is the scene we looked at in the previous file, under the name sub1. It then imports the very same scene again, but this time with the name sub2 instead. This effectively instantiates the entities of the previous scene twice in this new scene, each with their names prefixed with either sub1. or sub2.

    Under entities, we can override the entities in the sub-scenes to edit components or add new ones. For example, by referencing sub1.root we are making local changes to the root entity of that instance of the subscene. The result of the changes we make to both sub1.root and sub2.root is that the parent of these entities will be set to be the main entity.

    Now that we have our scene file, let's get our application to load it. The first thing we're going to need is a reference to the scene asset. For the purposes of this sample we can simply use an hardcoded reference to the asset.

    static const Asset<Scene> SceneAsset = AnyAsset("f0d86ba8-5f34-440f-a180-d9d12c8e8b91");

    Then we'll need a system that spawns that scene. To do this we simply get the Scene object from the asset, and then spawn its entities. Commands::spawn will create in the world a copy of every entity defined in the scene's blueprint. It won't remove the entities already there, so if you want to close a scene, you'll have to do it yourself.

    static void spawnScene(Commands commands, const Assets& assets)
     {
    -    auto sceneRead = assets->read(SceneAsset);
    +    auto sceneRead = assets.read(SceneAsset);
         commands.spawn(sceneRead->blueprint);
     }

    In this case, we'll run this system at startup, since we want to spawn it a single time. Since it's a startup system, we'll have to tag it with cubos.assets to make sure it runs only after the scene bridge has been registered. On a real game, you could have, for example, a scene for an enemy which you spawn multiple times, instead of just once at startup.

        cubos.startupSystem(spawnScene).tagged("spawn").tagged("cubos.assets");

    This sample will output the list of every entity in the scene, so you can check that everything is working as expected. If you run it, it should give you a list that has:

    • an entity with num set to 0, with no parent. This is the main entity.
    • two entities with num set to 1, with same parent, who has num set to 0. These are the root entities of each instance of the subscene.
    • two entities with num set to 2, with different parents, but both of them having num set to 1. These are the child entities of each instance of the subscene.
    diff --git a/docs-preview/pr-862/examples-engine-settings.html b/docs-preview/pr-862/examples-engine-settings.html index 891e8be58..af9ae9c98 100644 --- a/docs-preview/pr-862/examples-engine-settings.html +++ b/docs-preview/pr-862/examples-engine-settings.html @@ -51,10 +51,10 @@

    Settings

    Using the Settings plugin.

    -

    This example shows how the Settings plugin can be used to load settings from a file and command-line arguments.

    Accesing the settings is straightforward:

    static void checkSettings(Write<Settings> settings)
    +

    This example shows how the Settings plugin can be used to load settings from a file and command-line arguments.

    Accesing the settings is straightforward:

    static void checkSettings(Settings& settings)
     {
    -    CUBOS_INFO("{}", settings->getString("greeting", "Hello!"));
    -}

    If the setting greetings has been set on the settings.json file next to the sample's executable, or if it has been passed as a command-line argument (e.g. ./engine-sample.settings --greetings "Hello, world!"), the sample will output that value. Otherwise, it will output Hello!, which we set as a default.

    We want this system to run after the settings have been loaded, so we run it after the tag cubos.settings. Notice that if we want the command-line arguments to be loaded as settings, we need to pass argc and argv to the Cubos::Cubos(int, char**) constructor.

    int main(int argc, char** argv)
    +    CUBOS_INFO("{}", settings.getString("greeting", "Hello!"));
    +}

    If the setting greetings has been set on the settings.json file next to the sample's executable, or if it has been passed as a command-line argument (e.g. ./engine-sample.settings --greetings "Hello, world!"), the sample will output that value. Otherwise, it will output Hello!, which we set as a default.

    We want this system to run after the settings have been loaded, so we run it after the tag cubos.settings. Notice that if we want the command-line arguments to be loaded as settings, we need to pass argc and argv to the Cubos::Cubos(int, char**) constructor.

    int main(int argc, char** argv)
     {
         Cubos cubos{argc, argv};
         cubos.addPlugin(settingsPlugin);
    diff --git a/docs-preview/pr-862/examples-engine-voxels.html b/docs-preview/pr-862/examples-engine-voxels.html
    index 695d77329..de99de8e1 100644
    --- a/docs-preview/pr-862/examples-engine-voxels.html
    +++ b/docs-preview/pr-862/examples-engine-voxels.html
    @@ -52,15 +52,15 @@ 

    Using the Voxels plugin.

    This example shows the Voxels plugin, which registers asset bridges used to load voxel grids (.grid) and palettes (.pal). Check out the Introduction and Custom Bridges sample for an introduction on the Assets plugin.

    It is very similar to the Renderer, differing only in the fact that in this sample the grid and palette are loaded from files.

    Image

    The plugin function is included from the engine/voxels/plugin.hpp header. To see the asset, you'll also need to perform a basic configuration of the Renderer plugin like shown in the Renderer sample.

        cubos.addPlugin(voxelsPlugin);

    Lets start by defining the handles of the assets we want to use, as done in the Assets sample.

    static const Asset<VoxelGrid> CarAsset = AnyAsset("059c16e7-a439-44c7-9bdc-6e069dba0c75");
    -static const Asset<VoxelPalette> PaletteAsset = AnyAsset("1aa5e234-28cb-4386-99b4-39386b0fc215");

    In this sample, instead of creating a new palette, we just read the data from the asset identified from the PaletteAsset handle we defined previously. Internally, the assets manager will automatically load the palette asset if it hasn't been loaded before.

    static void setPaletteSystem(Read<Assets> assets, Write<Renderer> renderer)
    +static const Asset<VoxelPalette> PaletteAsset = AnyAsset("1aa5e234-28cb-4386-99b4-39386b0fc215");

    In this sample, instead of creating a new palette, we just read the data from the asset identified from the PaletteAsset handle we defined previously. Internally, the assets manager will automatically load the palette asset if it hasn't been loaded before.

    static void setPaletteSystem(const Assets& assets, Renderer& renderer)
     {
         // Read the palette's data and pass it to the renderer.
    -    auto palette = assets->read(PaletteAsset);
    -    (*renderer)->setPalette(*palette);
    -}

    Now, we can create an entity with our car asset.

    static void spawnCarSystem(Commands cmds, Read<Assets> assets)
    +    auto palette = assets.read(PaletteAsset);
    +    renderer->setPalette(*palette);
    +}

    Now, we can create an entity with our car asset.

    static void spawnCarSystem(Commands cmds, const Assets& assets)
     {
         // Calculate the necessary offset to center the model on (0, 0, 0).
    -    auto car = assets->read(CarAsset);
    +    auto car = assets.read(CarAsset);
         glm::vec3 offset = glm::vec3(car->size().x, 0.0F, car->size().z) / -2.0F;
     
         // Create the car entity
    diff --git a/docs-preview/pr-862/examples-engine.html b/docs-preview/pr-862/examples-engine.html
    index 13ada811b..f6bca8a07 100644
    --- a/docs-preview/pr-862/examples-engine.html
    +++ b/docs-preview/pr-862/examples-engine.html
    @@ -50,7 +50,7 @@ 

    Engine

    Showcases features of the Engine library.

    -

    The following examples have fully documented tutorials on how to use the multiple plugins of the engine:

    +

    The following examples have fully documented tutorials on how to use the multiple plugins of the engine:

    diff --git a/docs-preview/pr-862/features-ecs.html b/docs-preview/pr-862/features-ecs.html index 7f7532891..0797139ad 100644 --- a/docs-preview/pr-862/features-ecs.html +++ b/docs-preview/pr-862/features-ecs.html @@ -51,7 +51,7 @@

    ECS

    What is an ECS and how it's used in CUBOS.

    -

    Wikipedia defines ECS as:

    Entity Component System (ECS) is a software architectural pattern mostly used in video game development for the representation of game world objects. An ECS comprises entities composed from components of data, with systems which operate on entities' components.

    ECS follows the principle of composition over inheritance, meaning that every entity is defined not by a type hierarchy, but by the components that are associated with it. Systems act globally over all entities which have the required components.

    The ECS thus is a vital part of the engine, since all of the rest is structured around it in some way. This sets the engine apart from other engines which follow a more traditional model, like Unity, Unreal and Godot.

    A primer on ECS

    Why are we using this?

    ECS is a powerful pattern which has been becoming more popular over the years, and even Unity has started integrating it into its engine. The main advantages are flexibility and performance: it avoids a lot of the problems that come with traditional object-oriented programming, and regarding performance, it excels in situations where the number of entities is high, since it makes use of cache locality. Its also easier to parallelize the systems, since they have clearly defined dependencies.

    Our implementation

    CUBOS. ECS contains the following concepts:

    • World - the main object that holds all of the ECS state.
    • Entities - represent objects in the game world (e.g. a car, a player, a tree).
    • Components - data associated with an entity (e.g. Position, Rotation).
    • Resources - singleton-like objects which are stored per world and which do not belong to a specific entity (e.g. DeltaTime, Input).
    • Systems - functions which operate on resources and entities' components. This is where the logic is implemented.
    • Dispatcher - decides when each system is called and knows which systems are independent from each other so they can be called at the same time (parallel computing).

    On the engine side, the Dispatcher is not exposed. Instead, the Cubos class is used to add systems and specify when they should be called.

    One important thing to note is that in an ECS the data is completely decoupled from the logic. What this means is that entities and components do not and should not possess any functionality other than storing data. All of the logic is relegated to the systems.

    How do we use it?

    Lets say we want to have multiple objects with positions and velocities, and every frame we want to add their velocities to their positions.

    In a traditional object-oriented approach, we would have something along the lines of:

    class MyObject : public GameObject
    +

    Wikipedia defines ECS as:

    Entity Component System (ECS) is a software architectural pattern mostly used in video game development for the representation of game world objects. An ECS comprises entities composed from components of data, with systems which operate on entities' components.

    ECS follows the principle of composition over inheritance, meaning that every entity is defined not by a type hierarchy, but by the components that are associated with it. Systems act globally over all entities which have the required components.

    The ECS thus is a vital part of the engine, since all of the rest is structured around it in some way. This sets the engine apart from other engines which follow a more traditional model, like Unity, Unreal and Godot.

    A primer on ECS

    Why are we using this?

    ECS is a powerful pattern which has been becoming more popular over the years, and even Unity has started integrating it into its engine. The main advantages are flexibility and performance: it avoids a lot of the problems that come with traditional object-oriented programming, and regarding performance, it excels in situations where the number of entities is high, since it makes use of cache locality. Its also easier to parallelize the systems, since they have clearly defined dependencies.

    Our implementation

    CUBOS. ECS contains the following concepts:

    • Cubos - used to configure and run an ECS world and systems.
    • World - the main object that holds all of the ECS state.
    • Entities - represent objects in the game world (e.g. a car, a player, a tree).
    • Components - data associated with an entity (e.g. Position, Rotation).
    • Resources - singleton-like objects which are stored per world and which do not belong to a specific entity (e.g. DeltaTime, Input).
    • Systems - functions which operate on resources and entities' components. This is where the logic is implemented.

    One important thing to note is that in an ECS the data is completely decoupled from the logic. What this means is that entities and components do not and should not possess any functionality other than storing data. All of the logic is relegated to the systems.

    How do we use it?

    Lets say we want to have multiple objects with positions and velocities, and every frame we want to add their velocities to their positions.

    In a traditional object-oriented approach, we would have something along the lines of:

    class MyObject : public GameObject
     {
     public:
         // ...
    @@ -81,22 +81,22 @@ 

    struct DeltaTime { float value = 0.0f; -};

    So, where does the update logic belong? We put it in a system. Systems are functions whose arguments are of certain types, which you can read more about in the ECS module page.

    To access a resource, we use the Read and Write arguments. In this case, we won't be modifying the delta time, so we will use Read<DeltaTime>. To access entities and their components, we use the Query argument. In this case we we want to access all entities with both positions and velocities, and modify their positions, so we will use Query<Write<Position>, Read<Velocity>>.

    void velocitySystem(
    -    Read<DeltaTime> dt,
    -    Query<Write<Position>, Read<Velocity>> query)
    +};

    So, where does the update logic belong? We put it in a system. Systems are functions whose arguments are of certain types, which you can read more about in the ECS module page.

    To access a resource, we use the Read and Write arguments. In this case, we won't be modifying the delta time, so we will use const DeltaTime&. To access entities and their components, we use the Query argument. In this case we we want to access all entities with both positions and velocities, and modify their positions, so we will use Query<Position&, const Velocity&>.

    void velocitySystem(
    +    const DeltaTime& dt,
    +    Query<Position&, const Velocity&> query)
     {
         for (auto [entity, position, velocity] : query)
         {
             position->vec += velocity->vec * dt->value;
         }
    -}

    We can then iterate over all queried entities and update their positions using their velocities and the delta time.

    Going further

    Registering resources and components

    Before components and resources are used in a World, they must be registered on it. This should be done once, at the start of the program. For example, using the CUBOS. main class, for the previous example we would write:

    cubos.addComponent<Position>();
    +}

    We can then iterate over all queried entities and update their positions using their velocities and the delta time.

    Going further

    Registering resources and components

    Before components and resources are used in a World, they must be registered on it. This should be done once, at the start of the program. For example, using the CUBOS. main class, for the previous example we would write:

    cubos.addComponent<Position>();
     cubos.addComponent<Velocity>();
     cubos.addResource<DeltaTime>();

    Commands

    When you have direct access to the World, you can manipulate entities directly:

    auto entity = world.create(Position {}, Velocity {});
     world.removeComponent<Velocity>(entity);
     world.addComponent(entity, Dead {});
    -world.destroy(entity);

    If necessary, you can access the world in a system through the arguments Read<World> or Write<World>. However, this is not recommended, since it becomes impossible for the dispatcher to know what the system is accessing, and thus it cannot parallelize it.

    Instead, you should use the Commands argument. Through it you can queue operations to be executed at a later time, when its safe to do so.

    Imagine we want to have spawners which create new entities on their position and then destroy themselves. We can implement this with a system like this:

    void spawnerSystem(
    +world.destroy(entity);

    If necessary, you can access the world in a system through the arguments const World& or World&. However, this is not recommended, since it becomes impossible to know what the system is accessing, and thus we cannot parallelize it.

    Instead, you should use the Commands argument. Through it you can queue operations to be executed at a later time, when its safe to do so.

    Imagine we want to have spawners which create new entities on their position and then destroy themselves. We can implement this with a system like this:

    void spawnerSystem(
         Commands commands,
    -    Query<Read<Spawner>, Read<Position>> spawners)
    +    Query<const Spawner&, const Position&> spawners)
     {
         for (auto [entity, spawner, position] : spawners)
         {
    diff --git a/docs-preview/pr-862/features-plugins.html b/docs-preview/pr-862/features-plugins.html
    index 67b86d723..06e9a033c 100644
    --- a/docs-preview/pr-862/features-plugins.html
    +++ b/docs-preview/pr-862/features-plugins.html
    @@ -52,11 +52,11 @@ 

    Plugins

    What are plugins and how they can be used to organize your code.

    -

    Configuring the engine

    Plugins are a feature of the cubos::engine::Cubos class. This class is the main thing you'll be interacting with when developing a game with CUBOS.. It is used to configure the engine and run the game loop. Through it, you can register new components, resources and configure systems to be run on specific conditions.

    An application which just prints "Hello World!" and which does absolutely nothing else - not even open a window - would look like this:

    #include <cubos/engine/cubos.hpp>
    +

    Configuring the engine

    Plugins are a feature of the cubos::core::ecs::Cubos class. This class is the main thing you'll be interacting with when developing a game with CUBOS.. It is used to configure the engine and run the game loop. Through it, you can register new components, resources and configure systems to be run on specific conditions.

    An application which just prints "Hello World!" and which does absolutely nothing else - not even open a window - would look like this:

    #include <cubos/engine/prelude.hpp>
     
     #include <iostream>
     
    -using Cubos = cubos::engine::Cubos;
    +using cubos::engine::Cubos;
     
     void helloWorld()
     {
    @@ -68,11 +68,11 @@ 

    Cubos cubos; cubos.startupSystem(helloWorld); cubos.run(); -}

    What are plugins?

    If you had to add every system, component and resource to your game's main source file, it would quickly become a mess. Plugins are just functions which receive a reference to the Cubos class. Nothing more.

    The idiomatic way to use plugins is through the Cubos::addPlugin method. It receives a plugin function, and executes it only if it hasn't been executed before. This property is useful for solving dependency issues between plugins. For example, if B and C adds A and D adds B and C, you would be adding A twice.

    If we were to put the hello world functionality on a plugin, the previous example would look like this:

    #include <cubos/engine/cubos.hpp>
    +}

    What are plugins?

    If you had to add every system, component and resource to your game's main source file, it would quickly become a mess. Plugins are just functions which receive a reference to the Cubos class. Nothing more.

    The idiomatic way to use plugins is through the Cubos::addPlugin method. It receives a plugin function, and executes it only if it hasn't been executed before. This property is useful for solving dependency issues between plugins. For example, if B and C adds A and D adds B and C, you would be adding A twice.

    If we were to put the hello world functionality on a plugin, the previous example would look like this:

    #include <cubos/engine/prelude.hpp>
     
     #include <iostream>
     
    -using Cubos = cubos::engine::Cubos;
    +using cubos::engine::Cubos;
     
     void helloWorld()
     {
    diff --git a/docs-preview/pr-862/relation_2reflection_8hpp.html b/docs-preview/pr-862/fetcher_8hpp.html
    similarity index 90%
    rename from docs-preview/pr-862/relation_2reflection_8hpp.html
    rename to docs-preview/pr-862/fetcher_8hpp.html
    index b849ef985..726c748a4 100644
    --- a/docs-preview/pr-862/relation_2reflection_8hpp.html
    +++ b/docs-preview/pr-862/fetcher_8hpp.html
    @@ -2,7 +2,7 @@
     
     
       
    -  core/ecs/relation/reflection.hpp file | CUBOS. Docs
    +  core/ecs/query/fetcher.hpp file | CUBOS. Docs
       
       
       
    @@ -46,9 +46,9 @@
         

    - core/ecs/relation/reflection.hpp file + core/ecs/query/fetcher.hpp file

    -

    Class cubos::core::ecs::RelationTypeBuilder.

    +

    Class cubos::core::ecs::QueryFetcher.

    diff --git a/docs-preview/pr-862/files.html b/docs-preview/pr-862/files.html index 21fb025fa..1d77b7524 100644 --- a/docs-preview/pr-862/files.html +++ b/docs-preview/pr-862/files.html @@ -94,7 +94,6 @@

    Files

    dir component Component directory. @@ -102,15 +101,22 @@

    Files

    dir entity Entity directory.
  • file writer.hpp Class cubos::core::ecs::EventWriter.
  • -
  • file accessors.hpp Class cubos::core::ecs::Read and related types.
  • -
  • file commands.hpp Class cubos::core::ecs::Commands and related types.
  • +
  • file commands.hpp Class cubos::core::ecs::Commands.
  • file dispatcher.hpp Class cubos::core::ecs::Dispatcher.
  • -
  • file query.hpp Class cubos::core::ecs::Query and related types.
  • +
  • file query.hpp Class cubos::core::ecs::Query.
  • file system.hpp Class cubos::core::ecs::SystemWrapper and related types.
  • +
  • file blueprint.hpp Class cubos::core::ecs::Blueprint.
  • +
  • file command_buffer.hpp Class cubos::core::ecs::CommandBuffer.
  • +
  • file cubos.hpp Class cubos::engine::Cubos.
  • +
  • file reflection.hpp Class cubos::core::ecs::TypeBuilder.
  • +
  • file types.hpp Class cubos::core::ecs::Types.
  • file world.hpp Class cubos::core::ecs::World.
  • @@ -247,7 +278,7 @@

    Files

  • file plugin.hpp Plugin entry point.
  • -
  • file cubos.hpp Class cubos::engine::Cubos.
  • diff --git a/docs-preview/pr-862/filter_8hpp.html b/docs-preview/pr-862/filter_8hpp.html new file mode 100644 index 000000000..dacc28925 --- /dev/null +++ b/docs-preview/pr-862/filter_8hpp.html @@ -0,0 +1,138 @@ + + + + + core/ecs/query/filter.hpp file | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + core/ecs/query/filter.hpp file +

    +

    Class cubos::core::ecs::QueryFilter.

    + +
    +

    Namespaces

    +
    +
    namespace cubos
    +
    CUBOS. libraries namespace.
    +
    namespace cubos::core
    +
    Core namespace.
    +
    namespace cubos::core::ecs
    +
    ECS module.
    +
    +
    +
    +

    Classes

    +
    +
    + class cubos::core::ecs::QueryFilter +
    +
    Used to find matches for the given query terms. Essentially contains the non-templated part of the query logic.
    +
    + struct cubos::core::ecs::QueryFilter::View::Iterator::Match +
    +
    Output structure of the iterator.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/fixed__delta__time_8hpp.html b/docs-preview/pr-862/fixed__delta__time_8hpp.html index 41aff7490..821237180 100644 --- a/docs-preview/pr-862/fixed__delta__time_8hpp.html +++ b/docs-preview/pr-862/fixed__delta__time_8hpp.html @@ -76,7 +76,7 @@

    Classes

    struct cubos::engine::FixedDeltaTime
    -
    Resouce which holds the value of the fixed delta for the physics update.
    +
    Resource which holds the value of the fixed delta for the physics update.
  • diff --git a/docs-preview/pr-862/group__collisions-plugin.html b/docs-preview/pr-862/group__collisions-plugin.html index 132acc371..29d7be3d3 100644 --- a/docs-preview/pr-862/group__collisions-plugin.html +++ b/docs-preview/pr-862/group__collisions-plugin.html @@ -70,6 +70,8 @@

    Contents

    Files

    +
    file potentially_colliding_with.hpp
    +
    Component cubos::engine::PotentiallyCollidingWith.
    file collider.hpp
    Component cubos::engine::Collider.
    file collision_event.hpp
    @@ -85,6 +87,10 @@

    Files

    Classes

    +
    + struct cubos::engine::PotentiallyCollidingWith +
    +
    Component which represents a potential collisions.
    struct cubos::engine::Collider
    diff --git a/docs-preview/pr-862/group__core-ecs-component.html b/docs-preview/pr-862/group__core-ecs-component.html index 055efd5df..0c0efc06f 100644 --- a/docs-preview/pr-862/group__core-ecs-component.html +++ b/docs-preview/pr-862/group__core-ecs-component.html @@ -67,8 +67,6 @@

    Files

    file manager.hpp
    Class cubos::core::ecs::ComponentManager and related types.
    -
    file reflection.hpp
    -
    Class cubos::core::ecs::ComponentTypeBuilder.
    file storage.hpp
    Class cubos::core::ecs::Storage and related types.
    diff --git a/docs-preview/pr-862/group__core-ecs-entity.html b/docs-preview/pr-862/group__core-ecs-entity.html index 44fd5f6ff..3d523b511 100644 --- a/docs-preview/pr-862/group__core-ecs-entity.html +++ b/docs-preview/pr-862/group__core-ecs-entity.html @@ -65,17 +65,31 @@

    Contents

    Files

    +
    file archetype_graph.hpp
    +
    Class cubos::core::ecs::ArchetypeGraph.
    +
    file archetype_id.hpp
    +
    Struct cubos::core::ecs::ArchetypeId.
    file entity.hpp
    Struct cubos::core::ecs::Entity.
    file hash.hpp
    Struct cubos::core::ecs::EntityHash.
    file manager.hpp
    Class cubos::core::ecs::EntityManager.
    +
    file pool.hpp
    +
    Class cubos::core::ecs::EntityPool.

    Classes

    +
    + class cubos::core::ecs::ArchetypeGraph +
    +
    Stores which column types each archetype holds and the edges which connect them.
    +
    + struct cubos::core::ecs::ArchetypeId +
    +
    Identifies an archetype.
    struct cubos::core::ecs::Entity
    @@ -88,6 +102,10 @@

    Classes

    class cubos::core::ecs::EntityManager
    Internal type which holds and manages entities and their component masks.
    +
    + class cubos::core::ecs::EntityPool +
    +
    Manages the creation and destruction of entity identifiers, as well as storing their archetype identifiers.
    diff --git a/docs-preview/pr-862/group__core-ecs-query.html b/docs-preview/pr-862/group__core-ecs-query.html new file mode 100644 index 000000000..fde17cea3 --- /dev/null +++ b/docs-preview/pr-862/group__core-ecs-query.html @@ -0,0 +1,164 @@ + + + + + Core » ECS » Query module | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + Core » + ECS » + Query module

    +

    Defines the query functionality of the ECS.

    + +
    +

    Files

    +
    +
    file access.hpp
    +
    Struct cubos::core::ecs::QueryAccess.
    +
    file data.hpp
    +
    Class cubos::core::ecs::QueryData.
    +
    file fetcher.hpp
    +
    Class cubos::core::ecs::QueryFetcher.
    +
    file filter.hpp
    +
    Class cubos::core::ecs::QueryFilter.
    +
    file opt.hpp
    +
    Class cubos::core::ecs::Opt.
    +
    file term.hpp
    +
    Struct cubos::core::ecs::QueryTerm.
    +
    +
    +
    +

    Classes

    +
    +
    + struct cubos::core::ecs::QueryAccess +
    +
    Describes the types of data a query accesses.
    +
    +
    template<typename... Ts>
    + class cubos::core::ecs::QueryData +
    +
    Holds the data necessary to execute a query.
    +
    +
    template<typename T>
    + class cubos::core::ecs::QueryFetcher +
    +
    Type meant to be specialized which implements for each argument type the necessary logic to extract it from the tables.
    +
    + class cubos::core::ecs::QueryFilter +
    +
    Used to find matches for the given query terms. Essentially contains the non-templated part of the query logic.
    +
    +
    template<typename T>
    + class cubos::core::ecs::Opt +
    +
    Wrapper for reference types to indicate that the given argument type is optional in a query.
    +
    + struct cubos::core::ecs::QueryTerm +
    +
    Describes a term in a query.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/group__core-ecs-system.html b/docs-preview/pr-862/group__core-ecs-system.html index 1b94ce528..a2eec5f6d 100644 --- a/docs-preview/pr-862/group__core-ecs-system.html +++ b/docs-preview/pr-862/group__core-ecs-system.html @@ -65,10 +65,8 @@

    Contents

    Files

    -
    file accessors.hpp
    -
    Class cubos::core::ecs::Read and related types.
    file commands.hpp
    -
    Class cubos::core::ecs::Commands and related types.
    +
    Class cubos::core::ecs::Commands.
    file dispatcher.hpp
    Class cubos::core::ecs::Dispatcher.
    file pipe.hpp
    @@ -78,7 +76,7 @@

    Files

    file writer.hpp
    Class cubos::core::ecs::EventWriter.
    file query.hpp
    -
    Class cubos::core::ecs::Query and related types.
    +
    Class cubos::core::ecs::Query.
    file system.hpp
    Class cubos::core::ecs::SystemWrapper and related types.
    @@ -86,42 +84,10 @@

    Files

    Classes

    -
    -
    template<typename T>
    - class cubos::core::ecs::Read -
    -
    System argument which provides read access to the resource T, or query argument which provides read access to the component T.
    -
    -
    template<typename T>
    - class cubos::core::ecs::Write -
    -
    System argument which provides write access to the resource T, or query argument which provides write access to the component T.
    -
    -
    template<typename T>
    - class cubos::core::ecs::OptRead -
    -
    System argument which provides read access to the resource T if it exists, or query argument which provides read access to the component T if it exists.
    -
    -
    template<typename T>
    - class cubos::core::ecs::OptWrite -
    -
    System argument which provides write access to the resource T if it exists, or query argument which provides write access to the component T if it exists.
    -
    - class cubos::core::ecs::EntityBuilder -
    -
    Allows editing an entity created by a Commands object.
    -
    - class cubos::core::ecs::BlueprintBuilder -
    -
    Used to edit a blueprint spawned by a Commands object.
    class cubos::core::ecs::Commands
    System argument used to write ECS commands and execute them at a later time.
    -
    - class cubos::core::ecs::CommandBuffer -
    -
    Stores commands to execute them later.
    class cubos::core::ecs::Dispatcher
    @@ -142,11 +108,7 @@

    Classes

    System argument which allows the system to send events of type T to other systems.
    - struct cubos::core::ecs::QueryInfo -
    -
    Describes a query.
    -
    -
    template<typename... ComponentTypes>
    +
    template<typename... Ts>
    class cubos::core::ecs::Query
    System argument which holds the result of a query over all entities in world which match the given arguments.
    diff --git a/docs-preview/pr-862/group__core-ecs-table.html b/docs-preview/pr-862/group__core-ecs-table.html new file mode 100644 index 000000000..c8e9c8e56 --- /dev/null +++ b/docs-preview/pr-862/group__core-ecs-table.html @@ -0,0 +1,161 @@ + + + + + Core » ECS » Table module | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + Core » + ECS » + Table module

    +

    Contains various table-like data structures which storage data associated to entities.

    + +
    +

    Files

    +
    +
    file column.hpp
    +
    Struct cubos::core::ecs::DenseTableId.
    +
    file registry.hpp
    +
    Class cubos::core::ecs::DenseTableRegistry.
    +
    file table.hpp
    +
    Class cubos::core::ecs::DenseTable.
    +
    file id.hpp
    +
    Struct cubos::core::ecs::SparseRelationTableId.
    +
    file registry.hpp
    +
    Class cubos::core::ecs::SparseRelationTableRegistry.
    +
    file tables.hpp
    +
    Class cubos::core::ecs::Tables.
    +
    +
    +
    +

    Classes

    +
    +
    + struct cubos::core::ecs::ColumnId +
    +
    Identifies a data column type.
    +
    + class cubos::core::ecs::DenseTableRegistry +
    +
    Stores the dense tables of a given world.
    +
    + class cubos::core::ecs::DenseTable +
    +
    Stores the dense data associated to entities of a given archetype.
    +
    + struct cubos::core::ecs::SparseRelationTableId +
    +
    Identifies a sparse relation table.
    +
    + class cubos::core::ecs::SparseRelationTableRegistry +
    +
    Stores all of the sparse relation tables.
    +
    + class cubos::core::ecs::Tables +
    +
    Stores the tables of a given world.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/group__core-ecs.html b/docs-preview/pr-862/group__core-ecs.html index f430075c5..d77245040 100644 --- a/docs-preview/pr-862/group__core-ecs.html +++ b/docs-preview/pr-862/group__core-ecs.html @@ -65,7 +65,7 @@

    Contents

    -

    This module is arguably the heart of the engine, as it provides a means to organize and manage the data and logic of both the engine and games built with it. It is, as of now, a bit of a mess. Most of the exposed types are internal to the documentation, and thus it can get hard to navigate (TODO #377).

    Data types

    • World - stores entities, components and resources, can be queried.
    • Dispatcher - stores and dispatches systems in the right order.
    • Blueprint - bundle of entities and components which can be spawned using Commands.

    System argument types

    • Read<R> - used to read resource data of type R.
    • Write<R> - used to write resource data of type R.
    • Read<World> - used to read the world directly (not recommended, ruins parallelism, prefer Commands).
    • Write<World> - used to write the world directly (not recommended, ruins parallelism, prefer Commands).
    • Commands - used to queue entities to be created, destroyed and other operations.
    • EventReader<E> - reads events of type E sent from other systems.
    • EventWriter<E> - sends events of type E to other systems.
    • Query<Args...> - queries the world for entities which match its arguments.

    Query argument types

    • Read<C> - matches entities with the component C, read-only access.
    • Write<C> - matches entities with the component C, write access.
    • OptRead<C> - matches all entities, read-only access when the component C is present.
    • OptWrite<C> - matches all entities, write access when the component C is present.
    +

    This module is arguably the heart of the engine, as it provides a means to organize and manage the data and logic of both the engine and games built with it. It is, as of now, a bit of a mess. Most of the exposed types are internal to the documentation, and thus it can get hard to navigate (TODO #377).

    Data types

    • World - stores entities, components and resources, can be queried.
    • Dispatcher - stores and dispatches systems in the right order.
    • Blueprint - bundle of entities and components which can be spawned using Commands.

    System argument types

    • const R& - used to read resource data of type R.
    • R& - used to write resource data of type R.
    • const World& - used to read the world directly (not recommended, ruins parallelism, prefer Commands).
    • World& - used to write the world directly (not recommended, ruins parallelism, prefer Commands).
    • Commands - used to queue entities to be created, destroyed and other operations.
    • EventReader<E> - reads events of type E sent from other systems.
    • EventWriter<E> - sends events of type E to other systems.
    • Query<Args...> - queries the world for entities which match its arguments.

    Query argument types

    • const C& - matches entities with the component C, read-only access.
    • C& - matches entities with the component C, write access.
    • Opt<const C&>" - matches all entities, read-only access when the component C is present. -Opt<C&>` - matches all entities, write access when the component C is present.

    Modules

    @@ -73,12 +73,14 @@

    Modules

    Component part of the ECS.
    module Entity
    Entity part of the ECS.
    -
    module Relation
    -
    Relation part of the ECS.
    +
    module Query
    +
    Defines the query functionality of the ECS.
    module Resource
    Resource part of the ECS.
    module System
    System part of the ECS.
    +
    module Table
    +
    Contains various table-like data structures which storage data associated to entities.
    @@ -86,6 +88,12 @@

    Files

    file blueprint.hpp
    Class cubos::core::ecs::Blueprint.
    +
    file command_buffer.hpp
    +
    Class cubos::core::ecs::CommandBuffer.
    +
    file reflection.hpp
    +
    Class cubos::core::ecs::TypeBuilder.
    +
    file types.hpp
    +
    Class cubos::core::ecs::Types.
    file world.hpp
    Class cubos::core::ecs::World.
    @@ -96,7 +104,40 @@

    Classes

    class cubos::core::ecs::Blueprint
    -
    Collection of entities and their respective components.
    +
    Collection of entities and their respective components and relations.
    +
    + class cubos::core::ecs::CommandBuffer +
    +
    Stores commands to execute them later.
    +
    + struct cubos::core::ecs::DeltaTime +
    +
    Resource which stores the time since the last iteration of the main loop started.
    +
    + struct cubos::core::ecs::ShouldQuit +
    +
    Resource used as a flag to indicate whether the main loop should stop running.
    +
    + struct cubos::core::ecs::Arguments +
    +
    Resource which stores the command-line arguments.
    +
    + class cubos::core::ecs::TagBuilder +
    +
    Used to chain configurations related to tags.
    +
    + class cubos::core::ecs::SystemBuilder +
    +
    Used to chain configurations related to systems.
    +
    + class cubos::core::ecs::Cubos +
    +
    Represents the engine itself, and exposes the interface with which the game developer interacts with. Ties up all the different parts of the engine together.
    +
    +
    template<typename T>
    + class cubos::core::ecs::TypeBuilder +
    +
    Builder for reflection::Type objects which represent ECS types.
    class cubos::core::ecs::World
    diff --git a/docs-preview/pr-862/group__engine.html b/docs-preview/pr-862/group__engine.html index d9b2e6f87..44b758558 100644 --- a/docs-preview/pr-862/group__engine.html +++ b/docs-preview/pr-862/group__engine.html @@ -61,7 +61,7 @@

    Contents

    -

    The engine library is built on top of the core library and contains code exclusive to game execution. This includes the main loop, asset management, rendering and physics. It is built around the Cubos class and designed to be as modular as possible. Each sub-module corresponds to a plugin, or a set of plugins.

    The library re-exports some of the core library functionality for convenience such that the user doesn't have to use the cubos::core namespace directly very often.

    +

    The engine library is built on top of the core library and contains code exclusive to game execution. This includes asset management, rendering and physics. It is built around the Cubos class and designed to be as modular as possible. Each sub-module corresponds to a plugin, or a set of plugins.

    The library re-exports some of the core library functionality for convenience such that the user doesn't have to use the cubos::core namespace directly very often.

    Modules

    @@ -81,7 +81,7 @@

    Modules

    Creates and handles the lifecycle of a renderer.
    module Scene
    Adds scenes to CUBOS.
    -
    module ScreenPicker
    +
    module ScreenPicker
    Used to select entities and gizmos by clicking them.
    module Settings
    Adds and manages settings.
    @@ -101,7 +101,7 @@

    Modules

    Files

    file cubos.hpp
    -
    Class cubos::engine::Cubos.
    +
    Class cubos::engine::Cubos.
    file settings.hpp
    Class cubos::engine::Settings.
    @@ -109,30 +109,6 @@

    Files

    Classes

    -
    - struct cubos::engine::DeltaTime -
    -
    Resource which stores the time since the last iteration of the main loop started.
    -
    - struct cubos::engine::ShouldQuit -
    -
    Resource used as a flag to indicate whether the main loop should stop running.
    -
    - struct cubos::engine::Arguments -
    -
    Resource which stores the command-line arguments.
    -
    - class cubos::engine::TagBuilder -
    -
    Used to chain configurations related to tags.
    -
    - class cubos::engine::SystemBuilder -
    -
    Used to chain configurations related to systems.
    -
    - class cubos::engine::Cubos -
    -
    Represents the engine itself, and exposes the interface with which the game developer interacts with. Ties up all the different parts of the engine together.
    class cubos::engine::Settings
    diff --git a/docs-preview/pr-862/group__physics-plugin.html b/docs-preview/pr-862/group__physics-plugin.html index 44aa0e9cd..3b1498bad 100644 --- a/docs-preview/pr-862/group__physics-plugin.html +++ b/docs-preview/pr-862/group__physics-plugin.html @@ -124,15 +124,15 @@

    Classes

    struct cubos::engine::FixedDeltaTime
    -
    Resouce which holds the value of the fixed delta for the physics update.
    +
    Resource which holds the value of the fixed delta for the physics update.
    struct cubos::engine::Gravity
    -
    Resouce which holds the global value of gravity.
    +
    Resource which holds the global value of gravity.
    struct cubos::engine::Substeps
    -
    Resouce which holds the amount of substeps for the physics update.
    +
    Resource which holds the amount of substeps for the physics update.
    diff --git a/docs-preview/pr-862/group__screenpicker-plugin.html b/docs-preview/pr-862/group__screen-picker-plugin.html similarity index 94% rename from docs-preview/pr-862/group__screenpicker-plugin.html rename to docs-preview/pr-862/group__screen-picker-plugin.html index 99c82599a..d689c5415 100644 --- a/docs-preview/pr-862/group__screenpicker-plugin.html +++ b/docs-preview/pr-862/group__screen-picker-plugin.html @@ -66,13 +66,13 @@

    Contents

    -

    Resources

    • ScreenPicker - provides a texture to store entity and gizmo ids.

    Startup tags

    • cubos.screenpicker.init - the ScreenPicker resource is initialized, after cubos.window.init

    Tags

    • cubos.screenpicker.clear - the picking texture is cleared
    • cubos.screenpicker.resize - window resize events are handled and the ScreenPicker texture is resized, after cubos.window.poll and before cubos.screenpicker.clear.

    Dependencies

    +

    Resources

    • ScreenPicker - provides a texture to store entity and gizmo ids.

    Startup tags

    • cubos.screenPicker.init - the ScreenPicker resource is initialized, after cubos.window.init

    Tags

    • cubos.screenPicker.clear - the picking texture is cleared
    • cubos.screenPicker.resize - window resize events are handled and the ScreenPicker texture is resized, after cubos.window.poll and before cubos.screenPicker.clear.

    Dependencies

    Files

    -
    file plugin.hpp
    +
    file plugin.hpp
    Plugin entry point.
    -
    file screenpicker.hpp
    +
    file screen_picker.hpp
    Resource cubos::engine::ScreenPicker.
    @@ -99,7 +99,7 @@

    Function documentation

    void screenPickerPlugin(Cubos& cubos) - +

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__settings-plugin.html b/docs-preview/pr-862/group__settings-plugin.html index 73a38a4e7..dff93a841 100644 --- a/docs-preview/pr-862/group__settings-plugin.html +++ b/docs-preview/pr-862/group__settings-plugin.html @@ -64,7 +64,7 @@

    Contents

    -

    Initially, parses settings from the Arguments resource. Then, the file at settings.path is loaded, as a JSON file. If the file does not exist, it is created. If it can't be parsed, the plugin aborts. Previously set settings will be overriden, and file settings will be overriden by command line arguments.

    Settings

    • settings.path - path of the settings file (default: ./settings.json).

    Resources

    Startup tags

    • cubos.settings - the settings are loaded, overriding values set previously.
    +

    Initially, parses settings from the Arguments resource. Then, the file at settings.path is loaded, as a JSON file. If the file does not exist, it is created. If it can't be parsed, the plugin aborts. Previously set settings will be overriden, and file settings will be overriden by command line arguments.

    Settings

    • settings.path - path of the settings file (default: ./settings.json).

    Resources

    Startup tags

    • cubos.settings - the settings are loaded, overriding values set previously.

    Files

    diff --git a/docs-preview/pr-862/group__tesseratos-asset-explorer-plugin.html b/docs-preview/pr-862/group__tesseratos-asset-explorer-plugin.html index 28c4409c1..9419413ce 100644 --- a/docs-preview/pr-862/group__tesseratos-asset-explorer-plugin.html +++ b/docs-preview/pr-862/group__tesseratos-asset-explorer-plugin.html @@ -75,7 +75,7 @@

    Files

    Functions

    - void assetExplorerPlugin(cubos::engine::Cubos& cubos) + void assetExplorerPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -84,7 +84,7 @@

    Functions

    Function documentation

    - void assetExplorerPlugin(cubos::engine::Cubos& cubos) + void assetExplorerPlugin(cubos::engine::Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__tesseratos-debug-camera-plugin.html b/docs-preview/pr-862/group__tesseratos-debug-camera-plugin.html index eaa947fca..9514073e9 100644 --- a/docs-preview/pr-862/group__tesseratos-debug-camera-plugin.html +++ b/docs-preview/pr-862/group__tesseratos-debug-camera-plugin.html @@ -74,7 +74,7 @@

    Files

    Functions

    - void debugCameraPlugin(cubos::engine::Cubos& cubos) + void debugCameraPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -83,7 +83,7 @@

    Functions

    Function documentation

    - void debugCameraPlugin(cubos::engine::Cubos& cubos) + void debugCameraPlugin(cubos::engine::Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__tesseratos-entity-inspector-plugin.html b/docs-preview/pr-862/group__tesseratos-entity-inspector-plugin.html index 8a01a67cc..35a1add1f 100644 --- a/docs-preview/pr-862/group__tesseratos-entity-inspector-plugin.html +++ b/docs-preview/pr-862/group__tesseratos-entity-inspector-plugin.html @@ -74,7 +74,7 @@

    Files

    Functions

    - void entityInspectorPlugin(cubos::engine::Cubos& cubos) + void entityInspectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -83,7 +83,7 @@

    Functions

    Function documentation

    - void entityInspectorPlugin(cubos::engine::Cubos& cubos) + void entityInspectorPlugin(cubos::engine::Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__tesseratos-entity-selector-plugin.html b/docs-preview/pr-862/group__tesseratos-entity-selector-plugin.html index 48b4fac6a..c6520e615 100644 --- a/docs-preview/pr-862/group__tesseratos-entity-selector-plugin.html +++ b/docs-preview/pr-862/group__tesseratos-entity-selector-plugin.html @@ -75,7 +75,7 @@

    Files

    Functions

    - void entitySelectorPlugin(cubos::engine::Cubos& cubos) + void entitySelectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -84,7 +84,7 @@

    Functions

    Function documentation

    - void entitySelectorPlugin(cubos::engine::Cubos& cubos) + void entitySelectorPlugin(cubos::engine::Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__tesseratos-metrics-panel-plugin.html b/docs-preview/pr-862/group__tesseratos-metrics-panel-plugin.html index 00b8301fa..20acf7668 100644 --- a/docs-preview/pr-862/group__tesseratos-metrics-panel-plugin.html +++ b/docs-preview/pr-862/group__tesseratos-metrics-panel-plugin.html @@ -74,7 +74,7 @@

    Files

    Functions

    - void metricsPanelPlugin(cubos::engine::Cubos& cubos) + void metricsPanelPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -83,7 +83,7 @@

    Functions

    Function documentation

    - void metricsPanelPlugin(cubos::engine::Cubos& cubos) + void metricsPanelPlugin(cubos::engine::Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__tesseratos-scene-editor-plugin.html b/docs-preview/pr-862/group__tesseratos-scene-editor-plugin.html index 2dd821815..43328d2f0 100644 --- a/docs-preview/pr-862/group__tesseratos-scene-editor-plugin.html +++ b/docs-preview/pr-862/group__tesseratos-scene-editor-plugin.html @@ -74,7 +74,7 @@

    Files

    Functions

    - void sceneEditorPlugin(cubos::engine::Cubos& cubos) + void sceneEditorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -83,7 +83,7 @@

    Functions

    Function documentation

    - void sceneEditorPlugin(cubos::engine::Cubos& cubos) + void sceneEditorPlugin(cubos::engine::Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__tesseratos-settings-inspector-plugin.html b/docs-preview/pr-862/group__tesseratos-settings-inspector-plugin.html index bc2419b91..d5dfeebca 100644 --- a/docs-preview/pr-862/group__tesseratos-settings-inspector-plugin.html +++ b/docs-preview/pr-862/group__tesseratos-settings-inspector-plugin.html @@ -74,7 +74,7 @@

    Files

    Functions

    - void settingsInspectorPlugin(cubos::engine::Cubos& cubos) + void settingsInspectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -83,7 +83,7 @@

    Functions

    Function documentation

    - void settingsInspectorPlugin(cubos::engine::Cubos& cubos) + void settingsInspectorPlugin(cubos::engine::Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__tesseratos-toolbox-plugin.html b/docs-preview/pr-862/group__tesseratos-toolbox-plugin.html index 3060849d4..c13591513 100644 --- a/docs-preview/pr-862/group__tesseratos-toolbox-plugin.html +++ b/docs-preview/pr-862/group__tesseratos-toolbox-plugin.html @@ -85,7 +85,7 @@

    Classes

    Functions

    - void toolboxPlugin(cubos::engine::Cubos& cubos) + void toolboxPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -94,7 +94,7 @@

    Functions

    Function documentation

    - void toolboxPlugin(cubos::engine::Cubos& cubos) + void toolboxPlugin(cubos::engine::Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__tesseratos-transform-gizmo-plugin.html b/docs-preview/pr-862/group__tesseratos-transform-gizmo-plugin.html index e727ac6c0..516cbcaf4 100644 --- a/docs-preview/pr-862/group__tesseratos-transform-gizmo-plugin.html +++ b/docs-preview/pr-862/group__tesseratos-transform-gizmo-plugin.html @@ -72,7 +72,7 @@

    Files

    Functions

    - void transformGizmoPlugin(cubos::engine::Cubos& cubos) + void transformGizmoPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -81,7 +81,7 @@

    Functions

    Function documentation

    - void transformGizmoPlugin(cubos::engine::Cubos& cubos) + void transformGizmoPlugin(cubos::engine::Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__tesseratos-voxel-palette-editor-plugin.html b/docs-preview/pr-862/group__tesseratos-voxel-palette-editor-plugin.html index d3f46ea49..ebb13ea3a 100644 --- a/docs-preview/pr-862/group__tesseratos-voxel-palette-editor-plugin.html +++ b/docs-preview/pr-862/group__tesseratos-voxel-palette-editor-plugin.html @@ -74,7 +74,7 @@

    Files

    Functions

    - void voxelPaletteEditorPlugin(cubos::engine::Cubos& cubos) + void voxelPaletteEditorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -83,7 +83,7 @@

    Functions

    Function documentation

    - void voxelPaletteEditorPlugin(cubos::engine::Cubos& cubos) + void voxelPaletteEditorPlugin(cubos::engine::Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__tesseratos-world-inspector-plugin.html b/docs-preview/pr-862/group__tesseratos-world-inspector-plugin.html index d7e148d40..75c01a305 100644 --- a/docs-preview/pr-862/group__tesseratos-world-inspector-plugin.html +++ b/docs-preview/pr-862/group__tesseratos-world-inspector-plugin.html @@ -74,7 +74,7 @@

    Files

    Functions

    - void worldInspectorPlugin(cubos::engine::Cubos& cubos) + void worldInspectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -83,7 +83,7 @@

    Functions

    Function documentation

    - void worldInspectorPlugin(cubos::engine::Cubos& cubos) + void worldInspectorPlugin(cubos::engine::Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/group__tesseratos.html b/docs-preview/pr-862/group__tesseratos.html index 0d6253a7a..81d29d64c 100644 --- a/docs-preview/pr-862/group__tesseratos.html +++ b/docs-preview/pr-862/group__tesseratos.html @@ -100,7 +100,7 @@

    Files

    Functions

    - void plugin(cubos::engine::Cubos& cubos) + void plugin(cubos::engine::Cubos& cubos)
    Tesseratos entry function.
    @@ -109,7 +109,7 @@

    Functions

    Function documentation

    - void plugin(cubos::engine::Cubos& cubos) + void plugin(cubos::engine::Cubos& cubos)

    Tesseratos entry function.

    diff --git a/docs-preview/pr-862/group__window-plugin.html b/docs-preview/pr-862/group__window-plugin.html index 36013fcb1..9df7a078f 100644 --- a/docs-preview/pr-862/group__window-plugin.html +++ b/docs-preview/pr-862/group__window-plugin.html @@ -67,7 +67,7 @@

    Contents

    -

    Initially sets ShouldQuit to false, and sets it to true only when the window is closed.

    Settings

    • window.title - the window's title (default: CUBOS.).
    • window.width - the window's width (default: 800).
    • window.height - the window's height (default: 600).

    Events

    Resources

    Startup tags

    • cubos.window.init - window is opened, runs after cubos.settings.

    Tags

    • cubos.window.poll - the window is polled for events, sending core::io::WindowEvent's.
    • cubos.window.render - the window's back buffers are swapped.

    Dependencies

    +

    Initially sets ShouldQuit to false, and sets it to true only when the window is closed.

    Settings

    • window.title - the window's title (default: CUBOS.).
    • window.width - the window's width (default: 800).
    • window.height - the window's height (default: 600).

    Events

    Resources

    Startup tags

    • cubos.window.init - window is opened, runs after cubos.settings.

    Tags

    • cubos.window.poll - the window is polled for events, sending core::io::WindowEvent's.
    • cubos.window.render - the window's back buffers are swapped.

    Dependencies

    Files

    diff --git a/docs-preview/pr-862/id_8hpp.html b/docs-preview/pr-862/id_8hpp.html new file mode 100644 index 000000000..915415e90 --- /dev/null +++ b/docs-preview/pr-862/id_8hpp.html @@ -0,0 +1,140 @@ + + + + + core/ecs/table/sparse_relation/id.hpp file | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + core/ecs/table/sparse_relation/id.hpp file +

    +

    Struct cubos::core::ecs::SparseRelationTableId.

    + +
    +

    Namespaces

    +
    +
    namespace cubos
    +
    CUBOS. libraries namespace.
    +
    namespace cubos::core
    +
    Core namespace.
    +
    namespace cubos::core::reflection
    +
    Reflection module.
    +
    namespace cubos::core::ecs
    +
    ECS module.
    +
    +
    +
    +

    Classes

    +
    +
    + struct cubos::core::ecs::SparseRelationTableId +
    +
    Identifies a sparse relation table.
    +
    + struct cubos::core::ecs::SparseRelationTableIdHash +
    +
    Hash functor for SparseRelationTableId.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/modules.html b/docs-preview/pr-862/modules.html index 9d64f0b0f..e98eb8327 100644 --- a/docs-preview/pr-862/modules.html +++ b/docs-preview/pr-862/modules.html @@ -64,9 +64,10 @@

    Modules

    • module Component Component part of the ECS.
    • module Entity Entity part of the ECS.
    • -
    • module Relation Relation part of the ECS.
    • +
    • module Query Defines the query functionality of the ECS.
    • module Resource Resource part of the ECS.
    • module System System part of the ECS.
    • +
    • module Table Contains various table-like data structures which storage data associated to entities.
  • module Geometry Provides geometry utilities.
  • @@ -92,7 +93,7 @@

    Modules

  • module Renderer Creates and handles the lifecycle of a renderer.
  • module Scene Adds scenes to CUBOS.
  • -
  • module ScreenPicker Used to select entities and gizmos by clicking them.
  • +
  • module ScreenPicker Used to select entities and gizmos by clicking them.
  • module Settings Adds and manages settings.
  • module Splitscreen Adds viewport to all active cameras to achieve a splitscreen layout.
  • module Transform Adds transform components which assign positions, rotations and scaling to entities.
  • diff --git a/docs-preview/pr-862/namespacecubos_1_1core_1_1ecs.html b/docs-preview/pr-862/namespacecubos_1_1core_1_1ecs.html index c14c28d3d..e05b34116 100644 --- a/docs-preview/pr-862/namespacecubos_1_1core_1_1ecs.html +++ b/docs-preview/pr-862/namespacecubos_1_1core_1_1ecs.html @@ -57,6 +57,7 @@

    Contents

    @@ -74,20 +75,55 @@

    Classes

    class Blueprint
    -
    Collection of entities and their respective components.
    +
    Collection of entities and their respective components and relations.
    - class ComponentManager + class CommandBuffer
    -
    Holds and manages components.
    +
    Stores commands to execute them later.
    -
    template<typename T>
    - class ComponentTypeBuilder + class ComponentManager
    -
    Builder for reflection::Type objects which represent component types.
    +
    Holds and manages components.
    class Storage
    Stores the components of a given type.
    +
    + struct DeltaTime +
    +
    Resource which stores the time since the last iteration of the main loop started.
    +
    + struct ShouldQuit +
    +
    Resource used as a flag to indicate whether the main loop should stop running.
    +
    + struct Arguments +
    +
    Resource which stores the command-line arguments.
    +
    + class TagBuilder +
    +
    Used to chain configurations related to tags.
    +
    + class SystemBuilder +
    +
    Used to chain configurations related to systems.
    +
    + class Cubos +
    +
    Represents the engine itself, and exposes the interface with which the game developer interacts with. Ties up all the different parts of the engine together.
    +
    + class ArchetypeGraph +
    +
    Stores which column types each archetype holds and the edges which connect them.
    +
    + struct ArchetypeId +
    +
    Identifies an archetype.
    +
    + struct ArchetypeIdHash +
    +
    Hash functor for ArchetypeId.
    struct Entity
    @@ -101,64 +137,67 @@

    Classes

    Internal type which holds and manages entities and their component masks.
    -
    template<typename T>
    - class RelationTypeBuilder + class EntityPool
    -
    Builder for reflection::Type objects which represent relation types.
    +
    Manages the creation and destruction of entity identifiers, as well as storing their archetype identifiers.
    - class RelationTable + struct QueryAccess
    -
    A table which stores relations. Allows for quick insertion, deletion and iteration.
    +
    Describes the types of data a query accesses.
    -
    template<typename T>
    - class ReadResource +
    template<typename... Ts>
    + class QueryData
    -
    Utility struct used to reference a resource of type T for reading.
    +
    Holds the data necessary to execute a query.
    template<typename T>
    - class WriteResource + class QueryFetcher
    -
    Utility struct used to reference a resource of type T for writing.
    +
    Type meant to be specialized which implements for each argument type the necessary logic to extract it from the tables.
    - class ResourceManager + class QueryFilter
    -
    Holds and manages resources.
    +
    Used to find matches for the given query terms. Essentially contains the non-templated part of the query logic.
    template<typename T>
    - class Read + class Opt
    -
    System argument which provides read access to the resource T, or query argument which provides read access to the component T.
    +
    Wrapper for reference types to indicate that the given argument type is optional in a query.
    -
    template<typename T>
    - class Write + struct QueryTerm +
    +
    Describes a term in a query.
    +
    + struct SymmetricTrait +
    +
    Trait used to identify symmetric relations.
    +
    + struct TreeTrait
    -
    System argument which provides write access to the resource T, or query argument which provides write access to the component T.
    +
    Trait used to identify tree relations.
    template<typename T>
    - class OptRead + class TypeBuilder
    -
    System argument which provides read access to the resource T if it exists, or query argument which provides read access to the component T if it exists.
    +
    Builder for reflection::Type objects which represent ECS types.
    template<typename T>
    - class OptWrite + class ReadResource
    -
    System argument which provides write access to the resource T if it exists, or query argument which provides write access to the component T if it exists.
    +
    Utility struct used to reference a resource of type T for reading.
    - class EntityBuilder +
    template<typename T>
    + class WriteResource
    -
    Allows editing an entity created by a Commands object.
    +
    Utility struct used to reference a resource of type T for writing.
    - class BlueprintBuilder + class ResourceManager
    -
    Used to edit a blueprint spawned by a Commands object.
    +
    Holds and manages resources.
    class Commands
    System argument used to write ECS commands and execute them at a later time.
    -
    - class CommandBuffer -
    -
    Stores commands to execute them later.
    class Dispatcher
    @@ -179,11 +218,7 @@

    Classes

    System argument which allows the system to send events of type T to other systems.
    - struct QueryInfo -
    -
    Describes a query.
    -
    -
    template<typename... ComponentTypes>
    +
    template<typename... Ts>
    class Query
    System argument which holds the result of a query over all entities in world which match the given arguments.
    @@ -201,12 +236,100 @@

    Classes

    class SystemWrapper
    Wrapper for a system of type F.
    +
    + struct ColumnId +
    +
    Identifies a data column type.
    +
    + class DenseTableRegistry +
    +
    Stores the dense tables of a given world.
    +
    + class DenseTable +
    +
    Stores the dense data associated to entities of a given archetype.
    +
    + struct SparseRelationTableId +
    +
    Identifies a sparse relation table.
    +
    + struct SparseRelationTableIdHash +
    +
    Hash functor for SparseRelationTableId.
    +
    + class SparseRelationTableRegistry +
    +
    Stores all of the sparse relation tables.
    +
    + class SparseRelationTable +
    +
    A table which stores relations. Allows for quick insertion, deletion and iteration.
    +
    + class Tables +
    +
    Stores the tables of a given world.
    +
    + struct DataTypeId +
    +
    Identifies a data type registered in the world.
    +
    + struct DataTypeIdHash +
    +
    Hash functor for DataTypeId.
    +
    + class Types +
    +
    Registry of all data types used in an ECS world.
    class World
    Holds entities, their components and resources.
    +
    +

    Enums

    +
    +
    + enum class Traversal { Random, + Down, + Up } +
    +
    Possible traversal types for tree relation terms.
    +
    +
    +
    +

    Enum documentation

    +
    +

    + enum class cubos::core::ecs::Traversal + +

    +

    Possible traversal types for tree relation terms.

    +
    + + + + + + + + + + + + + + + +
    Enumerators
    Random +

    Default traversal order. No specific ordering is required.

    +
    Down +

    Starts in the topmost entity and traverses down the relation.

    +
    Up +

    Starts in the bottommost entity and traverses up the relation.

    +
    +
    +
    diff --git a/docs-preview/pr-862/namespacecubos_1_1core_1_1ecs_1_1impl.html b/docs-preview/pr-862/namespacecubos_1_1core_1_1ecs_1_1impl.html index 4df0aca2a..a090f6046 100644 --- a/docs-preview/pr-862/namespacecubos_1_1core_1_1ecs_1_1impl.html +++ b/docs-preview/pr-862/namespacecubos_1_1core_1_1ecs_1_1impl.html @@ -64,11 +64,6 @@

    Contents

    Classes

    -
    -
    template<typename T>
    - struct QueryFetcher -
    -
    Fetches the requested data from a world.
    template<typename T>
    struct SystemFetcher diff --git a/docs-preview/pr-862/namespacecubos_1_1engine.html b/docs-preview/pr-862/namespacecubos_1_1engine.html index 27184386f..23a89f52d 100644 --- a/docs-preview/pr-862/namespacecubos_1_1engine.html +++ b/docs-preview/pr-862/namespacecubos_1_1engine.html @@ -111,9 +111,9 @@

    Classes

    Stores metadata about an asset - the data stored in .meta files. Each asset has a corresponding meta object, which contains load or import parameters.
    - struct BroadPhaseCandidates + struct PotentiallyCollidingWith
    -
    Resource which stores candidates found in broad phase collision detection.
    +
    Component which represents a potential collisions.
    struct Collider
    @@ -130,30 +130,6 @@

    Classes

    struct CapsuleCollisionShape
    Component which adds a capsule collision shape to an entity, used with a Collider component.
    -
    - struct DeltaTime -
    -
    Resource which stores the time since the last iteration of the main loop started.
    -
    - struct ShouldQuit -
    -
    Resource used as a flag to indicate whether the main loop should stop running.
    -
    - struct Arguments -
    -
    Resource which stores the command-line arguments.
    -
    - class TagBuilder -
    -
    Used to chain configurations related to tags.
    -
    - class SystemBuilder -
    -
    Used to chain configurations related to systems.
    -
    - class Cubos -
    -
    Represents the engine itself, and exposes the interface with which the game developer interacts with. Ties up all the different parts of the engine together.
    class Gizmos
    @@ -201,15 +177,15 @@

    Classes

    struct FixedDeltaTime
    -
    Resouce which holds the value of the fixed delta for the physics update.
    +
    Resource which holds the value of the fixed delta for the physics update.
    struct Gravity
    -
    Resouce which holds the global value of gravity.
    +
    Resource which holds the global value of gravity.
    struct Substeps
    -
    Resouce which holds the amount of substeps for the physics update.
    +
    Resource which holds the amount of substeps for the physics update.
    struct Camera
    @@ -360,6 +336,22 @@

    Typedefs

    using AssetWrite = core::memory::WriteGuard<T, std::unique_lock<std::shared_mutex>>
    Read-write guard for an asset's data.
    +
    + using Cubos = core::ecs::Cubos +
    +
    Represents the engine itself, and exposes the interface with which the game developer interacts with. Ties up all the different parts of the engine together.
    +
    + using DeltaTime = core::ecs::DeltaTime +
    +
    Resource which stores the time since the last iteration of the main loop started.
    +
    + using ShouldQuit = core::ecs::ShouldQuit +
    +
    Resource used as a flag to indicate whether the main loop should stop running.
    +
    + using Arguments = core::ecs::Arguments +
    +
    Resource which stores the command-line arguments.
    template<typename... ComponentTypes>
    using Query = core::ecs::Query<ComponentTypes...> @@ -375,24 +367,9 @@

    Typedefs

    System argument used to write ECS commands and execute them at a later time.
    template<typename T>
    - using Read = core::ecs::Read<T> -
    -
    System argument which provides read access to the resource T, or query argument which provides read access to the component T.
    -
    -
    template<typename T>
    - using Write = core::ecs::Write<T> -
    -
    System argument which provides write access to the resource T, or query argument which provides write access to the component T.
    -
    -
    template<typename T>
    - using OptRead = core::ecs::OptRead<T> + using Opt = core::ecs::Opt<T>
    -
    System argument which provides read access to the resource T if it exists, or query argument which provides read access to the component T if it exists.
    -
    -
    template<typename T>
    - using OptWrite = core::ecs::OptWrite<T> -
    -
    System argument which provides write access to the resource T if it exists, or query argument which provides write access to the component T if it exists.
    +
    Wrapper for reference types to indicate that the given argument type is optional in a query.
    template<typename T, unsigned int M = DEFAULT_FILTER_MASK>
    using EventReader = core::ecs::EventReader<T, M> @@ -417,35 +394,35 @@

    Typedefs

    Functions

    - void assetsPlugin(Cubos& cubos) + void assetsPlugin(Cubos& cubos)
    Plugin entry function.
    - void collisionsPlugin(Cubos& cubos) + void collisionsPlugin(Cubos& cubos)
    Plugin entry function.
    - void gizmosPlugin(Cubos& cubos) + void gizmosPlugin(Cubos& cubos)
    Plugin entry function.
    - void imguiPlugin(Cubos& cubos) + void imguiPlugin(Cubos& cubos)
    Plugin entry function.
    - void inputPlugin(Cubos& cubos) + void inputPlugin(Cubos& cubos)
    Plugin entry function.
    - void physicsPlugin(Cubos& cubos) + void physicsPlugin(Cubos& cubos)
    Plugin entry function.
    - void gravityPlugin(Cubos& cubos) + void gravityPlugin(Cubos& cubos)
    Plugin entry function.
    - void rendererPlugin(Cubos& cubos) + void rendererPlugin(Cubos& cubos)
    Plugin entry function.
    @@ -455,41 +432,62 @@

    Functions

    Triangulates a grid of voxels into an indexed mesh.
    - void scenePlugin(Cubos& cubos) + void scenePlugin(Cubos& cubos)
    Plugin entry function.
    - void screenPickerPlugin(Cubos& cubos) + void screenPickerPlugin(Cubos& cubos)
    Plugin entry function.
    - void settingsPlugin(Cubos& cubos) + void settingsPlugin(Cubos& cubos)
    Plugin entry function.
    - void splitscreenPlugin(Cubos& cubos) + void splitscreenPlugin(Cubos& cubos)
    Plugin entry function.
    - void transformPlugin(Cubos& cubos) + void transformPlugin(Cubos& cubos)
    Plugin entry function.
    - void freeCameraControllerPlugin(Cubos& cubos) + void freeCameraControllerPlugin(Cubos& cubos)
    Plugin entry function.
    - void voxelsPlugin(Cubos& cubos) + void voxelsPlugin(Cubos& cubos)
    Plugin entry function.
    - void windowPlugin(Cubos& cubos) + void windowPlugin(Cubos& cubos)
    Plugin entry function.

    Typedef documentation

    +
    +

    + using cubos::engine::DeltaTime = core::ecs::DeltaTime +

    +

    Resource which stores the time since the last iteration of the main loop started.

    +

    This resource is added and updated by the Cubos class.

    +
    +
    +

    + using cubos::engine::ShouldQuit = core::ecs::ShouldQuit +

    +

    Resource used as a flag to indicate whether the main loop should stop running.

    +

    This resource is added by the Cubos class, initially set to true.

    +
    +
    +

    + using cubos::engine::Arguments = core::ecs::Arguments +

    +

    Resource which stores the command-line arguments.

    +

    This resource is added by the Cubos class.

    +

    @@ -498,18 +496,7 @@

    using cubos::engine::Query = core::ecs::Query<ComponentTypes...>

    System argument which holds the result of a query over all entities in world which match the given arguments.

    - - - - - - - - - - -
    Template parameters
    ComponentTypesComponent accessor types to be queried.
    -

    An example of a valid query is:

    Query<Write<Position>, Read<Velocity>, OptWrite<Rotation>, OptRead<Scale>>

    This query will return all entities with a Position and Velocity component. Accessors to Rotation and Scale components are also passed but may be null if the component is not present in the entity. Whenever mutability is not needed, Read/OptRead should be used.

    +

    An example of a valid query is:

    Query<Position&, const Velocity&, Opt<Rotation&>, Opt<const Scale&>>

    This query will return all entities with a Position and Velocity component. Accessors to Rotation and Scale components are also passed but may be null if the component is not present in the entity. Whenever mutability is not needed, const should be used.

    @@ -525,77 +512,14 @@

    System argument used to write ECS commands and execute them at a later time.

    Internally wraps a reference to a CommandBuffer object.

    -
    -

    -
    - template<typename T> -
    - using cubos::engine::Read = core::ecs::Read<T> -

    -

    System argument which provides read access to the resource T, or query argument which provides read access to the component T.

    - - - - - - - - - - -
    Template parameters
    TResource or component type.
    -

    Can be used as a pointer with both the -> and * operators.

    -
    -
    -

    -
    - template<typename T> -
    - using cubos::engine::Write = core::ecs::Write<T> -

    -

    System argument which provides write access to the resource T, or query argument which provides write access to the component T.

    - - - - - - - - - - -
    Template parameters
    TResource or component type.
    -

    Can be used as a pointer with both the -> and * operators.

    -
    -
    -

    -
    - template<typename T> -
    - using cubos::engine::OptRead = core::ecs::OptRead<T> -

    -

    System argument which provides read access to the resource T if it exists, or query argument which provides read access to the component T if it exists.

    - - - - - - - - - - -
    Template parameters
    TResource or component type.
    -

    While the Read demands that the resource or component exists, this argument does not. Can be used as a pointer with both the -> and * operators.

    -
    -
    +

    template<typename T>
    - using cubos::engine::OptWrite = core::ecs::OptWrite<T> + using cubos::engine::Opt = core::ecs::Opt<T>

    -

    System argument which provides write access to the resource T if it exists, or query argument which provides write access to the component T if it exists.

    +

    Wrapper for reference types to indicate that the given argument type is optional in a query.

    @@ -603,11 +527,10 @@

    - +
    Template parameters
    TResource or component type.Argument type.
    -

    While the Write demands that the resource or component exists, this argument does not. Can be used as a pointer with both the -> and * operators.

    @@ -660,7 +583,7 @@

    Function documentation

    - void cubos::engine::freeCameraControllerPlugin(Cubos& cubos) + void cubos::engine::freeCameraControllerPlugin(Cubos& cubos)

    Plugin entry function.

    diff --git a/docs-preview/pr-862/namespacetesseratos.html b/docs-preview/pr-862/namespacetesseratos.html index 4ac55c94e..4bb8f6d33 100644 --- a/docs-preview/pr-862/namespacetesseratos.html +++ b/docs-preview/pr-862/namespacetesseratos.html @@ -82,7 +82,7 @@

    Classes

    Functions

    - void assetExplorerPlugin(cubos::engine::Cubos& cubos) + void assetExplorerPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    @@ -100,47 +100,47 @@

    Functions

    Displays a modal popup to select an asset of a specified type.
    - void debugCameraPlugin(cubos::engine::Cubos& cubos) + void debugCameraPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    - void entityInspectorPlugin(cubos::engine::Cubos& cubos) + void entityInspectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    - void entitySelectorPlugin(cubos::engine::Cubos& cubos) + void entitySelectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    - void metricsPanelPlugin(cubos::engine::Cubos& cubos) + void metricsPanelPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    - void plugin(cubos::engine::Cubos& cubos) + void plugin(cubos::engine::Cubos& cubos)
    Tesseratos entry function.
    - void sceneEditorPlugin(cubos::engine::Cubos& cubos) + void sceneEditorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    - void settingsInspectorPlugin(cubos::engine::Cubos& cubos) + void settingsInspectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    - void toolboxPlugin(cubos::engine::Cubos& cubos) + void toolboxPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    - void transformGizmoPlugin(cubos::engine::Cubos& cubos) + void transformGizmoPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    - void voxelPaletteEditorPlugin(cubos::engine::Cubos& cubos) + void voxelPaletteEditorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    - void worldInspectorPlugin(cubos::engine::Cubos& cubos) + void worldInspectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/component_2reflection_8hpp.html b/docs-preview/pr-862/opt_8hpp.html similarity index 90% rename from docs-preview/pr-862/component_2reflection_8hpp.html rename to docs-preview/pr-862/opt_8hpp.html index 26e696e74..141de86a8 100644 --- a/docs-preview/pr-862/component_2reflection_8hpp.html +++ b/docs-preview/pr-862/opt_8hpp.html @@ -2,7 +2,7 @@ - core/ecs/component/reflection.hpp file | CUBOS. Docs + core/ecs/query/opt.hpp file | CUBOS. Docs @@ -46,9 +46,9 @@

    - core/ecs/component/reflection.hpp file + core/ecs/query/opt.hpp file

    -

    Class cubos::core::ecs::ComponentTypeBuilder.

    +

    Class cubos::core::ecs::Opt.

    diff --git a/docs-preview/pr-862/pages.html b/docs-preview/pr-862/pages.html index 85fc01d30..d9c5c6045 100644 --- a/docs-preview/pr-862/pages.html +++ b/docs-preview/pr-862/pages.html @@ -97,7 +97,7 @@

    Pages

  • Engine Showcases features of the Engine library.
      -
    • Hello CUBOS. Using Cubos to create a simple program.
    • +
    • Hello CUBOS. Using Cubos to create a simple program.
    • Settings Using the Settings plugin.
    • Renderer Using the Renderer plugin.
    • Gizmos Using the Gizmos plugin.
    • diff --git a/docs-preview/pr-862/pool_8hpp.html b/docs-preview/pr-862/pool_8hpp.html new file mode 100644 index 000000000..676dbb935 --- /dev/null +++ b/docs-preview/pr-862/pool_8hpp.html @@ -0,0 +1,134 @@ + + + + + core/ecs/entity/pool.hpp file | CUBOS. Docs + + + + + + + +
      +
      + + + +
      + + diff --git a/docs-preview/pr-862/candidates_8hpp.html b/docs-preview/pr-862/potentially__colliding__with_8hpp.html similarity index 89% rename from docs-preview/pr-862/candidates_8hpp.html rename to docs-preview/pr-862/potentially__colliding__with_8hpp.html index 3d7ea2337..375b69770 100644 --- a/docs-preview/pr-862/candidates_8hpp.html +++ b/docs-preview/pr-862/potentially__colliding__with_8hpp.html @@ -2,7 +2,7 @@ - engine/collisions/broad_phase/candidates.hpp file | CUBOS. Docs + engine/collisions/broad_phase/potentially_colliding_with.hpp file | CUBOS. Docs @@ -46,9 +46,9 @@

      - engine/collisions/broad_phase/candidates.hpp file + engine/collisions/broad_phase/potentially_colliding_with.hpp file

      -

      Resource cubos::engine::Candidates.

      +

      Component cubos::engine::PotentiallyCollidingWith.

  • diff --git a/docs-preview/pr-862/query_8hpp.html b/docs-preview/pr-862/query_8hpp.html index a2cde2cb2..a6eaa04e8 100644 --- a/docs-preview/pr-862/query_8hpp.html +++ b/docs-preview/pr-862/query_8hpp.html @@ -48,7 +48,7 @@

    core/ecs/system/query.hpp file

    -

    Class cubos::core::ecs::Query and related types.

    +

    Class cubos::core::ecs::Query.

    -

    This file is a bit scary, but it's not as bad as it looks. It's mostly template specializations to handle the different types of arguments a query can take.

    Namespaces

    @@ -71,31 +70,16 @@

    Namespaces

    Core namespace.
    namespace cubos::core::ecs
    ECS module.
    -
    namespace cubos::core::ecs::impl
    -
    Contains functions used internally by the implementation of the ECS.

    Classes

    - struct cubos::core::ecs::QueryInfo -
    -
    Describes a query.
    -
    -
    template<typename T>
    - struct cubos::core::ecs::impl::QueryFetcher -
    -
    Fetches the requested data from a world.
    -
    -
    template<typename... ComponentTypes>
    +
    template<typename... Ts>
    class cubos::core::ecs::Query
    System argument which holds the result of a query over all entities in world which match the given arguments.
    -
    - class cubos::core::ecs::Query::Iterator -
    -
    Used to iterate over the results of a query.
    diff --git a/docs-preview/pr-862/table_8hpp.html b/docs-preview/pr-862/reflection_8hpp.html similarity index 83% rename from docs-preview/pr-862/table_8hpp.html rename to docs-preview/pr-862/reflection_8hpp.html index e264a88ec..69f9b98cf 100644 --- a/docs-preview/pr-862/table_8hpp.html +++ b/docs-preview/pr-862/reflection_8hpp.html @@ -2,7 +2,7 @@ - core/ecs/relation/table.hpp file | CUBOS. Docs + core/ecs/reflection.hpp file | CUBOS. Docs @@ -46,9 +46,9 @@

    - core/ecs/relation/table.hpp file + core/ecs/reflection.hpp file

    -

    Class cubos::core::ecs::RelationTable.

    +

    Class cubos::core::ecs::TypeBuilder.

    diff --git a/docs-preview/pr-862/resources_2gravity_8hpp.html b/docs-preview/pr-862/resources_2gravity_8hpp.html index 9cc2aaf2c..274f141c9 100644 --- a/docs-preview/pr-862/resources_2gravity_8hpp.html +++ b/docs-preview/pr-862/resources_2gravity_8hpp.html @@ -76,7 +76,7 @@

    Classes

    struct cubos::engine::Gravity
    -
    Resouce which holds the global value of gravity.
    +
    Resource which holds the global value of gravity.
    diff --git a/docs-preview/pr-862/screenpicker_8hpp.html b/docs-preview/pr-862/screen__picker_8hpp.html similarity index 96% rename from docs-preview/pr-862/screenpicker_8hpp.html rename to docs-preview/pr-862/screen__picker_8hpp.html index 67a19b0c1..0df955ddb 100644 --- a/docs-preview/pr-862/screenpicker_8hpp.html +++ b/docs-preview/pr-862/screen__picker_8hpp.html @@ -2,7 +2,7 @@ - engine/screenpicker/screenpicker.hpp file | CUBOS. Docs + engine/screen_picker/screen_picker.hpp file | CUBOS. Docs @@ -46,7 +46,7 @@

    - engine/screenpicker/screenpicker.hpp file + engine/screen_picker/screen_picker.hpp file

    Resource cubos::engine::ScreenPicker.

    diff --git a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ArchetypeId.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ArchetypeId.html new file mode 100644 index 000000000..77b9b6832 --- /dev/null +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ArchetypeId.html @@ -0,0 +1,173 @@ + + + + + cubos::core::ecs::ArchetypeId struct | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + cubos::core::ecs::ArchetypeId struct + +

    +

    Identifies an archetype.

    + +
    +

    Public static variables

    +
    +
    + static const ArchetypeId Empty +
    +
    Empty archetype identifier.
    +
    + static const ArchetypeId Invalid +
    +
    Invalid archetype identifier.
    +
    +
    +
    +

    Public functions

    +
    +
    + auto operator==(const ArchetypeId& other) const -> bool defaulted +
    +
    Compares two archetype identifiers for equality.
    +
    +
    +
    +

    Public variables

    +
    +
    + std::size_t inner +
    +
    Archetype identifier.
    +
    +
    +
    +

    Function documentation

    +
    +

    + bool cubos::core::ecs::ArchetypeId::operator==(const ArchetypeId& other) const defaulted +

    +

    Compares two archetype identifiers for equality.

    + + + + + + + + + + + + + + + + +
    Parameters
    otherOther archetype identifier.
    ReturnsWhether the two archetype identifiers are equal.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/structcubos_1_1engine_1_1BroadPhaseCandidates_1_1CandidateHash.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ArchetypeIdHash.html similarity index 90% rename from docs-preview/pr-862/structcubos_1_1engine_1_1BroadPhaseCandidates_1_1CandidateHash.html rename to docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ArchetypeIdHash.html index 44a085e57..e7103cdc1 100644 --- a/docs-preview/pr-862/structcubos_1_1engine_1_1BroadPhaseCandidates_1_1CandidateHash.html +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ArchetypeIdHash.html @@ -2,7 +2,7 @@ - cubos::engine::BroadPhaseCandidates::CandidateHash struct | CUBOS. Docs + cubos::core::ecs::ArchetypeIdHash struct | CUBOS. Docs @@ -46,10 +46,10 @@

    - cubos::engine::BroadPhaseCandidates::CandidateHash struct - + cubos::core::ecs::ArchetypeIdHash struct +

    -

    Hash function to allow Candidates to be used as keys in an unordered_set.

    +

    Hash functor for ArchetypeId.

    diff --git a/docs-preview/pr-862/structcubos_1_1engine_1_1Arguments.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1Arguments.html similarity index 90% rename from docs-preview/pr-862/structcubos_1_1engine_1_1Arguments.html rename to docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1Arguments.html index 3f58b1f7f..ce25aca11 100644 --- a/docs-preview/pr-862/structcubos_1_1engine_1_1Arguments.html +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1Arguments.html @@ -2,7 +2,7 @@ - cubos::engine::Arguments struct | CUBOS. Docs + cubos::core::ecs::Arguments struct | CUBOS. Docs @@ -46,8 +46,8 @@

    - cubos::engine::Arguments struct - + cubos::core::ecs::Arguments struct +

    Resource which stores the command-line arguments.

    -

    This resource is added by the Cubos class.

    +

    This resource is added by the Cubos class.

    Public variables

    -
    - const std::vector<std::string> value +
    + const std::vector<std::string> value
    Command-line arguments.
    diff --git a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ColumnId.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ColumnId.html new file mode 100644 index 000000000..108f602e8 --- /dev/null +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ColumnId.html @@ -0,0 +1,271 @@ + + + + + cubos::core::ecs::ColumnId struct | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + cubos::core::ecs::ColumnId struct + +

    +

    Identifies a data column type.

    + +
    +

    Public static variables

    +
    +
    + static const ColumnId Invalid +
    +
    Invalid column type identifier.
    +
    +
    +
    +

    Public static functions

    +
    +
    + static auto make(DataTypeId id) -> ColumnId +
    +
    Creates a column type identifier from a data type identifier.
    +
    + static auto make(DataTypeId id, + uint32_t index) -> ColumnId +
    +
    Creates a column type identifier from a data type identifier and an index.
    +
    +
    +
    +

    Public functions

    +
    +
    + auto dataType() const -> DataTypeId +
    +
    Returns the data type identifier of this column type.
    +
    + auto index() const -> uint32_t +
    +
    Returns the index of this column type.
    +
    + auto operator==(const ColumnId& other) const -> bool defaulted +
    +
    Compares two column type identifiers for equality.
    +
    +
    +
    +

    Public variables

    +
    +
    + uint64_t inner +
    +
    Column type identifier.
    +
    +
    +
    +

    Function documentation

    +
    +

    + static ColumnId cubos::core::ecs::ColumnId::make(DataTypeId id) +

    +

    Creates a column type identifier from a data type identifier.

    + + + + + + + + + + + + + + + + +
    Parameters
    idData type identifier.
    ReturnsColumn type identifier.
    +
    +
    +

    + static ColumnId cubos::core::ecs::ColumnId::make(DataTypeId id, + uint32_t index) +

    +

    Creates a column type identifier from a data type identifier and an index.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    idData type identifier.
    indexIndex.
    ReturnsColumn type identifier.
    +
    +
    +

    + DataTypeId cubos::core::ecs::ColumnId::dataType() const +

    +

    Returns the data type identifier of this column type.

    + + + + + + + +
    ReturnsData type identifier.
    +
    +
    +

    + uint32_t cubos::core::ecs::ColumnId::index() const +

    +

    Returns the index of this column type.

    + + + + + + + +
    ReturnsIndex.
    +
    +
    +

    + bool cubos::core::ecs::ColumnId::operator==(const ColumnId& other) const defaulted +

    +

    Compares two column type identifiers for equality.

    + + + + + + + + + + + + + + + + +
    Parameters
    otherOther column type identifier.
    ReturnsWhether the two column type identifiers are equal.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Query_1_1Iterator.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1DataTypeId.html similarity index 69% rename from docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Query_1_1Iterator.html rename to docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1DataTypeId.html index 967ab91aa..dd24e61a1 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Query_1_1Iterator.html +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1DataTypeId.html @@ -2,7 +2,7 @@ - cubos::core::ecs::Query::Iterator class | CUBOS. Docs + cubos::core::ecs::DataTypeId struct | CUBOS. Docs @@ -46,42 +46,71 @@

    - cubos::core::ecs::Query::Iterator class - + cubos::core::ecs::DataTypeId struct +

    -

    Used to iterate over the results of a query.

    +

    Identifies a data type registered in the world.

    +
    +

    Public static variables

    +
    +
    + static const DataTypeId Invalid +
    +
    Invalid data type identifier.
    +
    +

    Public functions

    - auto operator*() const -> std::tuple<Entity, ComponentTypes...> + auto operator==(const DataTypeId& other) const -> bool defaulted +
    +
    Compares two data type identifiers for equality.
    +
    +
    +
    +

    Public variables

    +
    +
    + uint32_t inner
    -
    Dereferences to a tuple containing the queried entity and its components.
    +
    Data type identifier.

    Function documentation

    -
    +

    - std::tuple<Entity, ComponentTypes...> cubos::core::ecs::Query::Iterator::operator*() const + bool cubos::core::ecs::DataTypeId::operator==(const DataTypeId& other) const defaulted

    -

    Dereferences to a tuple containing the queried entity and its components.

    +

    Compares two data type identifiers for equality.

    + + + + + + + + + - - + +
    Parameters
    otherOther data type identifier.
    ReturnsTuple containing the entity and its components.ReturnsWhether the two data type identifiers are equal.
    diff --git a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1DataTypeIdHash.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1DataTypeIdHash.html new file mode 100644 index 000000000..1bdb40c2a --- /dev/null +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1DataTypeIdHash.html @@ -0,0 +1,103 @@ + + + + + cubos::core::ecs::DataTypeIdHash struct | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/structcubos_1_1engine_1_1DeltaTime.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1DeltaTime.html similarity index 92% rename from docs-preview/pr-862/structcubos_1_1engine_1_1DeltaTime.html rename to docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1DeltaTime.html index 6d9bd3be1..150c2d6ee 100644 --- a/docs-preview/pr-862/structcubos_1_1engine_1_1DeltaTime.html +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1DeltaTime.html @@ -2,7 +2,7 @@ - cubos::engine::DeltaTime struct | CUBOS. Docs + cubos::core::ecs::DeltaTime struct | CUBOS. Docs @@ -46,8 +46,8 @@

    - cubos::engine::DeltaTime struct - + cubos::core::ecs::DeltaTime struct +

    Resource which stores the time since the last iteration of the main loop started.

    -

    This resource is added and updated by the Cubos class.

    +

    This resource is added and updated by the Cubos class.

    Public variables

    -
    - float value +
    + float value
    Time in seconds.
    diff --git a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryAccess.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryAccess.html new file mode 100644 index 000000000..ac4b7445e --- /dev/null +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryAccess.html @@ -0,0 +1,171 @@ + + + + + cubos::core::ecs::QueryAccess struct | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + cubos::core::ecs::QueryAccess struct + +

    +

    Describes the types of data a query accesses.

    + +

    Used to determine if systems conflict with each other.

    +
    +

    Public functions

    +
    +
    + void insert(DataTypeId id) +
    +
    Adds a type identifier to the set of types the query accesses.
    +
    + auto intersects(const QueryAccess& other) const -> bool +
    +
    Checks if this access patterns intersect with the given ones.
    +
    +
    +
    +

    Function documentation

    +
    +

    + void cubos::core::ecs::QueryAccess::insert(DataTypeId id) +

    +

    Adds a type identifier to the set of types the query accesses.

    + + + + + + + + + + +
    Parameters
    idType identifier.
    +
    +
    +

    + bool cubos::core::ecs::QueryAccess::intersects(const QueryAccess& other) const +

    +

    Checks if this access patterns intersect with the given ones.

    + + + + + + + + + + + + + + + + +
    Parameters
    otherOther query access patterns.
    ReturnsWhether they intersect.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryFilter_1_1View_1_1Iterator_1_1Match.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryFilter_1_1View_1_1Iterator_1_1Match.html new file mode 100644 index 000000000..2f0cfb3e3 --- /dev/null +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryFilter_1_1View_1_1Iterator_1_1Match.html @@ -0,0 +1,123 @@ + + + + + cubos::core::ecs::QueryFilter::View::Iterator::Match struct | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm.html new file mode 100644 index 000000000..919f54592 --- /dev/null +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm.html @@ -0,0 +1,532 @@ + + + + + cubos::core::ecs::QueryTerm struct | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + cubos::core::ecs::QueryTerm struct + +

    +

    Describes a term in a query.

    + +

    Terms are the building blocks used to build queries. Each term adds some restriction to what the query will match. There are three kinds of terms:

    • Component terms, which allow filtering match entities by those which have or don't have a given component.
    • Relation terms, which allow filtering match entities by some relation between them.
    • Entity terms, which don't filter the results but allow accessing one of the matched entities.
    +
    +

    Public types

    +
    +
    + struct Component +
    +
    Stores component term data.
    +
    + struct Entity +
    +
    Stores entity term data.
    +
    + struct Relation +
    +
    Stores relation term data.
    +
    +
    +
    +

    Public static functions

    +
    +
    + static auto makeEntity(int target) -> QueryTerm +
    +
    Returns a new entity term for the given target.
    +
    + static auto makeWithComponent(DataTypeId type, + int target) -> QueryTerm +
    +
    Returns a new component term for the given component and target.
    +
    + static auto makeWithoutComponent(DataTypeId type, + int target) -> QueryTerm +
    +
    Returns a new negated component term for the given component and target.
    +
    + static auto makeOptComponent(DataTypeId type, + int target) -> QueryTerm +
    +
    Returns a new optional component term for the given component and target.
    +
    + static auto makeRelation(DataTypeId type, + int fromTarget, + int toTarget, + Traversal traversal = Traversal::Random) -> QueryTerm +
    +
    Returns a new relation term for the given relation and targets.
    +
    + static auto resolve(const Types& types, + const std::vector<QueryTerm>& baseTerms, + std::vector<QueryTerm>& otherTerms) -> std::vector<QueryTerm> +
    +
    Merges a vector of terms with another, joining pairs of them if possible.
    +
    + static auto toString(const Types& types, + const std::vector<QueryTerm>& terms) -> std::string +
    +
    Gets a string representation of vector of query terms.
    +
    +
    +
    +

    Public functions

    +
    +
    + auto isEntity() const -> bool +
    +
    Checks if the term is an entity term.
    +
    + auto isComponent(const Types& types) const -> bool +
    +
    Checks if the term is a component term.
    +
    + auto isRelation(const Types& types) const -> bool +
    +
    Checks if the term is a relation term.
    +
    + auto compare(const Types& types, + const QueryTerm& other) const -> bool +
    +
    Compares two terms.
    +
    +
    +
    +

    Public variables

    +
    +
    + DataTypeId type +
    +
    Type of the data matched by the term.
    +
    + Entity entity +
    +
    Entity term data.
    +
    + Component component +
    +
    Component term data.
    +
    + Relation relation +
    +
    Relation term data.
    +
    +
    +
    +

    Function documentation

    +
    +

    + static QueryTerm cubos::core::ecs::QueryTerm::makeEntity(int target) +

    +

    Returns a new entity term for the given target.

    + + + + + + + + + + + + + + + + +
    Parameters
    targetIndex of the target which will be accessed.
    ReturnsEntity term.
    +
    +
    +

    + static QueryTerm cubos::core::ecs::QueryTerm::makeWithComponent(DataTypeId type, + int target) +

    +

    Returns a new component term for the given component and target.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    typeComponent type.
    targetIndex of the target which must have the component.
    ReturnsComponent term.
    + +
    +
    +

    + static QueryTerm cubos::core::ecs::QueryTerm::makeWithoutComponent(DataTypeId type, + int target) +

    +

    Returns a new negated component term for the given component and target.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    typeComponent type.
    targetIndex of the target which must not have the component.
    ReturnsComponent term.
    + +
    +
    +

    + static QueryTerm cubos::core::ecs::QueryTerm::makeOptComponent(DataTypeId type, + int target) +

    +

    Returns a new optional component term for the given component and target.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    typeComponent type.
    targetIndex of the target which may have the component.
    ReturnsComponent term.
    + +
    +
    +

    + static QueryTerm cubos::core::ecs::QueryTerm::makeRelation(DataTypeId type, + int fromTarget, + int toTarget, + Traversal traversal = Traversal::Random) +

    +

    Returns a new relation term for the given relation and targets.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Parameters
    typeRelation type.
    fromTargetIndex of the target which must have the 'from' side of the relation.
    toTargetIndex of the target which must have the 'to' side of the relation.
    traversalTraversal order for the relation.
    ReturnsRelation term.
    + +
    +
    +

    + static std::vector<QueryTerm> cubos::core::ecs::QueryTerm::resolve(const Types& types, + const std::vector<QueryTerm>& baseTerms, + std::vector<QueryTerm>& otherTerms) +

    +

    Merges a vector of terms with another, joining pairs of them if possible.

    + + + + + + + + + + + + + + + + + + + + + + + + +
    Parameters
    typesType registry.
    baseTermsBase vector of terms.
    otherTerms in/outVector of terms to merge into the base. Targets will be modified, if set to -1.
    ReturnsResult of merging the two vectors.
    +

    This function is mainly used to merge terms specified manually for a query with terms obtained from its argument types. For example, if we have a query of the form Query<A&, A&>, we will obtain the terms makeWithComponent(A, -1) and makeWithComponent(A, -1). Those term would be passed into other. If we passed to base the terms makeWithComponent(A, 0) and makeWithComponent(A, 1), then, the base wouldn't be modified, and the other vector would have its targets updated so that it matches the base.

    Any targets found set to -1 will be set to the current default target. The default target is initially 0, and always changes to the last seen non -1 target. If a relation term has one of the targets undefined, the default target is incremented.

    Another example would be to have an empty base vector, and the query Query<A&, B&>. The other vector would be {makeWithComponent(A, -1), makeWithComponent(B, -1)}, and the returned vector would be {makeWithComponent(A, 0), makeWithComponent(B, 0)}.

    +
    +
    +

    + static std::string cubos::core::ecs::QueryTerm::toString(const Types& types, + const std::vector<QueryTerm>& terms) +

    +

    Gets a string representation of vector of query terms.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    typesType registry.
    termsVector of terms.
    ReturnsString representation.
    +
    +
    +

    + bool cubos::core::ecs::QueryTerm::isEntity() const +

    +

    Checks if the term is an entity term.

    + + + + + + + +
    ReturnsWhether it's an entity term.
    +
    +
    +

    + bool cubos::core::ecs::QueryTerm::isComponent(const Types& types) const +

    +

    Checks if the term is a component term.

    + + + + + + + + + + + + + + + + +
    Parameters
    typesTypes registry.
    ReturnsWhether it's a component term.
    +
    +
    +

    + bool cubos::core::ecs::QueryTerm::isRelation(const Types& types) const +

    +

    Checks if the term is a relation term.

    + + + + + + + + + + + + + + + + +
    Parameters
    typesTypes registry.
    ReturnsWhether it's a relation term.
    +
    +
    +

    + bool cubos::core::ecs::QueryTerm::compare(const Types& types, + const QueryTerm& other) const +

    +

    Compares two terms.

    + + + + + + + + + + + + + + + + + + + + +
    Parameters
    typesTypes registry.
    otherOther term.
    ReturnsWhether they're equal.
    +
    +
    +
    +

    Variable documentation

    +
    +

    + DataTypeId cubos::core::ecs::QueryTerm::type +

    +

    Type of the data matched by the term.

    +

    If this is set to DataTypeId::Invalid, then the term is an entity term. Otherwise, the term can either be a component or relation term depending on this type.

    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Component.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Component.html new file mode 100644 index 000000000..2180b6a9d --- /dev/null +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Component.html @@ -0,0 +1,131 @@ + + + + + cubos::core::ecs::QueryTerm::Component struct | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryInfo.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Entity.html similarity index 88% rename from docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryInfo.html rename to docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Entity.html index 2aef09dab..c55301b4f 100644 --- a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryInfo.html +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Entity.html @@ -2,7 +2,7 @@ - cubos::core::ecs::QueryInfo struct | CUBOS. Docs + cubos::core::ecs::QueryTerm::Entity struct | CUBOS. Docs @@ -46,10 +46,10 @@

    - cubos::core::ecs::QueryInfo struct - + cubos::core::ecs::QueryTerm::Entity struct +

    -

    Describes a query.

    +

    Stores entity term data.

    diff --git a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Relation.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Relation.html new file mode 100644 index 000000000..5bd0ab0af --- /dev/null +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1QueryTerm_1_1Relation.html @@ -0,0 +1,131 @@ + + + + + cubos::core::ecs::QueryTerm::Relation struct | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/structcubos_1_1engine_1_1ShouldQuit.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ShouldQuit.html similarity index 91% rename from docs-preview/pr-862/structcubos_1_1engine_1_1ShouldQuit.html rename to docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ShouldQuit.html index ddc4055b9..8187adc9c 100644 --- a/docs-preview/pr-862/structcubos_1_1engine_1_1ShouldQuit.html +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1ShouldQuit.html @@ -2,7 +2,7 @@ - cubos::engine::ShouldQuit struct | CUBOS. Docs + cubos::core::ecs::ShouldQuit struct | CUBOS. Docs @@ -46,8 +46,8 @@

    - cubos::engine::ShouldQuit struct - + cubos::core::ecs::ShouldQuit struct +

    Resource used as a flag to indicate whether the main loop should stop running.

    -

    This resource is added by the Cubos class, initially set to true.

    +

    This resource is added by the Cubos class, initially set to true.

    Public variables

    -
    - bool value +
    + bool value
    Whether the main loop should stop running.
    diff --git a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Read.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1SparseRelationTableId.html similarity index 65% rename from docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Read.html rename to docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1SparseRelationTableId.html index c8c1e6bb2..409fc6b10 100644 --- a/docs-preview/pr-862/classcubos_1_1core_1_1ecs_1_1Read.html +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1SparseRelationTableId.html @@ -2,7 +2,7 @@ - cubos::core::ecs::Read class | CUBOS. Docs + cubos::core::ecs::SparseRelationTableId struct | CUBOS. Docs @@ -46,22 +46,10 @@

    - -
    template<typename T>
    - cubos::core::ecs::Read class + cubos::core::ecs::SparseRelationTableId struct +

    -

    System argument which provides read access to the resource T, or query argument which provides read access to the component T.

    - - - - - - - - - - -
    Template parameters
    TResource or component type.
    +

    Identifies a sparse relation table.

    -

    Can be used as a pointer with both the -> and * operators.

    Constructors, destructors, conversion operators

    - Read(const T& ref) + SparseRelationTableId(DataTypeId dataType, + ArchetypeId from, + ArchetypeId to, + int depth = 0)
    -
    Creates a new read argument.
    +
    Constructs.

    Public functions

    - auto operator->() const -> const T* + auto operator==(const SparseRelationTableId& other) const -> bool defaulted
    -
    Accesses the resource or component.
    -
    - auto operator*() const -> const T& -
    -
    Accesses the resource or component.
    +
    Compares with another identifier.

    Function documentation

    -
    +

    -
    - template<typename T> -
    - cubos::core::ecs::Read<T>::Read(const T& ref) + cubos::core::ecs::SparseRelationTableId::SparseRelationTableId(DataTypeId dataType, + ArchetypeId from, + ArchetypeId to, + int depth = 0)

    -

    Creates a new read argument.

    +

    Constructs.

    - - + + + + + + + + + + + + + +
    Parameters
    refReference to the resource or component.dataTypeRelation data type.
    fromFrom archetype identifier.
    toTo archetype identifier.
    depthDepth of the relation. Used in tree relations, always 0 for others.
    -
    +

    -
    - template<typename T> -
    - const T* cubos::core::ecs::Read<T>::operator->() const + bool cubos::core::ecs::SparseRelationTableId::operator==(const SparseRelationTableId& other) const defaulted

    -

    Accesses the resource or component.

    +

    Compares with another identifier.

    - + + + + - - + + - -
    Parameters
    ReturnsPointer to the resource or component.otherIdentifier.
    -
    -
    -

    -
    - template<typename T> -
    - const T& cubos::core::ecs::Read<T>::operator*() const -

    -

    Accesses the resource or component.

    - + - - + +
    ReturnsReference to the resource or component.ReturnsWhether they're equal.
    diff --git a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1SparseRelationTableIdHash.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1SparseRelationTableIdHash.html new file mode 100644 index 000000000..c603cbef0 --- /dev/null +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1SparseRelationTableIdHash.html @@ -0,0 +1,103 @@ + + + + + cubos::core::ecs::SparseRelationTableIdHash struct | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1RelationTable_1_1Iterator_1_1Output.html b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1SparseRelationTable_1_1Iterator_1_1Output.html similarity index 84% rename from docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1RelationTable_1_1Iterator_1_1Output.html rename to docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1SparseRelationTable_1_1Iterator_1_1Output.html index 020055328..8dfd2980f 100644 --- a/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1RelationTable_1_1Iterator_1_1Output.html +++ b/docs-preview/pr-862/structcubos_1_1core_1_1ecs_1_1SparseRelationTable_1_1Iterator_1_1Output.html @@ -2,7 +2,7 @@ - cubos::core::ecs::RelationTable::Iterator::Output struct | CUBOS. Docs + cubos::core::ecs::SparseRelationTable::Iterator::Output struct | CUBOS. Docs @@ -46,10 +46,10 @@

    - cubos::core::ecs::RelationTable::Iterator::Output struct - + cubos::core::ecs::SparseRelationTable::Iterator::Output struct +

    -

    Output structure for the iterator.

    +

    Output structure for the iterator.

    -
    -
    - - - - -
    - - diff --git a/docs-preview/pr-862/structcubos_1_1engine_1_1FixedDeltaTime.html b/docs-preview/pr-862/structcubos_1_1engine_1_1FixedDeltaTime.html index c89013fdf..610258754 100644 --- a/docs-preview/pr-862/structcubos_1_1engine_1_1FixedDeltaTime.html +++ b/docs-preview/pr-862/structcubos_1_1engine_1_1FixedDeltaTime.html @@ -49,7 +49,7 @@

    cubos::engine::FixedDeltaTime struct

    -

    Resouce which holds the value of the fixed delta for the physics update.

    +

    Resource which holds the value of the fixed delta for the physics update.

    diff --git a/docs-preview/pr-862/structcubos_1_1engine_1_1Gravity.html b/docs-preview/pr-862/structcubos_1_1engine_1_1Gravity.html index 79ea7923e..df2814ed5 100644 --- a/docs-preview/pr-862/structcubos_1_1engine_1_1Gravity.html +++ b/docs-preview/pr-862/structcubos_1_1engine_1_1Gravity.html @@ -49,7 +49,7 @@

    cubos::engine::Gravity struct

    -

    Resouce which holds the global value of gravity.

    +

    Resource which holds the global value of gravity.

    diff --git a/docs-preview/pr-862/structcubos_1_1engine_1_1PotentiallyCollidingWith.html b/docs-preview/pr-862/structcubos_1_1engine_1_1PotentiallyCollidingWith.html new file mode 100644 index 000000000..3b15a149f --- /dev/null +++ b/docs-preview/pr-862/structcubos_1_1engine_1_1PotentiallyCollidingWith.html @@ -0,0 +1,103 @@ + + + + + cubos::engine::PotentiallyCollidingWith struct | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/structcubos_1_1engine_1_1RendererFrame_1_1DrawCmd.html b/docs-preview/pr-862/structcubos_1_1engine_1_1RendererFrame_1_1DrawCmd.html index 32cbe2052..02e39b20d 100644 --- a/docs-preview/pr-862/structcubos_1_1engine_1_1RendererFrame_1_1DrawCmd.html +++ b/docs-preview/pr-862/structcubos_1_1engine_1_1RendererFrame_1_1DrawCmd.html @@ -72,6 +72,10 @@

    Public variables

    glm::mat4 modelMat
    Model transform matrix.
    +
    + uint32_t entityIndex +
    +
    Entity identifier.
    diff --git a/docs-preview/pr-862/structcubos_1_1engine_1_1Substeps.html b/docs-preview/pr-862/structcubos_1_1engine_1_1Substeps.html index f8bdcc897..1ce0cb1da 100644 --- a/docs-preview/pr-862/structcubos_1_1engine_1_1Substeps.html +++ b/docs-preview/pr-862/structcubos_1_1engine_1_1Substeps.html @@ -49,7 +49,7 @@

    cubos::engine::Substeps struct

    -

    Resouce which holds the amount of substeps for the physics update.

    +

    Resource which holds the amount of substeps for the physics update.

    diff --git a/docs-preview/pr-862/substeps_8hpp.html b/docs-preview/pr-862/substeps_8hpp.html index 92b444673..59e15cde1 100644 --- a/docs-preview/pr-862/substeps_8hpp.html +++ b/docs-preview/pr-862/substeps_8hpp.html @@ -76,7 +76,7 @@

    Classes

    struct cubos::engine::Substeps
    -
    Resouce which holds the amount of substeps for the physics update.
    +
    Resource which holds the amount of substeps for the physics update.
    diff --git a/docs-preview/pr-862/tables_8hpp.html b/docs-preview/pr-862/tables_8hpp.html new file mode 100644 index 000000000..9dcb888b9 --- /dev/null +++ b/docs-preview/pr-862/tables_8hpp.html @@ -0,0 +1,134 @@ + + + + + core/ecs/table/tables.hpp file | CUBOS. Docs + + + + + + + +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/term_8hpp.html b/docs-preview/pr-862/term_8hpp.html new file mode 100644 index 000000000..7f9b1a341 --- /dev/null +++ b/docs-preview/pr-862/term_8hpp.html @@ -0,0 +1,158 @@ + + + + + core/ecs/query/term.hpp file | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + core/ecs/query/term.hpp file +

    +

    Struct cubos::core::ecs::QueryTerm.

    + +
    +

    Namespaces

    +
    +
    namespace cubos
    +
    CUBOS. libraries namespace.
    +
    namespace cubos::core
    +
    Core namespace.
    +
    namespace cubos::core::ecs
    +
    ECS module.
    +
    +
    +
    +

    Classes

    +
    +
    + struct cubos::core::ecs::QueryTerm +
    +
    Describes a term in a query.
    +
    + struct cubos::core::ecs::QueryTerm::Entity +
    +
    Stores entity term data.
    +
    + struct cubos::core::ecs::QueryTerm::Component +
    +
    Stores component term data.
    +
    + struct cubos::core::ecs::QueryTerm::Relation +
    +
    Stores relation term data.
    +
    +
    +
    +

    Enums

    +
    +
    + enum class Traversal { Random, + Down, + Up } +
    +
    Possible traversal types for tree relation terms.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2asset__explorer_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2asset__explorer_2plugin_8hpp.html index 1cf798e2c..0d923ff1c 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2asset__explorer_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2asset__explorer_2plugin_8hpp.html @@ -82,7 +82,7 @@

    Classes

    Functions

    - void assetExplorerPlugin(cubos::engine::Cubos& cubos) + void assetExplorerPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2debug__camera_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2debug__camera_2plugin_8hpp.html index 22714540a..7e760f56d 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2debug__camera_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2debug__camera_2plugin_8hpp.html @@ -72,7 +72,7 @@

    Namespaces

    Functions

    - void debugCameraPlugin(cubos::engine::Cubos& cubos) + void debugCameraPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2entity__inspector_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2entity__inspector_2plugin_8hpp.html index 8df4b14b8..5b0d1aaa8 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2entity__inspector_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2entity__inspector_2plugin_8hpp.html @@ -72,7 +72,7 @@

    Namespaces

    Functions

    - void entityInspectorPlugin(cubos::engine::Cubos& cubos) + void entityInspectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2entity__selector_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2entity__selector_2plugin_8hpp.html index 21b84288e..9ca4b9cd3 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2entity__selector_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2entity__selector_2plugin_8hpp.html @@ -82,7 +82,7 @@

    Classes

    Functions

    - void entitySelectorPlugin(cubos::engine::Cubos& cubos) + void entitySelectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2metrics__panel_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2metrics__panel_2plugin_8hpp.html index 2c6025a95..c500335f5 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2metrics__panel_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2metrics__panel_2plugin_8hpp.html @@ -72,7 +72,7 @@

    Namespaces

    Functions

    - void metricsPanelPlugin(cubos::engine::Cubos& cubos) + void metricsPanelPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2plugin_8hpp.html index 74cfaafba..19b5cd87a 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2plugin_8hpp.html @@ -72,7 +72,7 @@

    Namespaces

    Functions

    - void plugin(cubos::engine::Cubos& cubos) + void plugin(cubos::engine::Cubos& cubos)
    Tesseratos entry function.
    diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2scene__editor_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2scene__editor_2plugin_8hpp.html index 7ece824e3..bb641eefc 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2scene__editor_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2scene__editor_2plugin_8hpp.html @@ -72,7 +72,7 @@

    Namespaces

    Functions

    - void sceneEditorPlugin(cubos::engine::Cubos& cubos) + void sceneEditorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2settings__inspector_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2settings__inspector_2plugin_8hpp.html index 51e8f3805..01171d965 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2settings__inspector_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2settings__inspector_2plugin_8hpp.html @@ -72,7 +72,7 @@

    Namespaces

    Functions

    - void settingsInspectorPlugin(cubos::engine::Cubos& cubos) + void settingsInspectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2toolbox_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2toolbox_2plugin_8hpp.html index 7c35947ba..49d404f8a 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2toolbox_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2toolbox_2plugin_8hpp.html @@ -82,7 +82,7 @@

    Classes

    Functions

    - void toolboxPlugin(cubos::engine::Cubos& cubos) + void toolboxPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2transform__gizmo_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2transform__gizmo_2plugin_8hpp.html index b71814126..29e6914f4 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2transform__gizmo_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2transform__gizmo_2plugin_8hpp.html @@ -72,7 +72,7 @@

    Namespaces

    Functions

    - void transformGizmoPlugin(cubos::engine::Cubos& cubos) + void transformGizmoPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2voxel__palette__editor_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2voxel__palette__editor_2plugin_8hpp.html index d9dd821e7..02321de3a 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2voxel__palette__editor_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2voxel__palette__editor_2plugin_8hpp.html @@ -72,7 +72,7 @@

    Namespaces

    Functions

    - void voxelPaletteEditorPlugin(cubos::engine::Cubos& cubos) + void voxelPaletteEditorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2world__inspector_2plugin_8hpp.html b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2world__inspector_2plugin_8hpp.html index 4166b4b27..9c699d89d 100644 --- a/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2world__inspector_2plugin_8hpp.html +++ b/docs-preview/pr-862/tools_2tesseratos_2include_2tesseratos_2world__inspector_2plugin_8hpp.html @@ -72,7 +72,7 @@

    Namespaces

    Functions

    - void worldInspectorPlugin(cubos::engine::Cubos& cubos) + void worldInspectorPlugin(cubos::engine::Cubos& cubos)
    Plugin entry function.
    diff --git a/docs-preview/pr-862/types_8hpp.html b/docs-preview/pr-862/types_8hpp.html new file mode 100644 index 000000000..99aa2a1cb --- /dev/null +++ b/docs-preview/pr-862/types_8hpp.html @@ -0,0 +1,142 @@ + + + + + core/ecs/types.hpp file | CUBOS. Docs + + + + + + + +
    +
    +
    +
    +
    +

    + core/ecs/types.hpp file +

    +

    Class cubos::core::ecs::Types.

    + +
    +

    Namespaces

    +
    +
    namespace cubos
    +
    CUBOS. libraries namespace.
    +
    namespace cubos::core
    +
    Core namespace.
    +
    namespace cubos::core::ecs
    +
    ECS module.
    +
    +
    +
    +

    Classes

    +
    +
    + struct cubos::core::ecs::DataTypeId +
    +
    Identifies a data type registered in the world.
    +
    + struct cubos::core::ecs::DataTypeIdHash +
    +
    Hash functor for DataTypeId.
    +
    + class cubos::core::ecs::Types +
    +
    Registry of all data types used in an ECS world.
    +
    +
    +
    +
    +
    +
    + + + +
    + + diff --git a/docs-preview/pr-862/world_8hpp.html b/docs-preview/pr-862/world_8hpp.html index dc621db5a..48e43b4cc 100644 --- a/docs-preview/pr-862/world_8hpp.html +++ b/docs-preview/pr-862/world_8hpp.html @@ -70,8 +70,6 @@

    Namespaces

    Core namespace.
    namespace cubos::core::ecs
    ECS module.
    -
    namespace cubos::core::ecs::impl
    -
    Contains functions used internally by the implementation of the ECS.