Game Development Community

Bullet Physics Engine

by Chris "DiGi" Timberlake · in General Discussion · 06/03/2008 (8:31 pm) · 15 replies

Anyone ever hear of this engine? Its free for commercial use under the zlib license and says its been used in ps3 games and pc games.

http://www.bulletphysics.com/Bullet/wordpress/

#1
06/04/2008 (5:27 am)
Just a nitpicky correction: it's physics library, and not an engine.

I have heard of it and looked into it occasionally, but never really felt the desire to use it. I hope the Youtube videos are not an indication of performance, because it looks a bit sluggish : /

Let us know what you think if you toy around with it.
#2
06/04/2008 (9:03 am)
It's what I'm using in my current development. I genuinely like it. Much friendlier than ODE, except the documentation is a bit weak.

Gary (-;
#3
06/04/2008 (8:41 pm)
Here's a recent testimonial from GDnet
#4
06/05/2008 (10:54 am)
Quote:You can then query the collision objects list, extract a world transform matrix, convert it quite easily into a D3DXMATRIX, set the Direct3DDevice world transform and render the object.

Getting the graphics side working has taken a couple of nights. Getting Bullet integrated and working, based on some sample code, has taken probably about an hour.

Wow, talk about making work for yourself. Bullet has something called a motionState. You give it a motionstate for a rigidbody when you construct that rigid body, and bullet does all the actual interpolation and object moving for you. Here's the one I wrote for my current game which uses Ogre:

TWShipMotionState::TWShipMotionState(const btTransform &initialpos, Ogre::SceneNode *node) {
	mVisibleobj = node;
	mPos1 = initialpos;
}

TWShipMotionState::~TWShipMotionState() {
	
}

void TWShipMotionState::getWorldTransform(btTransform &worldTrans) const {
	worldTrans = mPos1;
}

void TWShipMotionState::setNode(Ogre::SceneNode *node) {
	mVisibleobj = node;
}

void TWShipMotionState::setWorldTransform(const btTransform &worldTrans) {
	if(NULL == mVisibleobj) return; // silently return before we set a node
	
	btQuaternion rot = worldTrans.getRotation();
	mVisibleobj->setOrientation(rot.w(), rot.x(), rot.y(), rot.z());
	
	btVector3 pos = worldTrans.getOrigin();
	mVisibleobj->setPosition(pos.x(), pos.y(), pos.z());
	// printf("X: %f, Y:%f, Z:%f\n", pos.x(), pos.y(), pos.z());
}

Thanks to that, you never have to have a query->move stuff loop in your game, bullet does all the movement for you. The trick is of course to write the motionState so it works for you, but it's awesome that it simply doesn't get called if the shape doesn't move, and it does interpolation for you.

Look on it like an event-based way to get your objects moved :-)

Gary (-;
#5
06/09/2008 (5:10 am)
Gary,

how about making a resource so others could integrate Bullet to TGEA? :--)
#6
06/09/2008 (10:50 am)
Quote: how about making a resource so others could integrate Bullet to TGEA?

GG would have to make good on their promise to port TGEA to platforms I actually develop on before I could even start :-/

On the other hand, my ODE resource apparently still works in TGEA1.7 with a couple small modifications [apparently GG just changed onStaticModified for the hell of it in 1.7 which broke a whole bunch of stuff] :-)

Gary (-;
#7
06/13/2008 (4:46 pm)
@ChunkyKs: You mean that TGEA still doesn't run on anything but windows ?!?!
#8
06/13/2008 (10:20 pm)
@Gary - Have you messed with Bullet's multithreaded support?
#9
06/13/2008 (10:59 pm)
Quote:Have you messed with Bullet's multithreaded support?

I have not. I have heard many good things about it, though. www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1894

If you're developing for the PS3, there's also what I believe to be a genuinely good cell-oriented multithreaded codepath, but I haven't tried it personally [since I don't have a PS3 devkit [or a PS3 at all :-) ]]

Gary (-;
#10
06/13/2008 (11:10 pm)
Just play the demo and it seems quite impressive! A resource for this will be nice.
#11
06/14/2008 (2:44 am)
Apparently, in trhe new TGEA 1.7.1, the "onStaticModifed" got an update :

From www.garagegames.com/blogs/985/14879 :

Quote:Fixed some out of date onStaticModified() implementations that was causing them to not be called

It couldn't be bad news for your ODE resource in TGEA 1.7.

Nicolas Buquet
www.buquet-net.com/cv/
#12
06/14/2008 (3:19 pm)
Huh. Maybe that fixed the issue several people were having in 1.7.0.

Gary (-;
#13
09/13/2008 (12:46 am)
Bullet integration would be Nice. I tried both the free Havok core and Bullet SDKs and for my needs (rope simulation) Bullet was better. Unfortunately, i'm just climbing the TGEA learning curve.. any pointers wrt integrating other engines would be appreciated.
#14
09/13/2008 (5:58 am)
I would like to see bullet be integrated into TGE or TGEA, but I am worried about how much graphical and RAM power it would take. Do you think that it could be put into big MMO games?
#15
09/13/2008 (6:32 am)
David,
You could use the ode resource as a guide to make a bullet port for tge/a

Tyler,
It would depend on how you optimise it. Any physics engine (including torques own) would lag your game horribly if not optimised correctly.