Compiling Physics Library Guide

Table of Contents

1 Introduction

It was not easy to find a Physics library so I look for a good library and then try to compile it.

2 Trying libraries

2.1 CANCELED OgreNewt is not for us!

Newton library is not in all repositories!

For example: Fedora 18!

2.2 CURRENT OgreBullet

3 CURRENT Compiling OgreBullet

3.1 Requires:

Without this, it won't work well.

  • libtool
  • bullet-devel
  • bullet-extra-devel

3.2 Execute Autogen Script

Execute ./autogen.sh May finish with warnings.

3.3 Export Needed Variables

For instance, for finding Ogre in /usr/local/lib :

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

3.4 Execute Configuration Script

Execute ./configure

3.5 Modify some files

Some files need to be modified because are not for Ogre 1.8.1 nor for Bullet 2.8 neither for the actual g++.

A OgreBullet forum thread were of great help.

  • Collisions/src
    • OgreBulletCollisionsWorld.cpp


      btCollisionObject* obA = static_cast<btCollisionObject*>(contactManifold->getBody0());
      btCollisionObject* obB = static_cast<btCollisionObject*>(contactManifold->getBody1());

      and change into

      btCollisionObject* obA = const_cast<btCollisionObject*>(contactManifold->getBody0());
      btCollisionObject* obB = const_cast<btCollisionObject*>(contactManifold->getBody1());
    • OgreBulletCollisionsRay.cpp

      Line 87:

      return mWorld->findObject(const_cast<btCollisionWorld::ClosestRayResultCallback *> (mRayResultCallback)->m_collisionObject);


      return mWorld->findObject(const_cast<btCollisionObject*>(static_cast<btCollisionWorld::ClosestRayResultCallback *> (mRayResultCallback)->m_collisionObject));
  • Dynamics/src
    • Line 111:


      btCollisionObject* obA = static_cast<btCollisionObject*>(contactManifold->getBody0()); // For older Bullet versions (original code)
      btCollisionObject* obB = static_cast<btCollisionObject*>(contactManifold->getBody1()); // For older Bullet versions (original code)


      btCollisionObject* obA = const_cast<btCollisionObject*>(contactManifold->getBody0());; // For newer Bullet versions
      btCollisionObject* obB = const_cast<btCollisionObject*>(contactManifold->getBody1()); // For newer Bullet versions

3.6 Execute Make Utility

Execute make

3.7 Execute Make for Installing

Execute sudo make install

Or execute make install as superuser.

4 License


model.org by Giménez, Christian N.

This work is licensed under the Creative Commons Atribución-CompartirIgual 2.5 Argentina License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.5/ar/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

Viernes 03 De Mayo Del 2013

Date: 03 May, 2013

Author : Giménez, Christian

Generated by Org mode 7.9.3f in Emacs 24.2.1.

Validate XHTML 1.0