Skip to content
Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
C++ C CMake Lua Python Objective-C Other
Branch: master
Clone or download
erwincoumans Merge pull request #2641 from erwincoumans/master
fix memleak due to custom container, release memory of m_deformableBodySolver in ClothFriction demo
Latest commit dc11c43 Feb 22, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.ci Run apt-get update before installing python3-pip Jul 10, 2018
Extras fix obj2sdf mergeMaterial Jan 31, 2020
build3 premake add enable_stable_pd option, so Bullet can be compiled withou… Aug 8, 2019
data unsupported: expose collisionMargin to changeDynamics/getDynamicsInfo. Feb 15, 2020
docs update PyBullet quickstart guide.pdf Dec 21, 2019
examples release memory of m_deformableBodySolver in ClothFriction demo. Feb 22, 2020
src fix memory leak due to custom container not handling copy operator fo… Feb 22, 2020
test allow to compile using clang-cl on visual studio (disable SSE) Dec 11, 2019
.gitignore Merge pull request #2505 from stephenjust/update-gitignore Nov 29, 2019
.style.yapf add yapf style and apply yapf to format all Python files Apr 27, 2019
.travis.yml Add Travis CI settings for Xenial and Bionic Jul 10, 2018
AUTHORS.txt add a few more contributors (the list is far from complete though) Sep 24, 2017
BulletConfig.cmake.in Revert "Export targets in CMake and add include directories to target… Sep 11, 2017
CMakeLists.txt remove unused custom vector math cmake option Dec 31, 2019
Doxyfile add Doxyfile May 1, 2015
LICENSE.txt add latex source of Bullet 2.82 quickstart guide, todo: update to cur… Apr 29, 2015
MANIFEST.in create some 'Unity Build' cpp files, to work-around setuptools on Win… Jan 24, 2019
README.md Update README.md Nov 19, 2019
UseBullet.cmake fix make install, when using CMake Mar 6, 2014
VERSION bump up to Bullet version 2.89 and update serialization structures Oct 30, 2019
_clang-format clang-format pybullet.c Mar 13, 2017
appveyor.yml Update appveyor.yml Sep 11, 2016
build_cmake_pybullet_double.sh fixes in PyBullet deep_mimic to allow running in pip version Feb 11, 2019
build_visual_studio_vr_pybullet_double.bat tweak premake4 default batch file. Dec 12, 2019
build_visual_studio_vr_pybullet_double_cmake.bat trigger appveyor/travis tests Sep 11, 2017
build_visual_studio_without_pybullet_vr.bat Created Wavefront obj to sdf converter, to make it easier to import c… Mar 1, 2017
bullet.pc.cmake Update bullet.pc.cmake Nov 19, 2019
clang-format-all.sh apply clang-format (on Mac, slightly different than running it on Win… Sep 30, 2018
setup.py bump up pybullet version to 2.6.6 Feb 21, 2020
xcode.command move some easy-to-use build files for Mac OSX, Linux and Windows May 21, 2016

README.md

Travis Build Status Appveyor Build status

Bullet Physics SDK

This is the official C++ source code repository of the Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.

PyBullet

New in Bullet 2.85: pybullet Python bindings, improved support for robotics and VR. Use pip install pybullet and checkout the PyBullet Quickstart Guide.

If you use PyBullet in your research, please cite it like this:

@MISC{coumans2019,
author =   {Erwin Coumans and Yunfei Bai},
title =    {PyBullet, a Python module for physics simulation for games, robotics and machine learning},
howpublished = {\url{http://pybullet.org}},
year = {2016--2019}
}

The Bullet 2 API will stay default and up-to-date while slowly moving to a new API. The steps towards a new API is in a nutshell:

  1. The old Bullet2 demos are being merged into the examples/ExampleBrowser
  2. A new physics-engine agnostic C-API is created, see examples/SharedMemory/PhysicsClientC_API.h
  3. Python bindings in pybullet are on top of this C-API, see examples/pybullet
  4. A Virtual Reality sandbox using openvr for HTC Vive and Oculus Rift is available
  5. The OpenCL examples in the ExampleBrowser can be enabled using --enable_experimental_opencl

You can still use svn or svn externals using the github git repository: use svn co https://github.com/bulletphysics/bullet3/trunk

Requirements for Bullet 2

A C++ compiler for C++ 2003. The library is tested on Windows, Linux, Mac OSX, iOS, Android, but should likely work on any platform with C++ compiler. Some optional demos require OpenGL 2 or OpenGL 3, there are some non-graphical demos and unit tests too.

Contributors and Coding Style information

https://docs.google.com/document/d/1u9vyzPtrVoVhYqQOGNWUgjRbfwfCdIts_NzmvgiJ144/edit

Requirements for experimental OpenCL GPGPU support

The entire collision detection and rigid body dynamics can be executed on the GPU.

A high-end desktop GPU, such as an AMD Radeon 7970 or NVIDIA GTX 680 or better. We succesfully tested the software under Windows, Linux and Mac OSX. The software currently doesn't work on OpenCL CPU devices. It might run on a laptop GPU but performance will not likely be very good. Note that often an OpenCL drivers fails to compile a kernel. Some unit tests exist to track down the issue, but more work is required to cover all OpenCL kernels.

License

All source code files are licensed under the permissive zlib license (http://opensource.org/licenses/Zlib) unless marked differently in a particular folder/file.

Build instructions for Bullet using vcpkg

You can download and install Bullet using the vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
vcpkg install bullet3

The Bullet port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Build instructions for Bullet using premake. You can also use cmake instead.

Windows

Click on build_visual_studio_vr_pybullet_double.bat and open build3/vs2010/0_Bullet3Solution.sln When asked, convert the projects to a newer version of Visual Studio. If you installed Python in the C:\ root directory, the batch file should find it automatically. Otherwise, edit this batch file to choose where Python include/lib directories are located.

Windows Virtual Reality sandbox for HTC Vive and Oculus Rift

Build and run the App_SharedMemoryPhysics_VR project, preferably in Release/optimized build. You can connect from Python pybullet to the sandbox using:

import pybullet as p
p.connect(p.SHARED_MEMORY) #or (p.TCP, "localhost", 6667) or (p.UDP, "192.168.86.10",1234)

Linux and Mac OSX gnu make

Make sure cmake is installed (sudo apt-get install cmake, brew install cmake, or https://cmake.org)

In a terminal type:

./build_cmake_pybullet_double.sh

This script will invoke cmake and build in the build_cmake directory. You can find pybullet in Bullet/examples/pybullet. The BulletExampleBrowser binary will be in Bullet/examples/ExampleBrowser.

You can also build Bullet using premake. There are premake executables in the build3 folder. Depending on your system (Linux 32bit, 64bit or Mac OSX) use one of the following lines Using premake:

	cd build3
	./premake4_linux --double gmake
	./premake4_linux64 --double gmake
	./premake4_osx --double --enable_pybullet gmake

Then

	cd gmake
	make

Note that on Linux, you need to use cmake to build pybullet, since the compiler has issues of mixing shared and static libraries.

Mac OSX Xcode

Click on build3/xcode4.command or in a terminal window execute

./premake_osx xcode4

Usage

The App_ExampleBrowser executables will be located in the bin folder. You can just run it though a terminal/command prompt, or by clicking it.

[--start_demo_name="Demo Name"]     Start with a selected demo  
[--mp4=moviename.mp4]               Create a mp4 movie of the window, requires ffmpeg installed
[--mouse_move_multiplier=0.400000]  Set the mouse move sensitivity
[--mouse_wheel_multiplier=0.01]     Set the mouse wheel sensitivity
[--background_color_red= 0.9]       Set the red component for background color. Same for green and blue
[--fixed_timestep= 0.0]             Use either a real-time delta time (0.0) or a fixed step size (0.016666)

You can use mouse picking to grab objects. When holding the ALT or CONTROL key, you have Maya style camera mouse controls. Press F1 to create a series of screenshots. Hit ESCAPE to exit the demo app.

Check out the docs folder and the Bullet physics forums for further information.

You can’t perform that action at this time.