Author Topic: CrystalSpace and Bullet  (Read 531 times)

redhound

  • Hydlaa Resident
  • *
  • Posts: 97
    • View Profile
CrystalSpace and Bullet
« on: May 07, 2014, 06:11:23 am »
Hello! I have problem with building CS rev. 38934 from sources in Linux Mint Debian Edition (LMDE) x86_64, based on Debian Testing (Jessie).

Compiler shows many error messages about bullet physics library:
Code: [Select]
C++ ./out/linux/optimize/plugins/physics/bullet/bullet.o
/home/redhound-game/build/planeshift/cs/plugins/physics/bullet/bullet.cpp: In member function ‘void CS::Plugin::Bullet::csBulletDynamicsSystem::CheckCollisions()’:
/home/redhound-game/build/planeshift/cs/plugins/physics/bullet/bullet.cpp:309:63: error: static_cast from type ‘const btCollisionObject*’ to type ‘btCollisionObject*’ casts away qualifiers
/home/redhound-game/build/planeshift/cs/plugins/physics/bullet/bullet.cpp:311:63: error: static_cast from type ‘const btCollisionObject*’ to type ‘btCollisionObject*’ casts away qualifiers
/home/redhound-game/build/planeshift/cs/plugins/physics/bullet/bullet.cpp: In member function ‘virtual CS::Physics::Bullet::HitBeamResult CS::Plugin::Bullet::csBulletDynamicsSystem::HitBeam(const csVector3&, const csVector3&)’:
/home/redhound-game/build/planeshift/cs/plugins/physics/bullet/bullet.cpp:739:70: error: invalid conversion from ‘const btSoftBody*’ to ‘btSoftBody*’ [-fpermissive]

    g++ -c -o ./out/linux/optimize/plugins/physics/bullet/bullet.o -I/home/redhound-game/build/planeshift/cs/. -I./include -I/home/redhound-game/build/planeshift/cs/./include -pipe -Wall -Wno-unknown-pragmas -fvisibility=hidden -mtune=generic -mfpmath=sse -I/usr/local/include -DNVALGRIND -fno-exceptions -fvisibility-inlines-hidden -DNVALGRIND -ffunction-sections -fdata-sections -O3 -fomit-frame-pointer -ffast-math -g2 -fPIC -I/usr/include/bullet  /home/redhound-game/build/planeshift/cs/plugins/physics/bullet/bullet.cpp

...failed C++ ./out/linux/optimize/plugins/physics/bullet/bullet.o ...
...skipped bullet.so for lack of <plugins!physics!bullet!>bullet.o...
...failed updating 1 target(s)...
...skipped 1 target(s)...
...updated 499 target(s)...
Copy cs-config
...updated 1 target(s)...

I have libbullet-dev 2.81-rev2613+dfsg2-1 installed from testing repository. Compiling CS with gcc 4.6.

So the question: which bullet version is needed to build CS rev. 38934?

Calmus

  • Traveller
  • *
  • Posts: 29
    • View Profile
Re: CrystalSpace and Bullet
« Reply #1 on: May 07, 2014, 10:41:41 am »
I compiled Crystalspace two or three month ago, I used bullet-2.80-rev2531.

Edit: I'm not really sure if I used that version when compiling Crystalspace, I have downloaded this version, but I can't see it in /usr/lib that it is installed; according to their website (http://www.crystalspace3d.org/docs/online/manual-2.0/External-Libraries.html#0) bullet version 2.76 is recommended)
« Last Edit: May 07, 2014, 03:00:10 pm by Calmus »

redhound

  • Hydlaa Resident
  • *
  • Posts: 97
    • View Profile
Re: CrystalSpace and Bullet
« Reply #2 on: May 11, 2014, 01:16:16 pm »
Replacing /cs/plugins/physics/bullet/bullet.cpp file with its newer version from CS trunk (http://sourceforge.net/p/crystal/code/HEAD/tree/CS/trunk/plugins/physics/bullet/bullet.cpp) solves errors with building bullet.o. Compilation goes further, but then fails again - now on /cs/plugins/physics2/bullet files.

redhound

  • Hydlaa Resident
  • *
  • Posts: 97
    • View Profile
Re: CrystalSpace and Bullet
« Reply #3 on: May 27, 2014, 12:30:44 am »
Finally, CS physics and physics2 plugins compiled with bullet 2.80 rev2531.

Bullet 2.80 sources can be found here: https://code.google.com/p/bullet/downloads/list. Search for deprecated downloads for "2.80" gives 2 packages (zip for Win and tgz for Unix).

This sample script downloads and builds bullet 2.80, then installs it to local folder:
 
Code: [Select]
PSBUILD=$HOME/build/planeshift
cd $PSBUILD
wget https://bullet.googlecode.com/files/bullet-2.80-rev2531.tgz
tar -zxf bullet-2.80-rev2531.tgz
mv -f bullet-2.80-rev2531 bullet
cd bullet
./autogen.sh
./configure --prefix=$PSBUILD/bullet
make -j3
make install

Now then building CS, we must specify custom bullet location:
Code: [Select]
./configure --without-java --without-perl --without-python --without-3ds --with-cal3d=$PSBUILD/cal3d --with-bullet=$PSBUILD/bullet
jam -j3 -aq libs plugins cs-config walktest

So bullet problem is gone, but there are others - now my CS compilation fails on video plugins... But it is another tale...