Skip to content

bullet-physics-playground/bpp

Repository files navigation

The Bullet Physics Playground

A simple physics simulation software for prototyping and experimenting with the Bullet Physics library. It provides a graphical user interface (GUI) for real-time interaction and a command-line interface (CLI) for batch processing and scripting.

Features

  • Physics Simulation: Powered by the robust and widely-used Bullet Physics library.
  • Cross-Platform: Builds and runs on Linux, Windows, and macOS.
  • GUI: An OpenGL-based GUI for visualizing and interacting with the simulations in real-time.
  • Scripting: Extend and control simulations using Lua scripting.
  • Import/Export:
    • Import models from OpenSCAD.
    • Export scenes to POV-Ray for high-quality rendering.
  • Command-Line Interface: A powerful CLI for running simulations, rendering animations, and piping data to other tools like gnuplot.

Videos on YouTube

Bullet Physics Playground

Build

Select your operating system:

Usage

GUI

  • S: Start/stop the physics simulation.
  • P: Toggle POV-Ray export mode.
  • G: Toggle PNG screenshot saving mode.
  • A: Toggle display of the world axis.
  • F: Toggle FPS display.
  • Enter: Start/stop the animation.
  • Space: Toggle between fly and revolve camera modes.
  • Arrow Keys: Move the camera.
  • H: Show the QGLViewer help window.

Command-Line

The command-line interface allows you to run simulations without the GUI. For example, you can pipe the simulation data to gnuplot to visualize the results:

bpp -n 200 -f demo/basic/01-hello-cmdline.lua | \
    gnuplot -e "set terminal dumb; plot for[col=3:3] '/dev/stdin' using 1:col title columnheader(col) with lines"

Scripting

The Bullet Physics Playground can be scripted with Lua. You can find several example scripts in the demo directory. To see a list of Lua-accessible classes, functions, and properties, run:

bpp -f demo/basic/02-luabind.lua

Documentation

The project uses Doxygen to generate documentation from the source code comments. To generate the documentation, run:

doxygen Doxyfile

The generated HTML documentation will be in the html directory.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue on the GitHub repository.

License

The Bullet Physics Playground is licensed under the GNU Lesser General Public License.

Acknowledgments