DOXYGEN: updated doxygen to use mcss and fixed markdown linting

master
Martin Gerhardy 2020-05-14 23:30:57 +02:00
parent a0e08c4b85
commit 8c5e441d43
43 changed files with 346 additions and 330 deletions

View File

@ -209,6 +209,7 @@ message(STATUS "Generate config.h in ${CMAKE_CURRENT_BINARY_DIR}")
find_package(Doxygen)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile-mcss.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-mcss @ONLY)
if (DOXYGEN_FOUND)
add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}

13
Doxyfile-mcss.in Normal file
View File

@ -0,0 +1,13 @@
@INCLUDE = Doxyfile
GENERATE_HTML = NO
GENERATE_XML = YES
XML_PROGRAMLISTING = NO
M_LINKS_NAVBAR1 = \
"about dependencies building configuration setup" \
"pages" \
"modules" \
"namespaces"
M_LINKS_NAVBAR2 = \
"annotated"

View File

@ -152,7 +152,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH = @ROOT_DIR@/src
STRIP_FROM_PATH = @ROOT_DIR@
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
@ -733,7 +733,7 @@ WARNINGS = YES
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
WARN_IF_UNDOCUMENTED = NO
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
@ -783,7 +783,9 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src/ \
INPUT = @ROOT_DIR@/src/ \
@ROOT_DIR@/docs/ \
@ROOT_DIR@/README.md \
@GENERATE_DIR@
# This tag can be used to specify the character encoding of the source files
@ -809,7 +811,7 @@ INPUT_ENCODING = UTF-8
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.
FILE_PATTERNS =
FILE_PATTERNS = *.cpp *.h *.md
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
@ -824,7 +826,9 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/src/tools/glslang
EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/src/tools/glslang \
@CMAKE_CURRENT_SOURCE_DIR@/contrib \
@CMAKE_CURRENT_SOURCE_DIR@/src/tests/testtraze/json.hpp
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@ -877,7 +881,7 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).
IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/docs/
IMAGE_PATH = @ROOT_DIR@/docs/
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@ -2032,7 +2036,7 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
INCLUDE_PATH = @ROOT_DIR@/docs @ROOT_DIR@/contrib/libs/
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
@ -2443,3 +2447,5 @@ GENERATE_LEGEND = YES
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
XML_NS_MEMB_FILE_SCOPE = YES

View File

@ -1,7 +1,8 @@
# About {#about}
[![Actions Status](https://github.com/mgerhardy/engine/workflows/build/badge.svg)](https://github.com/mgerhardy/engine/actions)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
# About
Voxel engine for mmorpg game and tools.
Includes [behaviour tree](src/server/lua/ai/README.md) based ai, a remote ai debugger, a voxel editor and a lot more.
@ -16,7 +17,8 @@ Join our [discord Server](https://discord.gg/AgjCPXy) and help developing the ga
You can find some old and most likely outdated videos in my [youtube channel](https://www.youtube.com/channel/UCbnJUW0d4tYvdmsJ-R6iUpA) or the media channel of the discord server.
# Tools
## Tools
* [The voxel editor](src/tools/voxedit/README.md)
* [Filemanager Thumbnailer](src/tools/thumbnailer/README.md)
* [World viewer](src/tools/mapview/README.md)
@ -26,21 +28,24 @@ You can find some old and most likely outdated videos in my [youtube channel](ht
* [Compute Shader tool](src/tools/computeshadertool/README.md)
* [Visual test applications](src/tests/README.md)
# General
## General
* [Dependencies](docs/Dependencies.md)
* [Compilation](docs/Compilation.md)
* [Setup](docs/Setup.md)
* [Configuration](docs/Configuration.md)
* [GameDesign](docs/GameDesign.md)
# Running the tests
## Running the tests
The tests need a postgres database named `enginetest` and a user named `engine` with the password.... `engine` (you can modify them via cvars). If no OpenGL or OpenCL context is available, the related tests are skipped.
You can use the docker-compose files to set up your environment.
# Profiling
## Profiling
In order to compile with profiling support. You should clone with submodules. This will also get the [tracy](https://github.com/wolfpld/tracy) code.
# Images
## Images
![image](https://raw.githubusercontent.com/wiki/mgerhardy/engine/images/gliding-2020-02-23.png)

View File

@ -1,4 +1,4 @@
# Building
# Building {#building}
## Linux

View File

@ -1,4 +1,4 @@
# Configuration
# Configuration {#configuration}
## Variables
@ -26,14 +26,14 @@ in-game console (`CTRL+Tab` in the default binding).
You can also modify or add key bindings to commands. Type `bindlist` to the console to get a list of the current active bindings
(and also here: they might differ from application to application). The command `bind` can be used to configure keybindings on-the-fly. These bindings are saved to a file on shutdown.
# Logging
## Logging
You can either log via syslog (on unix) or to stdout (this might of course differ from platform to platform).
The log level is configured by the `core_loglevel` variable. The lower the value, the more you see. `0` is the highest log level
(trace).
# General
## General
To get a rough usage overview, you can start an application with `--help`. It will print out the commands and configuration variables
with a description and hints how to modify/use them.

View File

@ -1,4 +1,5 @@
# Dependencies
# Dependencies {#dependencies}
* cmake
* ninja-build
* postgre
@ -22,24 +23,37 @@ of them are also bundled with the application. But local installed headers alway
the higher priority.
## Debian
apt-get install libglm-dev lua5.3 liblua5.3-dev libsdl2-dev postgresql-server-dev-all \
libpq-dev libenet-dev qt5-default qttools5-dev qttools5-dev-tools opencl-c-headers \
wayland-protocols pkg-config uuid-dev libsdl2-mixer-dev
```bash
apt-get install libglm-dev lua5.3 liblua5.3-dev libsdl2-dev postgresql-server-dev-all \
libpq-dev libenet-dev qt5-default qttools5-dev qttools5-dev-tools opencl-c-headers \
wayland-protocols pkg-config uuid-dev libsdl2-mixer-dev
```
If you want to run the database server locally, you have to install the postgres server package:
apt-get install postgresql-10 postgresql-contrib
```bash
apt-get install postgresql-10 postgresql-contrib
```
CREATE EXTENSION pgcrypto;
## Arch Linux
pacman [...]
```sql
CREATE EXTENSION pgcrypto;
```
## MacPorts
port install qt5 postgresql95-server
```bash
port install qt5 postgresql95-server
```
## Brew
brew install qt5 mosquitto libuv sdl2 libpq sdl2_mixer
```bash
brew install qt5 mosquitto libuv sdl2 libpq sdl2_mixer
```
## Windows
vcpkg install sdl2 libuv libpq lua glm glslang gtest qt5 mosquitto
```bash
vcpkg install sdl2 libuv libpq lua glm glslang gtest qt5 mosquitto
```

View File

@ -1,4 +1,4 @@
# General
# Game Design {#gamedesign}
This is about an mmorpg in a fantasy like world.
@ -15,5 +15,5 @@ The entities in the island simulation have a profession where you can decide wha
There is a value that indicates whether it's still reasonable to continue with that particular profession. If
the entity - for some reason - can't continue with the current job, that value decreases and the entity will try
to pick another free job.
Before quitting the job, the entity will report this as an impediment in the corresponding townhall as a quest
- asking for help.
Before quitting the job, the entity will report this as an impediment in the corresponding townhall as a
quest - asking for help.

View File

@ -1,4 +1,5 @@
# Setup
# Setup {#setup}
## PostgreSQL
first sudo as postgres default superuser 'postgres' on bash

View File

@ -2,5 +2,13 @@
* @file
* @mainpage VoxelEngine documentation
*
* - [GitLab page](http://gitlab.com/mgerhardy/engine/)
* @ref about
*
* @ref dependencies
*
* @ref building
*
* @ref configuration
*
* @ref setup
*/

View File

@ -1,5 +0,0 @@
# General
This module depends on [SimpleAI](https://github.com/mgerhardy/simpleai). A lot of its documentation is doxygen based.
See e.g. [SimpleAI.h](SimpleAI.h)

View File

@ -80,64 +80,9 @@
* * @movement{TargetSeek}
* * @movement{Wander}
*
* @section compilation Compile the lib:
*
* * autotools based compilation
* * `./autogen.sh`
* * `./configure`
* * `make`
* * `make install`
* * cmake based compilation (enable tests, remote debugger and so on via options)
* * `cmake CMakeLists.txt`
* * `make`
* * Compile the remote debugger
* * qmake
* * `cd src/debug`
* * `qmake`
* * `make`
* * cmake based compilation
* * `cmake CMakeLists.txt -DSIMPLEAI_DEBUGGER=ON`
* * `make`
*
* @section run Running it:
*
* SimpleAI comes with a small tool that is located in src/run. You can
* execute your own trees with:
*
* - `./simpleai-run -file src/run/behaviours.lua`
*
* After you ran it, you can connect with the remote @ref debugger and inspect the live
* state of every spawned @ai{AI} entity.
*
* @section using Using it:
* * Make sure your character extends @ai{ICharacter} or includes it as component.
* * Implement your behaviour tree loader by extending the class @ai{ITreeloader}.
* * Extend the @debug{AIDebugger} to deliver your own @debug{MapView} that renders the map of
* your application.
* * Add your own condition, filter and task factories to the @ai{AIRegistry} or via @ai{LUAAIRegistry}.
* * Assign attributes to your characters that should be shown in the
* debuggers live view.
*
* As the name states, it should be easy to use and to integrate into your application. You
* have the ability to create new customized actions, override existing ones with your
* own implementations and so on.
*
* To integrate the @ai{AI} into your application, your entity class should implement or include
* the @ai{ICharacter} interface. You only have to call the @ai{ICharacter::update()} method
* to get the @ai{AI} and the character updated. You can view the included `simpleai-run` tool
* for getting an idea on how to do this.
*
* Once this step is done, you can go on with creating new actions for your application. All you
* have to do for this is to extend @ai{ITask}. The entity instance given to the
* @ai{ITask::doAction()} method contains the @ai{ICharacter} that you bound to your
* application entity.
*
* After implementing these actions, all you have to do in order to use them with e.g. the
* existing @ai{LUATreeLoader} is to add them to the registry. Just call
* After implementing actions add them to the registry. Just call
* @ai{AIRegistry::registerNodeFactory()} on your @ai{AIRegistry} instance and you are ready
* to write @ai{LUA} scripts with it. Again, as a reference, just check out the example code.
* You can also create nodes, conditions, filter and steering methods via LUA directly. See
* @ai{LUAAIRegistry} for more information about this.
* to write @ai{LUA} scripts with it.
*
* Note the usage of a few macros that makes your life easier:
* * @ai{TASK_CLASS}
@ -189,26 +134,6 @@
*
* Examples on how to customize the debugger
* * [some classes](https://github.com/mgerhardy/simpleai/blob/master/contrib/exampledebugger) that provide a custom map view and map item rendering with custom data from attributes.
*
* @section legal Legal
*
* Copyright (C) 2015-2017 Martin Gerhardy <martin.gerhardy@gmail.com>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
/**

View File

@ -2,11 +2,11 @@
* @file
* @defgroup Filter
* @{
* In combination with the `Filter` condition `IFilter` provides a quite flexible way to provide
* In combination with the @ai{Filter} condition @ai{IFilter} provides a quite flexible way to provide
* generic behaviour tree tasks. You can just create one @ai{ITask} implementation that deals with
* e.g. attacking. The target is just picked from the selection. If you encapsulate this with a
* condition like (lua):
* @code
* @code{.lua}
* someNode:addNode("AttackTarget", "attack"):setCondition("Filter(SelectGroupLeader{1})")
* @endcode
* You would only attack the group leader of group 1 if it was found. You can provide your own
@ -16,12 +16,12 @@
* There are some filters that accept subfilters - like _Union_, _Intersection_, _Last_, _First_,
* _Difference_, _Complement_ and _Random_. _Last_, _First_ and _Random_ accept one sub filter as
* parameter, _Union_ and _Intersection_ accept at least two sub filters.
* @code
* @code{.lua}
* someNode:addNode("AttackTarget", "attack"):setCondition("Filter(First(SelectZone))")
* @endcode
*
* _Random_ also accepts a parameter for how many items should be randomly preserved:
* @code
* @code{.lua}
* someNode:addNode("AttackTarget", "attack"):setCondition("Filter(Random{1}(SelectZone))")
* @endcode
*/
@ -112,16 +112,16 @@ public: \
FILTER_FACTORY_SINGLETON
/**
* @brief This class is used by the @c Filter condition in order to select entities for a @c TreeNode.
* @brief This class is used by the @ai{Filter} condition in order to select entities for a @ai{TreeNode}.
*
* To modify the selection, the implementing classes should call @c getFilteredEntities to access
* the storage to persist the filtering for the @c TreeNode.
* To modify the selection, the implementing classes should call @ai{getFilteredEntities()} to access
* the storage to persist the filtering for the @ai{TreeNode}.
*
* In combination with the @code Filter condition @code IFilter provides a quite flexible way to provide
* generic behaviour tree tasks. You can e.g. just create one @code ITask implementation that deals with
* In combination with the @ai{Filter} condition @ai{IFilter} provides a quite flexible way to provide
* generic behaviour tree tasks. You can e.g. just create one @ai{ITask} implementation that deals with
* e.g. attacking. The target is just picked from the selection. If you encapsulate this with a condition
* like (lua):
* @code
* @code{.lua}
* someNode:addNode("AttackTarget", "attack"):setCondition("Filter(SelectGroupLeader{1})")
* @endcode
* You would only attack the group leader of group 1 if it was found. You can provide your own filters like:
@ -136,7 +136,7 @@ protected:
* @note The filtered entities are kept even over several ticks. The caller should decide
* whether he still needs an old/previous filtered selection
*
* @see selection @c SelectEmpty to do the clear from within the behaviour tree
* @see selection @ai{SelectEmpty} to do the clear from within the behaviour tree
*/
inline FilteredEntities& getFilteredEntities(const AIPtr& ai) {
return ai->_filteredEntities;

View File

@ -30,6 +30,9 @@ using IMetricSenderPtr = std::shared_ptr<IMetricSender>;
}
/**
* Foundation classes
*/
namespace core {
class ThreadPool;
@ -58,7 +61,7 @@ enum class AppState : uint8_t {
};
/**
* @brief The app class controls the main loop of every application.
* @brief The app class controls the main loop and life-cycle of every application.
*/
class App : public core::TraceCallback {
protected:

View File

@ -1,8 +1,5 @@
/**
* @file
* @mainpage VoxelEngine documentation
*
* - [GitLab page](http://gitlab.com/mgerhardy/engine/)
*/
#pragma once

View File

@ -1,4 +1,6 @@
# General
# Network layer
## General
The network layer is based on udp (enet) and shared between client and server.
@ -8,12 +10,12 @@ See the `generate_protocol` cmake macro on how to integrate them.
Values that should be shared between client and server - for example our cooldown ids - are
part of the protocol to always have them in sync with each other.
# Connection
## Connection
* [client] connects
* [connection established]
* [client] send `UserConnect` message
* [client] sends `UserConnect` message
* [server] `UserConnectHandler`
* [server] perform auth
* [auth failed] => [server] send `AuthFailed` message
* [auth successful] => [server] send Seed [server] broadcast to visible `UserSpawn`
* [server] performs auth
* [auth failed] => [server] sends `AuthFailed` message
* [auth successful] => [server] sends Seed [server] broadcasts to visible `UserSpawn`

View File

@ -45,8 +45,8 @@ public:
bool canUseShader() const;
/**
* @return @c true if the value was set, @c false otherwise. This might happen if you e.g. try to activate noise shaders,
* but your system doesn't support them.
* @return Return whether the request to use the noise shaders could get fulfilled. It might fail if you e.g. try
* to activate noise shaders, but your system doesn't support them.
*/
bool useShader(bool enableShader);

View File

@ -12,6 +12,9 @@
#include "core/IComponent.h"
#include "core/concurrent/ReadWriteLock.h"
/**
* Persistence layer
*/
namespace persistence {
/**

View File

@ -1,4 +1,6 @@
# Purpose
# Persistence layer
## Purpose
This module manages the persistence layer and provides drivers to talk to the database. Currently the only driver implemented is for postgresql.
@ -11,22 +13,22 @@ prepared statements. You should use this for e.g. player updates.
It's always a good idea to check out the unit tests to get an idea of the functionality of those classes.
# Usage DBHandler
## Usage DBHandler
You have to create the models that are usually put into the namespace `db`. Once you have those models, you can use the generated getters and
setters to prepare the model. This can now get send over to the `DBHandler`. There are methods to insert, update, delete or select particular
entries from tables via the model values.
## Create (and update) table
### Create (and update) table
```
_dbHandler->createTable(db::EventModel());
```cpp
_dbHandler->createTable(db::EventModel());
```
## Select by condition
### Select by condition
```
_dbHandler->select(db::EventModel(), persistence::DBConditionOne(), [this] (db::EventModel&& model) {
[...]
});
```cpp
_dbHandler->select(db::EventModel(), persistence::DBConditionOne(), [this] (db::EventModel&& model) {
[...]
});
```

View File

@ -1,3 +1,3 @@
# Purpose
# Client/Server shared module
This module contains code that is shared between `frontend` and `backend`.

View File

@ -11,6 +11,9 @@
#include <glm/vec3.hpp>
#include <functional>
/**
* Shared between client and server
*/
namespace shared {
using WalkableFloorResolver = std::function<voxelutil::FloorTraceResult(const glm::ivec3& pos, int maxWalkableHeight)>;

View File

@ -177,7 +177,7 @@ extern void getScissor(int& x, int& y, int& w, int& h);
extern void getViewport(int& x, int& y, int& w, int& h);
/**
* @brief Given in screen coordinates
* @note viewport() must have seen called before
* @note viewport() must have been called before
*/
extern bool scissor(int x, int y, int w, int h);
/**

View File

@ -8,6 +8,9 @@
#include <stdint.h>
#include "gl/GLTypes.h"
/**
* Rendering
*/
namespace video {
enum class TextureType {

View File

@ -74,17 +74,17 @@ glm::ivec3 Region::getRandomPosition(math::Random& random) const {
}
/**
* @param iX The 'x' component of the position to accumulate.
* @param iY The 'y' component of the position to accumulate.
* @param iZ The 'z' component of the position to accumulate.
* @param x The 'x' component of the position to accumulate.
* @param y The 'y' component of the position to accumulate.
* @param z The 'z' component of the position to accumulate.
*/
void Region::accumulate(int32_t iX, int32_t iY, int32_t iZ) {
_mins.x = core_min(_mins.x, iX);
_mins.y = core_min(_mins.y, iY);
_mins.z = core_min(_mins.z, iZ);
_maxs.x = core_max(_maxs.x, iX);
_maxs.y = core_max(_maxs.y, iY);
_maxs.z = core_max(_maxs.z, iZ);
void Region::accumulate(int32_t x, int32_t y, int32_t z) {
_mins.x = core_min(_mins.x, x);
_mins.y = core_min(_mins.y, y);
_mins.z = core_min(_mins.z, z);
_maxs.x = core_max(_maxs.x, x);
_maxs.y = core_max(_maxs.y, y);
_maxs.z = core_max(_maxs.z, z);
update();
}
@ -272,34 +272,34 @@ bool Region::containsPoint(const glm::ivec3& pos, uint8_t boundary) const {
}
/**
* @param v3dAmount The amount to move the Region by.
* @param amount The amount to move the Region by.
*/
void Region::shift(const glm::ivec3& v3dAmount) {
shiftLowerCorner(v3dAmount);
shiftUpperCorner(v3dAmount);
void Region::shift(const glm::ivec3& amount) {
shiftLowerCorner(amount);
shiftUpperCorner(amount);
}
/**
* @param v3dAmount The amount to move the lower corner by.
* @param amount The amount to move the lower corner by.
*/
void Region::shiftLowerCorner(const glm::ivec3& v3dAmount) {
shiftLowerCorner(v3dAmount.x, v3dAmount.y, v3dAmount.z);
void Region::shiftLowerCorner(const glm::ivec3& amount) {
shiftLowerCorner(amount.x, amount.y, amount.z);
}
/**
* @param v3dAmount The amount to move the upper corner by.
* @param amount The amount to move the upper corner by.
*/
void Region::shiftUpperCorner(const glm::ivec3& v3dAmount) {
shiftUpperCorner(v3dAmount.x, v3dAmount.y, v3dAmount.z);
void Region::shiftUpperCorner(const glm::ivec3& amount) {
shiftUpperCorner(amount.x, amount.y, amount.z);
}
/**
* The amount can be specified seperatly for each direction. Negative shrinkage
* is possible but you should prefer the grow() function for clarity.
* @param v3dAmount The amount to shrink by (one component for each direction).
* @param amount The amount to shrink by (one component for each direction).
*/
void Region::shrink(const glm::ivec3& v3dAmount) {
shrink(v3dAmount.x, v3dAmount.y, v3dAmount.z);
void Region::shrink(const glm::ivec3& amount) {
shrink(amount.x, amount.y, amount.z);
}
}

View File

@ -16,70 +16,65 @@ class Random;
namespace voxel {
/** Represents a part of a Volume.
/**
* Represents a part of a Volume.
*
* Many operations in PolyVox are constrained to only part of a volume. For example, when running the surface extractors
* it is unlikely that you will want to run it on the whole volume at once, as this will give a very large mesh which may
* be too much to render. Instead you will probably want to run a surface extractor a number of times on different parts
* of the volume, there by giving a number of meshes which can be culled and rendered separately.
* Many operations in PolyVox are constrained to only part of a volume. For example, when running the surface extractors
* it is unlikely that you will want to run it on the whole volume at once, as this will give a very large mesh which may
* be too much to render. Instead you will probably want to run a surface extractor a number of times on different parts
* of the volume, there by giving a number of meshes which can be culled and rendered separately.
*
* The Region class is used to define these parts (regions) of the volume. Essentially it consists of an upper and lower
* bound which specify the range of voxels positions considered to be part of the region. Note that these bounds are
* <em>inclusive</em>.
* The Region class is used to define these parts (regions) of the volume. Essentially it consists of an upper and lower
* bound which specify the range of voxels positions considered to be part of the region. Note that these bounds are
* <em>inclusive</em>.
*
* As well as the expected set of getters and setters, this class also provide utility functions for increasing and decreasing
* the size of the Region, shifting the Region in 3D space, testing whether it contains a given position, enlarging it so that
* it does contain a given position, cropping it to another Region, and various other utility functions.
*
* @note The dimensions of a region can be measured either in voxels or in cells. See the manual for more information
* about these definitions.
* As well as the expected set of getters and setters, this class also provide utility functions for increasing and decreasing
* the size of the Region, shifting the Region in 3D space, testing whether it contains a given position, enlarging it so that
* it does contain a given position, cropping it to another Region, and various other utility functions.
*
* @note The dimensions of a region can be measured either in voxels or in cells. See the manual for more information
* about these definitions.
*/
class Region {
public:
/// Constructor
constexpr Region();
/// Constructor
Region(const glm::ivec3& mins, const glm::ivec3& maxs);
/// Constructor
constexpr Region(int32_t minsx, int32_t minsy, int32_t minsz, int32_t maxsx, int32_t maxsy, int32_t maxsz);
constexpr Region(int mins, int maxs);
static const Region InvalidRegion;
/// Equality Operator.
bool operator==(const Region& rhs) const;
/// Inequality Operator.
bool operator!=(const Region& rhs) const;
/// Moves the Region by the amount specified.
/** Moves the Region by the amount specified. */
Region& operator+=(const glm::ivec3& amount);
/// Gets the 'x' position of the centre.
/** Gets the 'x' position of the centre. */
int32_t getCenterX() const;
/// Gets the 'y' position of the centre.
/** Gets the 'y' position of the centre. */
int32_t getCenterY() const;
/// Gets the 'z' position of the centre.
/** Gets the 'z' position of the centre. */
int32_t getCenterZ() const;
/// Gets the 'x' position of the lower corner.
/** Gets the 'x' position of the lower corner. */
int32_t getLowerX() const;
/// Gets the 'y' position of the lower corner.
/** Gets the 'y' position of the lower corner. */
int32_t getLowerY() const;
/// Gets the 'z' position of the lower corner.
/** Gets the 'z' position of the lower corner. */
int32_t getLowerZ() const;
/// Gets the 'x' position of the upper corner.
/** Gets the 'x' position of the upper corner. */
int32_t getUpperX() const;
/// Gets the 'y' position of the upper corner.
/** Gets the 'y' position of the upper corner. */
int32_t getUpperY() const;
/// Gets the 'z' position of the upper corner.
/** Gets the 'z' position of the upper corner. */
int32_t getUpperZ() const;
/// Gets the centre of the region
/** Gets the centre of the region */
const glm::ivec3& getCenter() const;
glm::vec3 getCenterf() const;
/// Gets the position of the lower corner.
/** Gets the position of the lower corner. */
const glm::ivec3& getLowerCorner() const;
/// Gets the position of the upper corner.
/** Gets the position of the upper corner. */
const glm::ivec3& getUpperCorner() const;
glm::vec3 getLowerCornerf() const;
@ -87,88 +82,88 @@ public:
glm::ivec3 getRandomPosition(math::Random& random) const;
/// Gets the width of the region measured in voxels.
/** Gets the width of the region measured in voxels. */
int32_t getWidthInVoxels() const;
/// Gets the height of the region measured in voxels.
/** Gets the height of the region measured in voxels. */
int32_t getHeightInVoxels() const;
/// Gets the depth of the region measured in voxels.
/** Gets the depth of the region measured in voxels. */
int32_t getDepthInVoxels() const;
/// Gets the dimensions of the region measured in voxels.
/** Gets the dimensions of the region measured in voxels. */
const glm::ivec3& getDimensionsInVoxels() const;
/// Gets the width of the region measured in cells.
/** Gets the width of the region measured in cells. */
int32_t getWidthInCells() const;
/// Gets the height of the region measured in cells.
/** Gets the height of the region measured in cells. */
int32_t getHeightInCells() const;
/// Gets the depth of the region measured in cells.
/** Gets the depth of the region measured in cells. */
int32_t getDepthInCells() const;
/// Gets the dimensions of the region measured in cells.
/** Gets the dimensions of the region measured in cells. */
const glm::ivec3& getDimensionsInCells() const;
/// Sets the 'x' position of the lower corner.
/** Sets the 'x' position of the lower corner. */
void setLowerX(int32_t x);
/// Sets the 'y' position of the lower corner.
/** Sets the 'y' position of the lower corner. */
void setLowerY(int32_t y0f128);
/// Sets the 'z' position of the lower corner.
/** Sets the 'z' position of the lower corner. */
void setLowerZ(int32_t z);
/// Sets the 'x' position of the upper corner.
/** Sets the 'x' position of the upper corner. */
void setUpperX(int32_t x);
/// Sets the 'y' position of the upper corner.
/** Sets the 'y' position of the upper corner. */
void setUpperY(int32_t y);
/// Sets the 'z' position of the upper corner.
/** Sets the 'z' position of the upper corner. */
void setUpperZ(int32_t z);
glm::ivec3 moveInto(int32_t x, int32_t y, int32_t z) const;
/// Sets the position of the lower corner.
/** Sets the position of the lower corner. */
void setLowerCorner(const glm::ivec3& mins);
/// Sets the position of the upper corner.
/** Sets the position of the upper corner. */
void setUpperCorner(const glm::ivec3& maxs);
/// Tests whether the given point is contained in this Region.
/** Tests whether the given point is contained in this Region. */
bool containsPoint(float fX, float fY, float fZ, float boundary = 0.0f) const;
/// Tests whether the given point is contained in this Region.
/** Tests whether the given point is contained in this Region. */
bool containsPoint(const glm::vec3& pos, float boundary = 0.0f) const;
/// Tests whether the given point is contained in this Region.
/** Tests whether the given point is contained in this Region. */
bool containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary = 0) const;
/// Tests whether the given point is contained in this Region.
/** Tests whether the given point is contained in this Region. */
bool containsPoint(const glm::ivec3& pos, uint8_t boundary = 0) const;
/// Tests whether the given position is contained in the 'x' range of this Region.
/** Tests whether the given position is contained in the 'x' range of this Region. */
bool containsPointInX(float pos, float boundary = 0.0f) const;
/// Tests whether the given position is contained in the 'x' range of this Region.
/** Tests whether the given position is contained in the 'x' range of this Region. */
bool containsPointInX(int32_t pos, uint8_t boundary = 0) const;
/// Tests whether the given position is contained in the 'y' range of this Region.
/** Tests whether the given position is contained in the 'y' range of this Region. */
bool containsPointInY(float pos, float boundary = 0.0f) const;
/// Tests whether the given position is contained in the 'y' range of this Region.
/** Tests whether the given position is contained in the 'y' range of this Region. */
bool containsPointInY(int32_t pos, uint8_t boundary = 0) const;
/// Tests whether the given position is contained in the 'z' range of this Region.
/** Tests whether the given position is contained in the 'z' range of this Region. */
bool containsPointInZ(float pos, float boundary = 0.0f) const;
/// Tests whether the given position is contained in the 'z' range of this Region.
/** Tests whether the given position is contained in the 'z' range of this Region. */
bool containsPointInZ(int32_t pos, uint8_t boundary = 0) const;
/// Tests whether the given Region is contained in this Region.
/** Tests whether the given Region is contained in this Region. */
bool containsRegion(const Region& reg, uint8_t boundary = 0) const;
/// Enlarges the Region so that it contains the specified position.
/** Enlarges the Region so that it contains the specified position. */
void accumulate(int32_t iX, int32_t iY, int32_t iZ);
/// Enlarges the Region so that it contains the specified position.
/** Enlarges the Region so that it contains the specified position. */
void accumulate(const glm::ivec3& v3dPos);
/// Enlarges the Region so that it contains the specified Region.
/** Enlarges the Region so that it contains the specified Region. */
void accumulate(const Region& reg);
/// Crops the extents of this Region according to another Region.
/** Crops the extents of this Region according to another Region. */
void cropTo(const Region& other);
/// Grows this region by the amount specified.
/** Grows this region by the amount specified. */
void grow(int32_t amount);
/// Grows this region by the amounts specified.
/** Grows this region by the amounts specified. */
void grow(int32_t amountX, int32_t amountY, int32_t amountZ);
/// Grows this region by the amounts specified.
/** Grows this region by the amounts specified. */
void grow(const glm::ivec3& v3dAmount);
/// Tests whether all components of the upper corner are at least
/// as great as the corresponding components of the lower corner.
/** Tests whether all components of the upper corner are at least
* as great as the corresponding components of the lower corner. */
bool isValid() const;
/**
@ -177,24 +172,24 @@ public:
int voxels() const;
int stride() const;
/// Moves the Region by the amount specified.
/** Moves the Region by the amount specified. */
void shift(int32_t amountX, int32_t amountY, int32_t amountZ);
/// Moves the Region by the amount specified.
/** Moves the Region by the amount specified. */
void shift(const glm::ivec3& v3dAmount);
/// Moves the lower corner of the Region by the amount specified.
/** Moves the lower corner of the Region by the amount specified. */
void shiftLowerCorner(int32_t x, int32_t y, int32_t z);
/// Moves the lower corner of the Region by the amount specified.
/** Moves the lower corner of the Region by the amount specified. */
void shiftLowerCorner(const glm::ivec3& v3dAmount);
/// Moves the upper corner of the Region by the amount specified.
/** Moves the upper corner of the Region by the amount specified. */
void shiftUpperCorner(int32_t x, int32_t y, int32_t z);
/// Moves the upper corner of the Region by the amount specified.
/** Moves the upper corner of the Region by the amount specified. */
void shiftUpperCorner(const glm::ivec3& v3dAmount);
/// Shrinks this region by the amount specified.
/** Shrinks this region by the amount specified. */
void shrink(int32_t amount);
/// Shrinks this region by the amounts specified.
/** Shrinks this region by the amounts specified. */
void shrink(int32_t amountX, int32_t amountY, int32_t amountZ);
/// Shrinks this region by the amounts specified.
/** Shrinks this region by the amounts specified. */
void shrink(const glm::ivec3& v3dAmount);
core::String toString() const;
@ -342,34 +337,34 @@ inline void Region::setLowerY(int32_t y) {
}
/**
* @param iZ The new 'z' position of the lower corner.
* @param z The new 'z' position of the lower corner.
*/
inline void Region::setLowerZ(int32_t iZ) {
_mins.z = iZ;
inline void Region::setLowerZ(int32_t z) {
_mins.z = z;
update();
}
/**
* @param iX The new 'x' position of the upper corner.
* @param x The new 'x' position of the upper corner.
*/
inline void Region::setUpperX(int32_t iX) {
_maxs.x = iX;
inline void Region::setUpperX(int32_t x) {
_maxs.x = x;
update();
}
/**
* @param iY The new 'y' position of the upper corner.
* @param y The new 'y' position of the upper corner.
*/
inline void Region::setUpperY(int32_t iY) {
_maxs.y = iY;
inline void Region::setUpperY(int32_t y) {
_maxs.y = y;
update();
}
/**
* @param iZ The new 'z' position of the upper corner.
* @param z The new 'z' position of the upper corner.
*/
inline void Region::setUpperZ(int32_t iZ) {
_maxs.z = iZ;
inline void Region::setUpperZ(int32_t z) {
_maxs.z = z;
update();
}

View File

@ -1,5 +1,7 @@
/**
* @file
* @defgroup Voxel
* @{
*/
#pragma once
@ -7,6 +9,9 @@
#include <stdint.h>
#include "core/ArrayLength.h"
/**
* Voxel manipulation, meshing and storage
*/
namespace voxel {
/**
@ -177,3 +182,7 @@ inline bool isFloor(VoxelType material) {
}
}
/**
* @}
*/

View File

@ -19,7 +19,13 @@
#include <glm/gtx/rotate_vector.hpp>
#include <stack>
/**
* Voxel generators
*/
namespace voxelgenerator {
/**
* L-System
*/
namespace lsystem {
struct TurtleStep {
@ -36,6 +42,9 @@ struct Rule {
extern bool parseRules(const core::String& rulesStr, std::vector<Rule>& rules);
/**
* @brief Generate voxels according to the given L-System rules
*/
template<class Volume>
void generate(Volume& volume, const glm::ivec3& position, const core::String &axiom, const std::vector<Rule> &rules, float angle, float length, float width,
float widthIncrement, uint8_t iterations, math::Random& random, float leafRadius = 8.0f) {

View File

@ -8,6 +8,9 @@
#include "voxel/RawVolumeWrapper.h"
namespace voxelgenerator {
/**
* Noise
*/
namespace noise {
enum class NoiseType {

View File

@ -15,6 +15,9 @@
#include "core/Log.h"
namespace voxelgenerator {
/**
* Tree generators
*/
namespace tree {
/**

View File

@ -25,6 +25,9 @@ namespace video {
class Camera;
}
/**
* Basic voxel rendering
*/
namespace voxelrender {
/**

View File

@ -1,6 +1,6 @@
/**
* @file
* @defgroup Voxel
* @defgroup VoxelWorld
* @{
* @}
*/
@ -16,11 +16,14 @@
#include "math/Random.h"
#include <memory>
/**
* World creation, persisting and streaming
*/
namespace voxelworld {
/**
* @brief The WorldMgr class is responsible to maintaining the voxel volumes and handle the needed mesh extraction
* @ingroup Voxel
* @ingroup VoxelWorld
*/
class WorldMgr {
public:

View File

@ -23,6 +23,9 @@
#include "video/UniformBuffer.h"
#include "voxel/PagedVolume.h"
/**
* World rendering
*/
namespace voxelworldrender {
/**

View File

@ -3,102 +3,105 @@
These tests are dedicated test applications. They are no unit tests.
Unit tests are in their own module and available via
```
```bash
make tests
```
Run these test applications with
```
```bash
make __directoryname__-run
```
# testanimation
## testanimation
Test the voxel animation module with a default character and items of the stock module.
See [README.md](testanimation/README.md) for more details.
# testimgui
## testimgui
Test the dearimgui integration
# testglslgeom
## testglslgeom
Test geometry shader integration
# testnuklear
## testnuklear
Test the nuklear imgui integration
# testcomputetexture3d
## testcomputetexture3d
Test the OpenCL 3d texture integration of a 3d voxel volume (rendered as 2d side view)
# testvoxelgpu
## testvoxelgpu
OpenCL mesh extraction - not finished yet.
# testdepthbuffer
## testdepthbuffer
Test the depth buffer integration with shadow maps and debug renderings
# testtexture
## testtexture
Renders a test 2d image.
# testmesh
## testmesh
Render a mesh with shadows and bones and normals.
# testcamera
## testcamera
Test camera options and collisions.
# testvoxelfont
## testvoxelfont
Display a true type font as 3d voxel volume.
# testplane
## testplane
Renders a plane object.
# testshapebuilder
# testoctree
## testshapebuilder
## testoctree
Renders the octree internals.
# testglslcomp
## testglslcomp
Uses GLSL compute shader to render a circle.
# testgpumc
## testgpumc
Conversion of OpenCL marching cubes taken from: https://github.com/smistad/GPU-Marching-Cubes.git
Conversion of OpenCL marching cubes taken from: <https://github.com/smistad/GPU-Marching-Cubes.git>
# testturbobadger
## testturbobadger
Renders the turbobadger demo.
# testluaui
## testluaui
Test the nuklear lua ui binding
# testoctreevisit
## testoctreevisit
Visit the frustum in the octree.
# testtemplate
## testtemplate
Just an empty template for new test applications.
# testtraze
## testtraze
* [traze client](testtraze/README.md)
# testhttpserver
## testhttpserver
A test application around the http module server for e.g. fuzzy testing purposes.
# testbiomes
## testbiomes
A test application that just visualizes the biomes.

View File

@ -1,4 +1,4 @@
# Purpose
# Animation test tool
The test application can cycle through all animations and entity types. It helps to visualize
the skeletal animation states of the entities in the game.

View File

@ -1,3 +1,3 @@
# Purpose
# Biome rendering test tool
This test application will render the biomes as a 2d map including temperature and humidity

View File

@ -2,11 +2,12 @@
This tool parses OpenCL shader files (`*.cl`) and generates C++ source files for them.
# Description
## Description
The generator uses `ComputeShaderTemplate.h.in` and generates the files by doing some string replacements.
There are several variables in the template file that are replaced by the generator.
* `$includes$`
* `$namespace$`
* `$name$`

View File

@ -1,6 +1,6 @@
# Databasetool
## Table descriptions for the databasetool.
## Table descriptions for the databasetool
The databasetool binary will generate model files for the
table definitions given in `*.tbl` files. You can specify the fields,
@ -11,7 +11,7 @@ To add a new `*.tbl` file to a module and automatically generate code
for that table definition, you have to add the following after your
cmake `add_library(${LIB} ${SRCS})` call:
```
```cmake
generate_db_models(${LIB} ${CMAKE_CURRENT_SOURCE_DIR}/tables.tbl ExampleModels.h)
```
@ -55,16 +55,17 @@ table <TABLENAME> {
```
## Valid field types
* password
* string
* text
* int
* long
* timestamp
* boolean
* short
* byte
* blob
* `password`
* `string`
* `text`
* `int`
* `long`
* `timestamp`
* `boolean`
* `short`
* `byte`
* `blob`
## Operator
@ -78,10 +79,12 @@ the operator specified. The default operator is `set`. See a full list
of valid operators below.
## Valid operators
* set
* add
* subtract
* `set`
* `add`
* `subtract`
## Other notable features
* Timestamps are handled in UTC.
* When using `ìnt` or `short` as a field type, there is also a setter configured that accepts enums.

View File

@ -1,8 +1,8 @@
# Remote AI Debugger
This application is part of the `simpleai` library. Find more documentation here: http://mgerhardy.github.io/simpleai
This application is part of the `simpleai` library. Find more documentation here: <http://mgerhardy.github.io/simpleai>
# Compile
## Compile
To compile this on a debian based linux, you will need
some qt related packages installed:

View File

@ -1,8 +1,8 @@
# ShaderTool
This tool parses GLSL shader files (mainly *.vert, *.frag) and generates C++ source files for them.
This tool parses GLSL shader files (mainly `*.vert`, `*.frag`) and generates C++ source files for them.
# Description
## Description
The generator uses `ShaderTemplate.h.in` and `UniformBufferTemplate.h.in` as a base to generat the C++ source files.

View File

@ -9,10 +9,10 @@ that must be installed in `/usr/share/mime/packages` and `/usr/share/thumbnailer
It works for any file manager that supports `.thumbnailer` entries, including Nautilus, Thunar (when tumbler is installed), Nemo, Caja,
and PCManFM.
```
```bash
for i in $(find $HOME/dev/engine -name "*.vox" -or -name "*.cub" -or -name "*.qbt" -or -name "*.qb" -or -name "*.vxm"); do
fullpath=$(readlink -f $i)
md5=$(echo -n "file://$fullpath" | md5sum -z | awk ' { print $1.".png" }')
vengi-thumbnailer -s 128 $i $HOME/.cache/thumbnails/large/$md5
fullpath=$(readlink -f $i)
md5=$(echo -n "file://$fullpath" | md5sum -z | awk ' { print $1.".png" }')
vengi-thumbnailer -s 128 $i $HOME/.cache/thumbnails/large/$md5
done
```

View File

@ -13,7 +13,6 @@ my own engine and evolved into something that others might find useful, too.
![image](https://raw.githubusercontent.com/wiki/mgerhardy/engine/images/voxedit-quad-view.png)
## Features
* Large scene support
@ -59,27 +58,27 @@ my own engine and evolved into something that others might find useful, too.
## Planned
* SceneSettings dialog
- Change sun angles
* Change sun angles
* Voxel to transparency with a HSV threshold
* Selections
- Multiple AABBs should be possible
- Deselect of single voxels
- Delete, move, rotate, modify only in active selection
* Multiple AABBs should be possible
* Deselect of single voxels
* Delete, move, rotate, modify only in active selection
* Copy/paste
- Paste into selection of a different size? Accept with enter after moving?
* Paste into selection of a different size? Accept with enter after moving?
* Color selection via keyboard only
- Shortcut for enter-color-in-the-next second and index of the colormap?
- Relative movement from current color
* Shortcut for enter-color-in-the-next second and index of the colormap?
* Relative movement from current color
* Improve Windows and MacOSX support
* Extend palette widget to show the used colors
* Add color dialog for ambient and diffuse color
* Extrude
* Improve vox extension import
* Rigging support
- Gizmo for rotate, scale and move
- Scene graph
- File format (maybe vox with extension?)
- UI for key frames (timeline)
* Gizmo for rotate, scale and move
* Scene graph
* File format (maybe vox with extension?)
* UI for key frames (timeline)
* Physics
* Particle emitter

View File

@ -11,7 +11,8 @@
#include "RenderShaders.h"
/**
* @brief Scene management like input, ui and rendering.
* @brief Voxel editor scene management like input, ui and rendering.
* @see voxedit::ViewportController
*/
class Viewport: public ui::turbobadger::Widget {
private: