Aloush154 / bullet

Automatically exported from code.google.com/p/bullet
Other
0 stars 0 forks source link

Regression in friction and damping behaviour #752

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Revision 2547 changed the way friction and damping behave.
Now bodies will still slide along each other even if friction is set to 1 and 
gravity will still move bodies when damping is set to 1.

This is because of the changes to the way velocity is integrated now.
Unfortunately I couldnt find an obvious fix for this after looking into it for 
a bit (besides reverting the btSolverBody changes).

To demonstrate the problem I attached a simple .blend file.
Just open it with blender version >= 2.67 and follow the instructions, hope 
it's not too inconvenient.

Original issue reported on code.google.com by sergej.r...@googlemail.com on 19 Oct 2013 at 2:06

Attachments:

GoogleCodeExporter commented 8 years ago
Is that still an issue with latest Bullet trunk? What Bullet version does 
Blender use nowadays?

Thanks for the report,
Erwin

Original comment by erwin.coumans on 19 Oct 2013 at 2:54

GoogleCodeExporter commented 8 years ago
Yes, the problem is still in the latest trunk.
Blender currently uses r2636.

Original comment by sergej.r...@googlemail.com on 19 Oct 2013 at 3:09

GoogleCodeExporter commented 8 years ago
The friction values are not between 0 and 1, you can increase friction values 
above 1. Can you increase the friction values and see if you can get desired 
behavior?

We need to figure out if the new behavior is expected or a real bug. Note that 
Bullet behavior does change, due to various issues. I'm very busy with all kind 
of other work in Bullet 2.x and Bullet 3.x, so I can't promise when I can 
address it.

Original comment by erwin.coumans on 19 Oct 2013 at 4:29

GoogleCodeExporter commented 8 years ago
I tried using higher friction values as well as different solverMode flags, but 
nothing helped.
It seems like is extra velocity is always added.
This is definitely the case for damping, since now damping is applied before 
the velocity update.

Original comment by sergej.r...@googlemail.com on 19 Oct 2013 at 4:38

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Let's first discuss friction only, and not damping, to avoid mixing up issues.

So you are saying that no matter how large the friction values are (for both 
objects), objects keep on sliding forever? I don't see that behaviour in any of 
the Bullet demos.

Original comment by erwin.coumans on 19 Oct 2013 at 4:48

GoogleCodeExporter commented 8 years ago
Yes, objects keep sliding forever regardles of friction values.
Could it be that objects are simply deactivated in the demos?

Original comment by sergej.r...@googlemail.com on 19 Oct 2013 at 5:00

GoogleCodeExporter commented 8 years ago
No, I've never seen such behaviour. You can disable 'deactivation' in all the 
demos by pressing the 'd' key.

So dropping a cube on another (non-sloped) static cube with regular gravity, 
will slide forever?

Original comment by erwin.coumans on 19 Oct 2013 at 5:11

GoogleCodeExporter commented 8 years ago
If there is no slope there is no issue.

Original comment by sergej.r...@googlemail.com on 19 Oct 2013 at 5:14

GoogleCodeExporter commented 8 years ago
>>If there is no slope there is no issue.
Ah, that essential information was missing. I'll look into fixing it for next 
2.82 release (soon).

(I haven't opened the .blend file, because I haven't been able to get used to 
the new Blender 2.5+ interface, I'm still using Blender 2.49)

Original comment by erwin.coumans on 19 Oct 2013 at 5:19

GoogleCodeExporter commented 8 years ago
Oh, I can also provide a .bullet file or even a bullet demo next time I find a 
problem if needed :)

(.blend file was just faster)

Original comment by sergej.r...@googlemail.com on 19 Oct 2013 at 5:30

GoogleCodeExporter commented 8 years ago
This one should be easy to reproduce.

It would be nice to add .bullet export and import in Blender in the future 
(through the FILE menu). Some people ask for it.

Original comment by erwin.coumans on 19 Oct 2013 at 5:31

GoogleCodeExporter commented 8 years ago
Yeah, it's just not quite clear how to expose the .bullet export in the UI.
I'll try to push for it, should be possible to add it for the next version.

Original comment by sergej.r...@googlemail.com on 19 Oct 2013 at 5:42

GoogleCodeExporter commented 8 years ago
I am trying to fix it, can you try latest trunk?
https://code.google.com/p/bullet/source/detail?r=2690

I used attached BasicDemo.cpp to reproduce/fix it.

Original comment by erwin.coumans on 22 Oct 2013 at 9:27

Attachments:

GoogleCodeExporter commented 8 years ago
Thans for the quick fix!
Friction seems to be fixed now.
Damping still behaves differently, previously other objects could still move 
the damped object (when damping is set to 1) which is useful for certain 
effects.
I'm not sure if this should be considered a bug though.

Original comment by sergej.r...@googlemail.com on 24 Oct 2013 at 9:55

GoogleCodeExporter commented 8 years ago
ok, thanks for confirming the friction fix.
I reverted the damping back to previous, it will not damp 100%, but at least 
objects can move it.

Damping is not capable or designed to stop objects entirely (even through it 
previously had that effect), it is designed to reduce a small fraction of the 
velocity (not 100%)

Re-uploaded revision 2704 as Bullet 2.82 release (there was an issue with 
double precision build)
http://code.google.com/p/bullet/source/detail?r=2705

Original comment by erwin.coumans on 24 Oct 2013 at 6:43