Scale - large/small objects, world size

Post Reply
tompalmer
Posts: 8
Joined: Wed Aug 26, 2009 2:40 am

Scale - large/small objects, world size

Post by tompalmer »

Hello.

I want to use Bullet for simulation at both large and small scales. That is, I want to simulate people-sized things, but also down to the centimeter or smaller level for grasping simulation. The manual says moving objects should be no smaller than 0.1 units. And no larger than 5 units.

If those are meters, the upper limit is fine, but 10cm isn't good enough for grasping. However, if I call the units, say, cm, then 1mm is great, but 5cm is obviously smaller than human scale. At 10cm per unit, I still don't get objects larger than 0.5m, and 1cm really is still a bit big for me.

My thought is to run multiple simulations, one at 1cm/unit and another at 1m/unit. The fine scale would only be invoked occasionally and be limited in its scope. When both are running, I would have to somehow synchronize objects between the two in terms of velocities/forces/whatnot.

Am I insane for trying this? Is there a better plan?

Also, how large can a world really get? I some comments for the btAxisSweep3 samples saying that I shouldn't get too large (say past -10000 to 10000). Does double vs. float have any impact on this? Also, if the simulation world is large, would it be better to run multiple Bullet worlds for each active area? Any different expectations for btDbvtBroadphase?

In other words, I'm looking at running multiple Bullet worlds, both for different active areas and for the same areas at different scales. Is this sane?

Side question, can Bullet do spherical or even multi-body gravity? (Sorry for the unrelated question. Just also been on my mind.)

Thanks much for any help.

- Tom
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York
Contact:

Re: Scale - large/small objects, world size

Post by sparkprime »

tompalmer wrote:Hello.
I want to use Bullet for simulation at both large and small scales. That is, I want to simulate people-sized things, but also down to the centimeter or smaller level for grasping simulation. The manual says moving objects should be no smaller than 0.1 units. And no larger than 5 units.
This might be an interesting read: http://www.bulletphysics.com/Bullet/php ... f=9&t=2535
If those are meters, the upper limit is fine, but 10cm isn't good enough for grasping. However, if I call the units, say, cm, then 1mm is great, but 5cm is obviously smaller than human scale. At 10cm per unit, I still don't get objects larger than 0.5m, and 1cm really is still a bit big for me.
I'm not sure if there really is an upper limit, I've never found it. I have some huge triangles too (1000 of units) I have found that there tends to be a discrepancy between claims about bullet and the reality though. The best information you can get would be to do some experiments with objects at size ranges and shapes you're interested in. If I had to guess I'd say use 1cm=1unit and don't worry about upper limits.
My thought is to run multiple simulations, one at 1cm/unit and another at 1m/unit. The fine scale would only be invoked occasionally and be limited in its scope. When both are running, I would have to somehow synchronize objects between the two in terms of velocities/forces/whatnot.
This should be your last resort I think. It would be a unpleasant and boring thing to implement.
Also, how large can a world really get? I some comments for the btAxisSweep3 samples saying that I shouldn't get too large (say past -10000 to 10000). Does double vs. float have any impact on this? Also, if the simulation world is large, would it be better to run multiple Bullet worlds for each active area? Any different expectations for btDbvtBroadphase?
btAxisSweep needs you to give it the size of the world. But the dbvt broadphase doesn't. Also dbvt is supposed to be better if you're inserting and removing a lot of stuff but I have a streaming engine and I haven't noticed broadphase being hot so i still use the axis sweep.

I am currently running -3000 -> 3000 in 3 dimensions in btAxisSweep without any trouble. I use 1m=1unit and it mostly works.

I don't think you should need to run separate worlds. You might have a large amount of static geometry but this does not eat cycles. The broadphase is very tight and can handle a huge number of rigid bodies. You probably only have a few moving things close to the camera, right? Everything else is sleeping or streamed out or whatever.

Again, do some experiments. Create a random world with objects distributed in a manner you expect and then see if the dynamics are working.
In other words, I'm looking at running multiple Bullet worlds, both for different active areas and for the same areas at different scales. Is this sane?
Sanity is a question of perspective ;)
Side question, can Bullet do spherical or even multi-body gravity? (Sorry for the unrelated question. Just also been on my mind.)
No, gravity is of fixed magnitude and direction. But if you disable bullet gravity you can apply your own forces/impulses to simulate whatever gravitational field you want.
tompalmer
Posts: 8
Joined: Wed Aug 26, 2009 2:40 am

Re: Scale - large/small objects, world size

Post by tompalmer »

Thanks much for all the feedback. Glad to hear I might have an easy way out.
guildwars2
Posts: 1
Joined: Wed Sep 05, 2012 6:45 am

Re: Scale - large/small objects, world size

Post by guildwars2 »

Guild Wars 2 will be based on three currencies: gold, karma and gems. Gems are used to purchase microtransaction goods and can be exchanged for gold — or vice versa. This means that gold farmers are out of luck: Guild Wars 2 will not be the game for you.
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Scale - large/small objects, world size

Post by Flix »

tompalmer wrote:10cm isn't good enough for grasping.
Just to add something to what sparkprime said, I tried the patch posted by Laurent Coulon here:http://bulletphysics.org/Bullet/phpBB3/ ... lit=Coulon, and it seems to improve a little the behavior of Bullet with small objects (I'm not an expert about it, but basically it should stop the "jittering" of tiny objects, without affecting other kind of problems like tunnelling, or problems arising from huge mass differences).
I've tested it with very small cones (with a center of mass offset). I used these dimensions:

Code: Select all

const btScalar radius = 0.02f;
const btScalar halfHeight = 0.04f;
const btScalar mass = 0.005f;
const btScalar collisionMargin = 0.005f;	
and it seems to work better (although the collision margin seems to increase the cone shape)
Laurent_Coulon_Patch.JPG
Laurent_Coulon_Patch.JPG (14.98 KiB) Viewed 9406 times
I don't know if the patch will be fully included in the SVN trunk (and I've not tested it deeply to tell if it's good enough), but I've seen some recent modifications about the restitution implementation in the Bullet SVN repository that seem to be taken from it.
sparkprime wrote:btAxisSweep needs you to give it the size of the world. But the dbvt broadphase doesn't. Also dbvt is supposed to be better if you're inserting and removing a lot of stuff but I have a streaming engine and I haven't noticed broadphase being hot so i still use the axis sweep.
Oh, that's a pity! I'm using the dbvt broadphase because of its frustum and occlusion culling support. I should have made some comparison about performance... Good to know anyway :)
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Scale - large/small objects, world size

Post by Erwin Coumans »

This was a 2009 issue with a spam reply by guildwars2.

The patch by Laurent Coulon seems to only improve the case with restitution, and some friction issue, both improvement have been integrated into Bullet trunk. The other part of the patch was only related to order of integration, which doesn't impact jitter.

In pretty much all cases, btDbvtBroadphase is superior to btAxisSweep*
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Scale - large/small objects, world size

Post by Flix »

Erwin Coumans wrote:This was a 2009 issue with a spam reply by guildwars2.
:oops: I'll be more careful next time :!:

I'm glad I can stick to the btDbvtBroadphase anyway :D
Post Reply