Skip to content
/ dreg Public

General purpose driving physics engine

Notifications You must be signed in to change notification settings

UO269984/dreg

Repository files navigation

Dreg logo

Dreg is a general purpose driving physics engine, in other words, a self contained library capable of simulating the physics of a wheeled vehicle, which can be used from any programming language and in any development environment.

Dreg tries to be a cross-platform library, at the moment it supports running on Windows, Linux, Web (via Wasm) and Android.

It allows configuring the vehicle in a pretty flexible way, allowing to define some parameters as 2D graphs. This editor simplifies the task of creating a configuration.

A set of performance tests is also included to measure the library performance on any platform. The binaries of these tests can be found in the latest release, or can be built as shown below. The web version is available to run at this link.
Notice: Before running the tests on Windows, run chcp 65001 in the terminal where you are going to run the tests to set the right encoding.

Build project

The build system is based on a set of Makefiles. It uses GCC to build the Linux version, mingw64 for Windows, Emscripten for WebAssembly and NDK for Android. To build the Linux version Clang has also been tested, showing a bit more performance than GCC. It can be used by adding CXX=clang as a parameter in the make command.

Although no more C++ compilers have been tested apart from those mentioned above, others outside of that list may also work, as Dreg does not rely on any compiler specific feature.

To link all subprojects that Dreg is made of, system symbolic links are used. Those links have to be created before compiling or running the project. To create them automatically run make configure in the project root folder.

make configure #Configure symbolic links between subprojects
make all #Build all subprojects

After build, the Dreg libraries for all platforms are placed in the engine/build folder. The build also generates executables to run the unit and performance tests in the folders test/unit and test/performace. After the build, the editor is also ready to be hosted as a web in the folder configEditor/web.

Examples

In this repo you can find an interactive vehicle demo developed in Unity.

Name origin

The name Dreg comes from mixing letters from driving engine. This is a short, simple and easy to remember word, but in addition, it's a play on words, since Dreg is a small variation of the drag word, referring to vehicle aerodynamic drag.