diff --git a/classcubos_1_1core_1_1memory_1_1ReadGuard.html b/classcubos_1_1core_1_1memory_1_1ReadGuard.html index 1dff65b14..424154145 100644 --- a/classcubos_1_1core_1_1memory_1_1ReadGuard.html +++ b/classcubos_1_1core_1_1memory_1_1ReadGuard.html @@ -67,7 +67,7 @@
This class was created because there are multiple parts of the code that need to provide access to objects in a thread-safe manner.
using AssetMetaRead = core::memory::ReadGuard<AssetMeta, std::shared_lock<std::shared_mutex>>;
This class was created because there are multiple parts of the code that need to provide access to objects in a thread-safe manner.
using AssetMetaRead = core::memory::ReadGuard<AssetMeta, std::shared_lock<std::shared_mutex>>;
Why do we have our own streams? Well, the standard library streams are hard to use and extend, and very template heavy. Using our own streams allows us to abstract away more easily where the data is coming from, or going to, allowing us, for example, to embed files into the executable and not have to worry about the code that reads them.
Why do we have our own streams? Well, the standard library streams are hard to use and extend, and very template heavy. Using our own streams allows us to abstract away more easily where the data is coming from, or going to, allowing us, for example, to embed files into the executable and not have to worry about the code that reads them.
stream.printf("Hello, {}!\n", "world"); +Usage
stream.printf("Hello, {}!\n", "world"); stream.printf("{} + {} = {}\n", 1, 2, 3); stream.printf("\\{} {}\n", 1, 2); // This will print "{} 2"
This class was created because there are multiple parts of the code that need to provide access to objects in a thread-safe manner.
using AssetMetaWrite = core::memory::WriteGuard<AssetMeta, std::unique_lock<std::shared_mutex>>;
This class was created because there are multiple parts of the code that need to provide access to objects in a thread-safe manner.
using AssetMetaWrite = core::memory::WriteGuard<AssetMeta, std::unique_lock<std::shared_mutex>>;
Guide on the project's conventions and code style.
- +Commits should be concise and small, such that they are easy to review. Avoid at all costs including non-related changes in a commit - use git add -p
or something similar to force yourself to review the changes you are commiting, and to avoid accidentally commiting unrelated changes.
Commits should follow Conventional Commits and be written in imperative mood. We use the scopes core
, engine
and tools
. When making a commit which affects more than one of these scopes, you can ommit the scope.
If your description is too long, you can add a body to the commit message. The body should be separated from the description by a blank line.
Examples of good commit messages:
feat(core): add CUBOS_FAIL, CUBOS_UNREACHABLE and CUBOS_DEBUG_ASSERT +test(core): move filesystem tests to data/fs +fix(core): fix segfault when popping a sub context +feat(engine): implement system for sweeping the markers +docs(engine): add comments to colliders +chore: replace GoogleTest submodule with doctest
Examples of bad commit messages:
fix: fix bug +make it work +feat(core): Add CUBOS_FAIL +docs(engine): added comments to colliders
Pull requests should be concise and small, and if needed, split into multiple smaller PRs so that they are easier to review. If your PR is still not finished, mark it as a draft. When working on new features, draft PRs should be created so that other contributors can have an idea of what is being worked on.
Any features added in a PR should be covered by tests and documentation, including new examples demonstrating the feature.
We use Doxygen for documentation, which means that the documentation is mostly written in the code itself. When adding new files, classes, functions, etc, make sure to at least add a triple slash comment (///
) with a @brief
section describing what it does, otherwise Doxygen will omit it from the documentation.
Make sure to document all function parameters, template parameters and return values. Take a look at other files to get a grasp of the documentation style we use.
When changing the code, the documentation should be updated accordingly.
Engine plugins should document which components and resources they add, which tags and settings are used, and how to use them. Take a look at the documentation of other plugins such as the renderer plugin to get an idea of how it should look like.
Every type or function that is part of the public API of a plugin should be added to its corresponding group
in the Doxygen documentation, using the @ingroup
tag.
We use camelCase
for functions, methods, local variables and fields. Private fields are prefixed with m
(e.g. mMyField
). PascalCase
is used for class names and constants. UPPER_CASE
is used for macros. snake_case
is used for namespaces, folders and files.
Code is formatted using clang format. Although we have an action that runs clang format on every PR, it is recommended that you run it locally before commiting your changes, to make it easier for the reviewers to read your code.
We also check the code with clang tidy, which is a static analysis tool which picks up many common mistakes and code smell. This runs on every commit you push to your branch.
Avoid using macros whenever possible - use constexpr
variables or functions instead. If you do need to use a macro to make an implementation more readable, restrict the macro to the source file where it is used. Defining macros in header files is heavily discouraged.
Avoid using namespace
in header files. In source files, prefer using foo::bar::X
over using namespace foo::bar
. If your code is under the namespace foo::bar
, you can use using namespace foo::bar
in the source files, to make the code more readable.
When closing a namespace the namespace name should be added as a comment. E.g.:
namespace foo +{ + ... +} // namespace foo
assets.io.enabled
- whether asset I/O should be done (default: true
).assets.io.path
- path to the assets directory - will be mounted to /assets/
(default: assets/
).assets.io.readOnly
- if true, the assets directory will be mounted as read-only (default: true
).cubos.assets.init
- initializes the assets manager and loads the meta files (after cubos.settings
).cubos.assets.bridge
- systes which add bridges to the asset manager should be tagged with this.cubos.assets
- systems which load assets should be tagged with this.cubos.assets.cleanup
- frees any assets no longer in use.assets.io.enabled
- whether asset I/O should be done (default: true
).assets.io.path
- path to the assets directory - will be mounted to /assets/
(default: assets/
).assets.io.readOnly
- if true, the assets directory will be mounted as read-only (default: true
).cubos.assets.init
- initializes the assets manager and loads the meta files (after cubos.settings
).cubos.assets.bridge
- systes which add bridges to the asset manager should be tagged with this.cubos.assets
- systems which load assets should be tagged with this.cubos.assets.cleanup
- frees any assets no longer in use.cubos.collisions.aabb.missing
- missing aabb colliders are added.cubos.collisions.aabb
- collider aabbs are updated.cubos.collisions.broad.markers
- sweep markers are updated.cubos.collisions.broad.sweep
- sweep is performed.cubos.collisions.broad
- broad phase collision detection.cubos.collisions
- collisions are resolved.cubos.collisions.aabb.missing
- missing aabb colliders are added.cubos.collisions.aabb
- collider aabbs are updated.cubos.collisions.broad.markers
- sweep markers are updated.cubos.collisions.broad.sweep
- sweep is performed.cubos.collisions.broad
- broad phase collision detection.cubos.collisions
- collisions are resolved.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).
R
.R
.E
sent from other systems.E
to other systems.C
, read-only access.C
, write access.C
is present.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).
R
.R
.E
sent from other systems.E
to other systems.C
, read-only access.C
, write access.C
is present.C
is present.This plugins exists to reduce coupling between plugins. For example, a plugin which allows selecting entities through a ImGui window only needs to depend on this plugin, instead of having to know about all the plugins which care about it. The same applies in the other direction.
This plugins exists to reduce coupling between plugins. For example, a plugin which allows selecting entities through a ImGui window only needs to depend on this plugin, instead of having to know about all the plugins which care about it. The same applies in the other direction.
This plugin needs the Arguments resource, and thus, the constructor Cubos::
cubos.settings
- the settings are loaded.cubos.settings.env
- the settings are loaded.This plugin needs the Arguments resource, and thus, the constructor Cubos::
cubos.settings
- the settings are loaded.cubos.settings.env
- the settings are loaded.The settings file must be a JSON file. If the file does not exist or can't be parsed, the plugin aborts. Any previously set setting will be overwritten if its set on the file.
settings.path
- path of the settings file (default: ./settings.json
).cubos.settings
- the settings are loaded.cubos.settings.file
- the settings are loaded.The settings file must be a JSON file. If the file does not exist or can't be parsed, the plugin aborts. Any previously set setting will be overwritten if its set on the file.
settings.path
- path of the settings file (default: ./settings.json
).cubos.settings
- the settings are loaded.cubos.settings.file
- the settings are loaded.cubos.imgui.init
- ImGui
is initialized, after cubos.window.init
.cubos.imgui.begin
- the ImGui frame begins (after cubos.window.poll
).cubos.imgui.end
- the ImGui frame ends (before cubos.window.render
).cubos.imgui
- runs between the previous two tags.cubos.imgui.init
- ImGui
is initialized, after cubos.window.init
.cubos.imgui.begin
- the ImGui frame begins (after cubos.window.poll
).cubos.imgui.end
- the ImGui frame ends (before cubos.window.render
).cubos.imgui
- runs between the previous two tags..bind
extension, loads InputBindings assets.cubos.input.update
- updates the input state..bind
extension, loads InputBindings assets.cubos.input.update
- updates the input state.Renders all entities with the RenderableGrid component, using as cameras entities with the Camera component selected by the ActiveCameras resource. Lights are rendered using entities with SpotLight, DirectionalLight or PointLight components.
The rendering environment, such as the ambient lighting and sky color, can be set through the resource RendererEnvironment.
cubos.renderer.ssao.enabled
- whether SSAO is enabled.cubos.renderer.init
- the renderer is initialized, after cubos.window.init
.cubos.renderer.frame
- frame information is collected, after cubos.transform.update
.cubos.renderer.draw
- frame is rendered to the window, after cubos.renderer.frame
and before cubos.window.render
.Renders all entities with the RenderableGrid component, using as cameras entities with the Camera component selected by the ActiveCameras resource. Lights are rendered using entities with SpotLight, DirectionalLight or PointLight components.
The rendering environment, such as the ambient lighting and sky color, can be set through the resource RendererEnvironment.
cubos.renderer.ssao.enabled
- whether SSAO is enabled.cubos.renderer.init
- the renderer is initialized, after cubos.window.init
.cubos.renderer.frame
- frame information is collected, after cubos.transform.update
.cubos.renderer.draw
- frame is rendered to the window, after cubos.renderer.frame
and before cubos.window.render
..cubos
extension, loads Scene assets..cubos
extension, loads Scene assets.This plugin operates on entities with a LocalToWorld component and any combination of the Position, Rotation and Scale components. For example, if you have an entity which doesn't need rotation, but has a position and a scale, you do not need to add the Rotation component, and its transform will still be updated.
cubos.transform.update
- the LocalToWorld components are updated with the information from the Position, Rotation and Scale components.This plugin operates on entities with a LocalToWorld component and any combination of the Position, Rotation and Scale components. For example, if you have an entity which doesn't need rotation, but has a position and a scale, you do not need to add the Rotation component, and its transform will still be updated.
cubos.transform.update
- the LocalToWorld components are updated with the information from the Position, Rotation and Scale components..grd
extension, loads cubos::.pal
extension, loads cubos::.grd
extension, loads cubos::.pal
extension, loads cubos::Initially sets ShouldQuit to false
, and sets it to true
only when the window is closed.
window.title
- the window's title (default: CUBOS.
).window.width
- the window's width (default: 800
).window.height
- the window's height (default: 600
).cubos.window.init
- window is opened, runs after cubos.settings
.cubos.window.poll
- the window is polled for events, sending core::cubos.window.render
- the window's back buffers are swapped.Initially sets ShouldQuit to false
, and sets it to true
only when the window is closed.
window.title
- the window's title (default: CUBOS.
).window.width
- the window's width (default: 800
).window.height
- the window's height (default: 600
).cubos.window.init
- window is opened, runs after cubos.settings
.cubos.window.poll
- the window is polled for events, sending core::cubos.window.render
- the window's back buffers are swapped.CUBOS. aims to be a simple, but powerful game engine for PC, where everything is made out of voxels.
It is open source and free to use for any purpose. Written in C++ and with data-oriented design in mind, its goal is to be both performant and highly flexible.
The best way to get started is to read the getting started guide, which will guide you through the process of downloading and building the engine, as well as where to go from there.
There is also a feature guide which gives you a high-level overview of the engine's design and features. If you're just looking for a quick overview, this is the place to go. You can also take a look at the modules page, which describes each of the engine's modules.
In the examples page you can find examples on how to use specific parts of the engine.
If you're looking to contribute to the project, make sure you read the contribution guidelines, which introduces you to the project's conventions and code style.
CUBOS. is developed by a small team at GameDev Técnico, a student group at Instituto Superior Técnico who make games. Our goal is to build a game engine from the ground up and have fun doing it.
If you're a student and interested in joining us, please fill out this form.
CUBOS. aims to be a simple, but powerful game engine for PC, where everything is made out of voxels.
It is open source and free to use for any purpose. Written in C++ and with data-oriented design in mind, its goal is to be both performant and highly flexible.
The best way to get started is to read the getting started guide, which will guide you through the process of downloading and building the engine, as well as where to go from there.
There is also a feature guide which gives you a high-level overview of the engine's design and features. If you're just looking for a quick overview, this is the place to go. You can also take a look at the modules page, which describes each of the engine's modules.
In the examples page you can find examples on how to use specific parts of the engine.
If you're looking to contribute to the project, make sure you read the contribution guidelines, which introduces you to the project's conventions and code style.
CUBOS. is developed by a small team at GameDev Técnico, a student group at Instituto Superior Técnico who make games. Our goal is to build a game engine from the ground up and have fun doing it.
If you're a student and interested in joining us, please fill out this form.