BartaEngine
This is a c++ library which implements core features of a physics engine. The core concepts for now are:
- events handling system
- velocity calculation
- collision detection and collision responses
The project is open to collaboration at my GitHub account as there are plenty of ideas for new functionalities. This program is a base for my Master’s degree research about soft bodies simulation.
Table of Contents
- Installation
- Development
- Examples
Installation
Prerequisites
- C++20 Compiler: Ensure you have a compiler that supports C++20 (e.g., GCC 10+, Clang 10+, or MSVC 2019+).
- CMake: Required for building the project. Install the latest version from CMake.
- SFML 2.6.x: The project depends on SFML version 2.6.x.
Option 1: Use the library directly via FetchContent
Option 2: Use an existing template repository (recommended)
-
Clone the template repository
git clone https://github.com/Bartanakin/BartaEngineSandbox.git
-
Proceed if you want to develop BartaEngine as well
-
Clone this repository
git clone https://github.com/Bartanakin/BartaEngine.git
-
In BartaEngineSandbox in CMakeListst.txt in the root directory change FetchContent_Declare:
FetchContent_Declare(
BartaEngine
SOURCE_DIR /local/path/to/BartaEngine
)
Development
- To ensure your pull request passes the GitHub Actions checks, I recommend using clang-format 19 for code formatting. As for 20-11-2024 it is still unofficial version that you can download from here.
- All the current issues are at the Issues section.
- You can join the development community: write to me on Discord #Bartanakin or email me
[email protected]
Examples
1. Static simulation of a soft body
We import mesh of a pyramid consisting of 10 nodes where 5 of them are in the base of the shape. The base is constrained by the Dirichlet condition, namely we set the displacement to 0 in advance. On the topmost node there is a force applied in the x direction given by the formula:
$$
f_{\text{ext},x_0}(t) = 300(t - 3) \text{ for } t \in [0,3]
$$
where $t$ is the time of the simulation.
The rest of the nodes are unconstrained.

2. Dynamic simulation of a soft body
We import mesh of a pyramid consisting of 10 nodes where 5 of them are in the base of the shape. The base is constrained by the Dirichlet condition, namely we set the displacement to 0 in advance. On the topmost node there is a force applied in the x direction given by the formula:
$$
f_{\text{ext},x_0}(t) = \begin{cases}
-100 &\text{ for } t \in [0,3]\
0 &\text{ for } t \in (3, 6]
\end{cases}
$$
where $t$ is the time of the simulation.
The rest of the nodes are unconstrained.

评论