Windows Bullet 2.82 Compilation installation (Bullet Physics development environment configuration)

Source: Internet
Author: User

Platform: win7,vs2010

1. Organization of the Bullet library

is in the bullet_user_manual:

The Bullet Linearmath (linear math module), which is the bulletcollision (Collision detection module), The Bulletdynamics (rigid body simulation module) and the Bulletsoftbody (deformable analog module) are then built on the bulletcollision, plus an optional import and export plugin and multithreaded modules. Linearmath, Bulletcollision, Bulletdynamics, Bulletsoftbody are core modules, others are optional (when you need a plugin or use multi-threading). we only compile the core module here , in fact Linearmath, Bulletcollision, Bulletdynamics, Bulletsoftbody corresponds to 4. lib Files (library files).

Given Bullet's modular organization, users can use bullet in a hierarchical format:

    1. Collision detection, this time only contains Linearmath, Bulletcollision library;
    2. Rigid body dynamics, need to include Linearmath, bulletcollision, Bulletdynamics Library;
    3. Soft body Dynamics, contains all 4 Linearmath, bulletcollision, Bulletdynamics, and bulletsoftbody libraries.

For us, it is possible to use a variable shape, so all 4 modules are compiled.

2. Bullet Installation Instructions

This is a top-level guide:

    1. Download bullet-2.82-r2704.zip, unzip (the number after r may be different);
    2. Run the. /build/vs2010.bat", Generate VS2010 project;
    3. Open With VS2010 ". /vs2010/0BulletSolution.sln";
    4. For Linearmath,bulletcollision,bulletdynamics,bulletsoftbody, respectively, in the Debug and release configuration (more versions and explanations see here );
    5. Set the ".. /lib "8 . lib files , and". /src "all . h files are copied out to form the installation package.

The next 4th section will explain the process with step by step. How the bullet project will be configured in the next section.

3. Bullet Engineering configuration (using Bullet library)

To use bullet, you need:

    1. Add a directory containing the. h files copied from the previous section to the project's include directory (under All configurations);
    2. Add the Library directory and add the directory where the. lib file you copied from the previous section to the catalog directory (under all configurations);
    3. Reference Library , add a reference to the. lib file (add the required. lib file according to the usage hierarchy, Debug and release are set separately);
    4. Contains the header file , which contains "btBulletDynamicsCommon.h" in the code.

Note:

Add two methods that include a directory:

    1. "Project Properties >> Configuration Properties >> VC + + directories >> include Directories"
    2. "Project Properties >> Configuration Properties >> C + + >> General >> additional include directories".

There are two ways to add a library directory:

    1. "Project Properties >> Configuration Properties >> VC + + directory >> Library Directory"
    2. Project Properties >> Configuration Properties >> linker >> General >> Additional Library directories.

Two ways to reference a library:

    1. Code #pragma comment (lib, "Xxx.lib") (with #ifdef _dll and #ifdef _DEBUG);
    2. Project Properties >> Configuration Properties >> linker >> input >> additional dependencies.

. lib file version issues see my other article: Configuring your own OpenGL library, Glew, Freeglut Library compilation, library conflict resolution.

4. Step by step

Let's start with the generated. sln file:

Open 0BulletSolution.sln:

The 4 items above are generated in debug and Release configurations, respectively. See more versions: Configure your own OpenGL library, Glew, Freeglut Library compilation, library conflict resolution. Note that both debug and release in the bullet Project use static CRT(we typically use a DLL CRT), so it is necessary to compile 2 more versions. After compiling, get the. lib file, you can change the file name according to the compiled version:

Build the installation package as follows:

Windows Bullet 2.82 Compilation installation (Bullet Physics development environment configuration)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.