Minimal object size

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
bmud
Posts: 17
Joined: Sat Jun 03, 2006 7:36 pm
Location: Raleigh, NC USA

Minimal object size

Post by bmud »

[edit]Originally I was replying to this post I found via the google search, and somehow I ended up here... for all those confused.[/edit]

I agree. This is a problem that has just recently become very problematic for me. I'm making a marble game. How big is a marble? About TWO centimeters for a large one. Okay, so it's not really marble sized. It's more about the size of a bowling ball. That's within the 20cm limit but the margin is very visible and is making level design difficult. What if I was making a bowling game; or tennis; or worse, golf? If I make everything too big, objects seem to just have too much weird momentum problems like they're underwater. On top of that, making worlds bigger revives a problem that the BCGP team had while working on the underwater racing game. blender's graphics engine has a crummy z-buffer and edges start getting blocky on larger scales.

To get to the point, my game worked without any complaints before last night. I decided to scale everything down to a "real world size" since the blender units are being used as meters. Now the ball runs into objects before its touching them, and it doesn't reach the floor... :( I too would like to scale my margins or suggest that the engine have them scaled as such by default.

http://www.osysi.net/projects/blender/m ... gins.blend
Last edited by bmud on Sun Jun 18, 2006 6:16 pm, edited 1 time in total.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

I split your posting, because the other Bullet forum is not related to Blender. I try to keep Blender related and Bullet SDK related postings separate.

There are restrictions when using Bullet collision detection and physics, and minimum / maximum object sizes are one of them. This might improve in the future, but for now you have to work within the limits.
Other restrictions are using large mass differences: don't put a heavy box on top of a light one, it will go wrong.

There is no FAQ yet, but this should be one of the first items to note.

- for dynamic moing objects: no small objects (minimum 0.15 units), no very large objects (> 10 units)
- don't mix very heavy and very light objects in the same simulation
- 'Apply' the scaling/size to the mesh/model
Last edited by Erwin Coumans on Sun Jun 18, 2006 6:20 pm, edited 2 times in total.
bmud
Posts: 17
Joined: Sat Jun 03, 2006 7:36 pm
Location: Raleigh, NC USA

Post by bmud »

No prob, dood. Any quick fix solutions? For now I guess I'll just have to scale everything back up.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

I would keep regular scaling, so 1 unit = 1 meter, with 9.8 gravity.

In the latest preview 40, there is a setMargin, which allows you to play with per-object margin settings.

You can try to set the margin for static objects closer to zero (0.01) and
for make margin smaller for small dynamic objects.

If you experience missing collisions (the ccd should fix this, but it is work in progress), use smaller timesteps:

in python:

PhysicsConstraints.setNumTimeSubSteps(numSteps)
numSteps = 0 -> no simulation (good to pause just the simulation)
numSteps = 1 -> default
numSteps > 1, subdivide the timestep, higher accuracy, support for smaller margins. So if you halve the collision margin, you can try to double the numSteps

See also:
http://www.continuousphysics.com/mediaw ... in_Blender

Erwin