Getting Started with Bullet sdk

From Physics Simulation Wiki

Jump to: navigation, search



Welcome readers to the getting started page for Bullet physics sdk. This page will let beginners get started with the latest Bullet physics sdk.

Getting the Bullet SDK

There are several ways to obtain Bullet sdk. The simplest way is to head over to the Bullet github repository.

For beginners: Head over directly to the current stable release page, scroll down to download section and download the archive. For the current branch (v 2.83.7), click here

For advanced users: You can check out the branch you want by clicking the branch dropdown on the left. For latest up-to-date code, you can checkout the master branch or your desired sdk version.

If you have downloaded the archive, you should extract it to a suitable location. If you are using git client, you can clone your desired branch or master branch. You should then change directory to you local copy of bullet sdk. You will have the same or similar directory structure as shown in the following image:

You should now open the build3 folder which contains the build scripts.

Compiling and Building Bullet SDK

Thanks to the built-in support for standard build tools like CMake and Premake, compiling and building Bullet sdk is very easy. The next steps will vary subject to your operating system and desired build system.

For Windows users

Users using Visual Studio (any version)

See Creating a project from scratch#Creating a project from scratch using Visual Studio (any version)

Users using Visual Studio 2010

We are assuming that most users on Windows would use VisualStudio compiler. For other compilers, steps should be similar.

Using Premake build system

For premake, you will see vs2010.bat file. Simply double click this file and it should open a command prompt as shown below.

You should let this bat script finish. After this step, you should see a new folder created by the name vs2010. Open this folder and it will contain the 0_Bullet3Solution.sln Visual Studio 2010 solution file. Open this file and build the project which should build all Bullet components and examples. For building for a Visual Studio version other than VS2010, you need to edit the vs2010.bat file. Refer to the premake documentation for details on this.

Using CMake build system

For cmake, simply run the cmake-gui program. In the 'where is the source' field, browse to the root folder of Bullet. This is the outermost folder containing the CMakeLists.txt file. In the 'where to build the binaries' field, copy and paste the same value as in the previous field but append build at the end. This build folder will contain the VisualStudio solution file when cmake is finished with project generation. Next click configure button which should initialize CMake build system. CMake will prompt you for your desired compiler as shown below.

FILE: cmake_1.png

Select an appropriate compiler. After configuration is finished (as shown in the snapshot below), you should press the Generate button which should generate the VisualStudio project solution files in the build folder.

For Mac users

See Creating a project from scratch#Creating a project from scratch using XCode

For Unix/Linux/MingW users

See Creating a project from scratch#Unix, Linux, MinGW etc

Running the example browser

Once you have generated the project files and opened your compiler, you should begin building the Bullet library. After the build process is finished, you should set the App_BulletExampleBrowser project as the startup application. Example browser is a simple application that demonstrates the Bullet library capabilities as shown in the figure below.

Click any demo and you should see the physics simulation in the viewport. The physics objects can be interacted using mouse. The camera may be rotated by Alt + left-clicking with mouse in the viewport. Alt + right-clicking with mouse zooms the camera in and out.

Congratulations. You have just finished the initial setup step. You should now head over to the next tutorial that describes the new demo framework used by the new Bullet sdk demos in detail. This information should make it easy for you to get your feet wet with the Bullet sdk.

Personal tools