Awesome
Edyn Testbed
Examples for the Edyn physics engine.
Dependencies:
- EnTT (installed via Conan)
- bgfx, bx and bimg are assumed to be cloned inside the same directory as edyn-testbed. This project is built using bgfx'es example framework thus it needs to be ran from the
bgfx/examples/runtime
directory to correctly load shaders and other files. In other words,bgfx/examples/runtime
must be the working directory. - Git LFS is needed to download the resource files. You might have to run
git lfs pull
to bring in the files.
Building
In the terminal, go into the edyn-testbed directory and do:
$ mkdir build
$ cd build
$ conan install ../conanfile.txt
$ cmake ..
$ make
You might have to tell CMake where to find the bgfx and Edyn libraries. For bgfx, just set Bgfx_LIBRARY_DIR
to the directory where the bgfx libraries are located and CMake should find and assign all of them.
Windows and Visual Studio 2019
After running cmake ..
, the Edyn.sln solution should be in the build directory. It's important to set the working directory by going to the EdynTestbed
target properties (Alt Enter
) and under Configuration Properties > Debugging > Working Directory
assign the bgfx examples runtime directory, such as $(ProjectDir)..\..\bgfx\examples\runtime
.
Sounds
Some samples include sound effects, played via SoLoud. To enable sounds, set the CMake option EDYN_SOUND_ENABLED
to true. You will have to link SoLoud
and SDL2
.
It uses these sounds from freesound:
- "Billiard balls single hit-dry.wav" by juskiddink (https://freesound.org/people/juskiddink/sounds/108615/) licensed under CCBYNC 3.0
- "big thud.wav" by Reitanna (https://freesound.org/people/Reitanna/sounds/332661/) licensed under CCBY 3.0
Networked physics
To build the networked physics samples, set the CMake option EDYN_BUILD_NETWORKING_EXAMPLE
to true and to build the server applications, set EDYN_BUILD_SERVER
to true. The networked physics samples and the servers need the ENet library.
The servers are separate applications. Each distinct networking sample has a server associated with it and the server must be running before the sample is selected in the sample browser so it can connect to server. If the server is running in a different machine, it's necessary to edit the host name is the calls to ExampleBasicNetworking::connectToServer
.
Running it
Press P
to pause/unpause the simulation. Press L
to step the simulation when paused.
https://user-images.githubusercontent.com/762769/148439511-9dad8f36-182c-43e7-af91-bdd43f430965.mp4
https://user-images.githubusercontent.com/762769/161366613-565b2dff-1d91-4fa1-8691-dbb5ae8abbff.mp4