OgreBullet Physic Wrapper [Source + Binary Release.]

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

Good stuff - I've had my eye on Bullet for a while and met Erwin Coumans (Bullet author and Sony physics chap) at Siggraph last year where he was demoing Echo (the Blender Bullet&Ogre combo plugin) - not his project but obviously he had an interest in it.

@tuan: obviously you can have a spot in ogreaddons for this if you want, drop me an email to organise it..
big_o
Goblin
Posts: 279
Joined: Sun Feb 19, 2006 1:08 am

Post by big_o »

Premake sounds interesting, but until I get my hands on a working copy of Eihort I won't be able to do much with it.

I'm sick as a dog right now anyway. :x
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16

Post by KungFooMasta »

Does anybody know if Bullet supports trimesh, trimesh vs trimesh collisions, and trimesh of dynamic(animated) entities?

KungFooMasta
User avatar
Grom
Hobgoblin
Posts: 523
Joined: Fri Jan 06, 2006 6:35 pm

Re: OgreBullet Physic Wrapper [Source + Binary Release.]

Post by Grom »

yes I know. From the original post:
tuan kuranes wrote:So here is a Ogre wrapper for it. primtives, trimesh and ray vehicle only for now.
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16

Post by KungFooMasta »

I ask because, correct me if I'm wrong, PhysX also supports Trimesh, but on static entities only, which also means it doesn't support trimesh vs trimesh collisions. Supporting trimesh is one thing, but trimesh of dynamic, scaleable entities and trimesh to trimesh collision is another. I just wanted some additional clarification on this, and couldn't find it easily from the Bullet wiki or forums.

KungFooMasta
User avatar
detox
Greenskin
Posts: 103
Joined: Thu Sep 07, 2006 1:13 am
Location: Ohio, USA

Post by detox »

KungFooMasta wrote:Does anybody know if Bullet supports trimesh, trimesh vs trimesh collisions, and trimesh of dynamic(animated) entities?

KungFooMasta
It supports trimesh to trimesh collisions. Check out the Bullet demos on the Bullet website.

If by dynamic entities you mean deformable meshes, I don't think it does that out of the box. You could certainly add it. If you mean animated bodies i.e. ragdolls, then yes, using groups of collision objects and joints.

You can import collada physic entities too, from Blender or the PhysX utility for instance.

There is working C code and examples of how to do convex decomposition of trimeshes too. Great stuff.

Bullet users are working on a GPU physics system. Working examples.

There are a lot of reasons to like Bullet. The zlib license certainly helps. It's fast. It's stable. It works.
User avatar
Project5
Goblin
Posts: 245
Joined: Mon Nov 22, 2004 11:56 pm
Location: New York, NY, USA

Post by Project5 »

It supports trimesh on trimesh collision of moving entities with gimpact as of version 2.33 (according to their wiki). I think they also note that it's slower than using joined simple convex shapes.

detox beat me :-P

--Ben
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

KungFooMasta wrote:I ask because, correct me if I'm wrong, PhysX also supports Trimesh, but on static entities only, which also means it doesn't support trimesh vs trimesh collisions. Supporting trimesh is one thing, but trimesh of dynamic, scaleable entities and trimesh to trimesh collision is another. I just wanted some additional clarification on this, and couldn't find it easily from the Bullet wiki or forums.

KungFooMasta
But you can have trimesh on heightmap shape or convex on trimesh.
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16

Post by KungFooMasta »

By dynamic I just meant scaleable and animated entities. Sounds like it supports everything I want! I'm using OgreOpcode right now.. had some really bad problems with it and PLSM2, on PLSM2's side. Tempted to switch to Bullet... maybe I will look into it more sometime soon. :)

Thanks for the info everybody!

KungFooMasta
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4

Post by tuan kuranes »

@rUmbl3: this include is not needed anymore, you can remove that line safely. Can you send me what you've done so that I'll add it to current version in CVS ?

@CaseyB: sorry that I misled you. I tought it was ok, as I managed to use it once, but that was a simple project and old premake version.
rUmbl3
Halfling
Posts: 74
Joined: Wed Apr 12, 2006 4:38 pm
Location: Weinstadt / Germany

Post by rUmbl3 »

I uploaded a first patch for the Dynamics part. For the Collisions part i am stil l missing the EmptyShape header file.
Patch File
and the
Premake file
The premake file for the Collisions lib is almost the same. You would only need to change the names and remove one include dir.

The fix for the HingeConstraint is only a dirty hack .. i dont really know how to fix it in another way .. g++ is complaining cause you supply btVector3 instead of const btVector3& and btVector3& (both two times in the first constructor and one of each in the second constructor).
User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
x 3

Post by Falagard »

I also get the error "The application has failed to start because the application configuration is incorrect".

I initially didn't have Visual C++ Express installed (including the Platform SDK) but now I do and get the same problem.

I tried following some workarounds that I found on the net but they didn't work either.

The "OK, due to popular demand" post below is what I tried.
http://forums.microsoft.com/MSDN/ShowPo ... 5&SiteID=1

I haven't tried compiling from source yet, just wanted to look at the demos.

Does the binary demo have everything I need in order to run it? For example, I don't see any bullet dlls, are they statically linked? Do I need to download and compile bullet?

Thoughts?
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4

Post by tuan kuranes »

@rUmbl3: thanks for patch, I'll update asap.

@falagard: bullet is statically linked. It may miss the right msvc dll, even if i tried to put them right aside the exe... Have to find the missing one, even if depends.exe do not tell me which one I miss.
Anyway, Did you install vs sp 1 ?
User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
x 3

Post by Falagard »

Oops, missed SP1 and that fixed it.

You'll probably still want to figure out which dlls/manifest to include so people can run it if they don't have the proper versions though ;-)

Thanks!

Clay
rUmbl3
Halfling
Posts: 74
Joined: Wed Apr 12, 2006 4:38 pm
Location: Weinstadt / Germany

Post by rUmbl3 »

tuan kuranes wrote:@rUmbl3: thanks for patch, I'll update asap.
No problem.
I hope you dont forget to add the OgreBulletCollisionsEmptyShape.h file to the zip file while updating it. Then I could also get the Collisions part and the examples working.
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4

Post by tuan kuranes »

I hope you dont forget to add the OgreBulletCollisionsEmptyShape.h file to the zip file while updating it
There is no OgreBulletCollisionsEmptyShape.h file as said above, you can safely remove any include mentionning it.
An use OgreAddons CVS to get latest modification (including patch applied).
User avatar
tau
Silver Sponsor
Silver Sponsor
Posts: 413
Joined: Wed Feb 11, 2004 11:44 am
Location: Austin (that's kept wierd :))

Post by tau »

Tuan,

May I ask you a favor as the OgreBullet author? I would like to know what is the time to insert/remove a simple collider entity like simple sphere into Bullet world sim? I'm not talking about the rendering part, but just the physics world itself.
Unfortunatly, I dont have much free time on my hand to get familiar with OgreBullet, that's why I'm asking this (I really appreciate if you can find some time to do this!), it may take just 10-20 mins to take the time in the demo app on your setup dev system.

Why do I want to know this? I'm thinking about Bullet sim worlds/baskets to run on separate CPU or even different machines(read distributed physics system), so when an object is going out of one sim world scope, it will be moved to another Bullet sim (based on the sim border coords), and will participate in collision detection there. I just want to know if this idea introduce a lot of lag while moving objects from one sim to another... Would be interesting to know average for 1000 insert/remove operations to draw the median for 1 operation in msecs or nsecs.

I appreciate the help! Thank you!
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4

Post by tuan kuranes »

@tau: you really may ask that on Bullet Forums instead.
User avatar
tau
Silver Sponsor
Silver Sponsor
Posts: 413
Joined: Wed Feb 11, 2004 11:44 am
Location: Austin (that's kept wierd :))

Post by tau »

@Tuan

That's a good idea as well. Thanks.
User avatar
Frenetic
Bugbear
Posts: 806
Joined: Fri Feb 03, 2006 7:08 am

Post by Frenetic »

For those without the VC++ 2005 SP1, I found that installing this:

http://www.apachelounge.com/download/vc ... 86-sp1.exe

let me run the demo.
User avatar
znarf
Gnoblar
Posts: 23
Joined: Sun Mar 04, 2007 11:11 pm
Location: Heidelberg, Germany

Link in original post corrupt?

Post by znarf »

@Tuan

the following link in your original post leads to an empty archive:

Bullet Source with vc8 compatible with Ogre (dll thing)

Regards,
znarf
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4

Post by tuan kuranes »

@znarf: I can download and unzip it wihtout any problem. try again with/without a mass downloader ? I use 7zip as uncompressor/compressor.
User avatar
znarf
Gnoblar
Posts: 23
Joined: Sun Mar 04, 2007 11:11 pm
Location: Heidelberg, Germany

Post by znarf »

@Tuan,
sorry for the false alarm, you are completely correct, the archive contains the data. My Windows explorer did not show the zip file contents before the download was completed, and for some strange reasons I did not get an entry in my Firefox's download window. But after a while just the content of the archive "appeared", so please excuse my impatience... :oops:
User avatar
bhammond
Gnoblar
Posts: 4
Joined: Mon Apr 09, 2007 5:10 pm

callback?

Post by bhammond »

Hi, I was recently checking out available physics "engines" for use with OGRE. I tried ODE and it was very unstable (due to OPCODE). I moved on to Bullet. I saw the ogrebullet addon and, after some minor code fixes, got it built on AMD64 running Ubuntu Linux.

BTW it looks like a very nice wrapper so far!

OK...

So, granted I'm a [Ogre]Bullet newbie but I don't see any obvious place where one can be notified of a collision between rigid bodies. Am I blind? :-)

I'm looking for something like:

Code: Select all

class MyCollisionHandler : public OgreBullet::CollisionCallback 
{
public:
  virtual ~MyCollisionHandler() {}
  virtual void onCollision(OgreBullet::CollisionEvent& evt) {
    // evt.body0, evt.body1, normal, etc.
  }
} myHandler;

body->addCollisionCallback(&myHandler);

// blah blah ... 

Thanks!
Brian
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4

Post by tuan kuranes »

Sorry missed the post.
after some minor code fixes, got it built on AMD64 running Ubuntu Linux.
Would be interested by a patch against latest cvs.
So, granted I'm a [Ogre]Bullet newbie but I don't see any obvious place where one can be notified of a collision
It seems I just missed implementing that one, as I use it as a physic engine, not collision engine, even if I paid much attention making it seperated.
Feel free to add that and more (a collision only demo)... or if you don't feel implementing it, I can add it to my todo-list (which is huge, but if I find it simple and fast to implement, I'll do it.).