From 7e15b99c01616999496155fe5d2ce89d7608932b Mon Sep 17 00:00:00 2001
From: Stijn Buys
Date: Tue, 7 Jul 2009 13:43:05 +0000
Subject: Initial bullet physics support
---
configure.in | 82 ++++++++++--
doc/installation.html | 29 ++++-
osirion.kdevelop | 2 +-
src/Makefile.am | 9 +-
src/game/base/Makefile.am | 9 +-
src/game/base/game.cc | 53 +++++---
src/game/base/physics.cc | 308 ++++++++++++++++++++++++++++++++++++++++++++++
src/game/base/physics.h | 166 +++++++++++++++++++++++++
src/game/base/ship.cc | 147 +++++++++++++---------
src/game/base/ship.h | 6 +-
src/game/base/station.cc | 4 +-
src/game/base/station.h | 3 +-
12 files changed, 718 insertions(+), 100 deletions(-)
create mode 100644 src/game/base/physics.cc
create mode 100644 src/game/base/physics.h
diff --git a/configure.in b/configure.in
index 74551a2..a66fb24 100644
--- a/configure.in
+++ b/configure.in
@@ -228,6 +228,52 @@ fi
AC_SUBST(CURSES_CFLAGS)
AC_SUBST(CURSES_LIBS)
+dnl ----------------------------------------------------------------
+dnl bullet
+dnl
+
+HAVE_BULLET=no
+
+AC_ARG_WITH(bullet,
+ AC_HELP_STRING([--with-bullet=DIR],
+ [use the bullet physics library in DIR (read the documentation)]
+ )
+)
+
+if test "x${with_bullet}" != "xno"; then
+ save_CPPFLAGS="$CPPFLAGS"
+ save_LDFLAGS="$LDFLAGS"
+
+ AC_MSG_CHECKING(for bullet directory)
+
+ BULLET_DIR="/usr/local"
+ if test "x${with_bullet}" != "x"; then
+ BULLET_DIR="${with_bullet}"
+ fi
+ AC_MSG_RESULT([$BULLET_DIR])
+
+ BULLET_CFLAGS="-I${BULLET_DIR}/include/bullet"
+ BULLET_LIBS="-L${BULLET_DIR}/lib"
+
+ CPPFLAGS="$save_CPPFLAGS $BULLET_CFLAGS"
+ LDFLAGS="$save_LDFLAGS $BULLET_LIBS"
+
+ AC_CHECK_HEADER(btBulletDynamicsCommon.h,
+ AC_DEFINE(HAVE_BULLET, yes, [Define this if you have the bullet physics library])
+ BULLET_LIBS="$BULLET_LIBS -lbulletmath -lbulletdynamics -lbulletcollision"
+ HAVE_BULLET="yes",
+ BULLET_LIBS=""
+ BULLET_CFLAGS=""
+ HAVE_BULLET="no"
+ )
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+fi
+
+AC_SUBST(BULLET_CFLAGS)
+AC_SUBST(BULLET_LIBS)
+
dnl ----------------------------------------------------------------
dnl zlib
dnl
@@ -392,6 +438,9 @@ fi
CXXFLAGS="-pipe $DEBUG_CFLAGS $WARN_CFLAGS $CXXFLAGS"
AC_SUBST(CXXFLAGS)
+CPPFLAGS="$CPPFLAGS $BULLET_CFLAGS"
+AC_SUBST(CPPFLAGS)
+
dnl ---------------------------------------------------------------
dnl Installation paths
@@ -442,20 +491,27 @@ AC_MSG_RESULT([
Project::OSiRiON $VERSION
Configuration summary:
- platform ........... $host
- flags .............. $CXXFLAGS
- libraries .......... $HOST_LIBS $LIBJPG_LIBS $LIBPNG_LIBS
- curses ............. $HAVE_CURSES
- build client ....... $BUILD_CLIENT
- SDL .................$LIBSDL_LIBS
- opengl ............. $GL_LIBS
- openal ............. $AL_LIBS
+platform ........... $host
+flags .............. $CPPFLAGS $CXXFLAGS
+libraries .......... $HOST_LIBS $LIBJPG_LIBS $LIBPNG_LIBS $CURSES_LIBS $BULLET_LIBS
+curses ............. $HAVE_CURSES
+bullet ............. $HAVE_BULLET
+build client ....... $BUILD_CLIENT])
+
+if test "x$BUILD_CLIENT" = xyes; then
+AC_MSG_RESULT([SDL .................$LIBSDL_LIBS
+opengl ............. $GL_LIBS
+openal ............. $AL_LIBS])
+fi
+
+AC_MSG_RESULT([
Installation directories:
- installation type .. $INSTALLTYPE
- prefix ............. $prefix
- binaries ........... $bindir
- documentation ...... $docdir
- game data .......... $PACKAGE_DATADIR
+
+installation type .. $INSTALLTYPE
+prefix ............. $prefix
+binaries ........... $bindir
+documentation ...... $docdir
+game data .......... $PACKAGE_DATADIR
])
diff --git a/doc/installation.html b/doc/installation.html
index 8f66113..7640057 100644
--- a/doc/installation.html
+++ b/doc/installation.html
@@ -173,7 +173,34 @@ svn co svn://intranifty.no-ip.org/osirion osirion
osirion-src-latest.tar.bz2
-
+
+
+ Experimental support for the Bullet Physics Library
+ is under development. You can download the source code here:
+ http://code.google.com/p/bullet/downloads/list
+
+
+ To download and install the library:
+
+wget http://bullet.googlecode.com/files/bullet-2.75-rc3.tgz
+tar zxvf bullet-2.75-rc3.tgz
+cd bullet-2.75-rc3
+./autogen.sh
+./configure --prefix=/usr/local
+make
+sudo make install
+sudo install --mode=644 src/BulletDynamics/Dynamics/btActionInterface.h /usr/local/include/bullet/BulletDynamics/Dynamics
+
+
+
+ The osirion configure script will automaticly detect the bullet library in /usr/local.
+ If you use a different prefix, like /opt/bullet, you will have to call the osirion
+ configure script using the --with-bullet=/opt/bullet option.
+
+