Bullet: Difference between revisions

From HaskellWiki
Hcube (talk | contribs)
No edit summary
Updated for the cabalised version.
Line 1: Line 1:
[http://www.bulletphysics.com/Bullet/wordpress/bullet Bullet] is a professional open source multi-threaded 3D Collision Detection and Rigid Body Dynamics Library. It is free for commercial use under the ZLib license.
[http://www.bulletphysics.com/Bullet/wordpress/bullet Bullet] is a professional open source multi-threaded 3D Collision Detection and Rigid Body Dynamics Library written in C++. It is free for commercial use under the zlib license.


Bullet is a C++ library.
A cabalised wrapper is available: http://hackage.haskell.org/package/bullet


Here is a haskell wrapper and an example for it.
Note that you have to install the library before installing the package:


[[Media:Bullet.hs|Bullet.hs]] - bullet haskell wrapper
svn checkout http://bullet.googlecode.com/svn/trunk/ bullet-read-only
cd bullet-read-only
cmake .
make
sudo make install


[[Media:BulletExample.hs|BulletExample.hs]] - example program
Now you can install the Haskell binding:


requirements: glut, [http://www.bulletphysics.com/Bullet/wordpress/bullet Bullet]
cabal install bullet


compile command:
The example on the screenshot below can be found in the package. You have to compile it by hand. Make sure that OpenGL and GLUT is installed, then enjoy:
ghc -XForeignFunctionInterface Bullet.hs BulletExample.hs -lbulletdynamics -lbulletmath -lbulletcollision -lstdc++ -o example -package GLUT


cabal unpack bullet
cd Examples
ghc --make -O2 BulletExample
./BulletExample


[[Image:BulletExample.jpg|BulletExample.jpg]]
You can use the arrows to navigate the scene and P to pause/unpause.
 
[[Image:Bullet-example-1.png]]
 
[[Image:Bullet-example-2.png]]

Revision as of 11:23, 18 November 2009

Bullet is a professional open source multi-threaded 3D Collision Detection and Rigid Body Dynamics Library written in C++. It is free for commercial use under the zlib license.

A cabalised wrapper is available: http://hackage.haskell.org/package/bullet

Note that you have to install the library before installing the package:

svn checkout http://bullet.googlecode.com/svn/trunk/ bullet-read-only
cd bullet-read-only
cmake .
make
sudo make install

Now you can install the Haskell binding:

cabal install bullet

The example on the screenshot below can be found in the package. You have to compile it by hand. Make sure that OpenGL and GLUT is installed, then enjoy:

cabal unpack bullet
cd Examples
ghc --make -O2 BulletExample
./BulletExample

You can use the arrows to navigate the scene and P to pause/unpause.