bullet3/README.md

120 lines
5.3 KiB
Markdown
Raw Normal View History

2015-05-27 23:12:45 +00:00
[![Travis Build Status](https://api.travis-ci.org/bulletphysics/bullet3.png?branch=master)](https://travis-ci.org/bulletphysics/bullet3)
2014-08-29 06:02:19 +00:00
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/6sly9uxajr6xsstq)](https://ci.appveyor.com/project/erwincoumans/bullet3)
2014-07-11 20:21:00 +00:00
2016-10-16 17:27:32 +00:00
# Bullet Physics SDK
2014-01-14 17:37:28 +00:00
2016-11-07 16:42:39 +00:00
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.
2016-10-16 17:27:32 +00:00
2018-01-04 03:30:12 +00:00
New in Bullet 2.85: pybullet Python bindings, improved support for robotics and VR. Use pip install pybullet and see [PyBullet Quickstart Guide](https://docs.google.com/document/d/10sXEhzFRSnvFcl3XxNGhnD4N2SedqwdAvK3dsihxVUA/edit#heading=h.2ye70wns7io3).
2014-01-14 17:37:28 +00:00
2016-10-06 00:22:35 +00:00
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:
2015-03-01 18:30:20 +00:00
2015-08-11 16:15:06 +00:00
1. The old Bullet2 demos are being merged into the examples/ExampleBrowser
2016-10-06 00:22:35 +00:00
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
2014-01-14 17:37:28 +00:00
2015-04-20 13:23:07 +00:00
You can still use svn or svn externals using the github git repository: use svn co https://github.com/bulletphysics/bullet3/trunk
2014-01-14 17:37:28 +00:00
2015-03-01 18:30:20 +00:00
## 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.
2015-04-23 21:48:33 +00:00
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
2016-10-16 17:27:32 +00:00
## Requirements for experimental OpenCL GPGPU support
2015-03-01 18:30:20 +00:00
2016-10-16 17:27:32 +00:00
The entire collision detection and rigid body dynamics can be executed on the GPU.
2014-10-27 13:01:05 +00:00
2015-08-11 16:17:42 +00:00
A high-end desktop GPU, such as an AMD Radeon 7970 or NVIDIA GTX 680 or better.
2014-01-14 17:37:28 +00:00
We succesfully tested the software under Windows, Linux and Mac OSX.
The software currently doesn't work on OpenCL CPU devices. It might run
2016-06-15 00:36:10 +00:00
on a laptop GPU but performance will not likely be very good. Note that
2015-08-11 16:17:42 +00:00
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.
2014-01-14 17:37:28 +00:00
2014-10-27 13:01:05 +00:00
## License
2014-01-14 17:37:28 +00:00
All source code files are licensed under the permissive zlib license
(http://opensource.org/licenses/Zlib) unless marked differently in a particular folder/file.
2015-08-11 16:15:06 +00:00
## Build instructions for Bullet using premake. You can also use cmake instead.
2014-10-27 13:01:05 +00:00
**Windows**
2014-01-14 17:37:28 +00:00
2017-02-22 20:34:02 +00:00
Click on build_visual_studio_vr_pybullet_double.bat and open build3/vs2010/0MySolution.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.
2014-01-14 17:37:28 +00:00
2016-10-06 00:25:49 +00:00
**Windows Virtual Reality sandbox for HTC Vive and Oculus Rift**
2016-10-06 00:22:35 +00:00
2016-10-06 00:25:49 +00:00
Build and run the App_SharedMemoryPhysics_VR project, preferably in Release/optimized build.
2016-10-06 00:22:35 +00:00
You can connect from Python pybullet to the sandbox using:
```
import pybullet as p
2017-02-22 20:34:02 +00:00
p.connect(p.SHARED_MEMORY) #or (p.TCP, "localhost", 6667) or (p.UDP, "192.168.86.10",1234)
2016-10-06 00:22:35 +00:00
```
2014-10-27 13:01:05 +00:00
**Linux and Mac OSX gnu make**
2017-02-22 20:34:02 +00:00
Make sure cmake is installed (sudo apt-get install cmake, brew install cmake, or https://cmake.org)
2014-01-14 17:37:28 +00:00
In a terminal type:
2017-02-22 20:34:02 +00:00
./build_cmake_pybullet_double.sh
2014-01-14 17:37:28 +00:00
2017-02-22 20:34:02 +00:00
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.
2014-01-14 17:37:28 +00:00
2017-02-28 03:11:24 +00:00
You can also build Bullet using premake. There are premake executables in the build3 folder.
2017-02-22 20:34:02 +00:00
Depending on your system (Linux 32bit, 64bit or Mac OSX) use one of the following lines
Using premake:
2017-02-22 20:35:24 +00:00
```
2017-02-22 20:34:02 +00:00
cd build3
./premake4_linux --double gmake
./premake4_linux64 --double gmake
./premake4_osx --double --enable_pybullet gmake
2017-02-22 20:35:24 +00:00
```
2014-01-14 17:37:28 +00:00
Then
2017-02-22 20:35:24 +00:00
```
2014-10-27 13:01:05 +00:00
cd gmake
make
2017-02-22 20:35:24 +00:00
```
2017-02-22 20:34:02 +00:00
2017-02-28 03:11:24 +00:00
Note that on Linux, you need to use cmake to build pybullet, since the compiler has issues of mixing shared and static libraries.
2014-10-27 13:01:05 +00:00
**Mac OSX Xcode**
2014-01-14 17:37:28 +00:00
Click on build3/xcode4.command or in a terminal window execute
2014-10-27 13:01:05 +00:00
./premake_osx xcode4
2014-01-14 17:37:28 +00:00
2014-10-27 13:01:05 +00:00
## Usage
2014-01-14 17:37:28 +00:00
2015-08-11 16:15:06 +00:00
The App_ExampleBrowser executables will be located in the bin folder.
2014-01-14 17:37:28 +00:00
You can just run it though a terminal/command prompt, or by clicking it.
2014-10-27 19:18:03 +00:00
```
2015-08-11 16:15:06 +00:00
[--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
2016-08-23 04:05:04 +00:00
[--background_color_red= 0.9] Set the red component for background color. Same for green and blue
2015-08-11 16:15:06 +00:00
[--fixed_timestep= 0.0] Use either a real-time delta time (0.0) or a fixed step size (0.016666)
2014-10-27 19:18:03 +00:00
```
2014-01-14 17:37:28 +00:00
2016-06-15 00:36:10 +00:00
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.
2014-01-14 17:37:28 +00:00
2016-10-16 17:27:32 +00:00
Check out the docs folder and the Bullet physics forums for further information.