chenynCV / bullet

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

Optimization proposal for btRigidBody::applyDamping() #694

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm working not with damping in my project and found that in  
btRigidBody::applyDamping() damping applied always, even if it's zero. And as 
mentioned here, btPow() is a performance heavy function. Is not it better to 
skip application of damping, if it's zero, because usually for most objects you 
will not use it. Patch against trunk attached.

Original issue reported on code.google.com by Anton.Br...@gmail.com on 4 Feb 2013 at 12:10

Attachments:

GoogleCodeExporter commented 9 years ago
* working now with damping...

Original comment by Anton.Br...@gmail.com on 4 Feb 2013 at 12:12

GoogleCodeExporter commented 9 years ago
Any info on this?

Original comment by Anton.Br...@gmail.com on 28 Oct 2013 at 9:46

GoogleCodeExporter commented 9 years ago
I wanted to get a Bullet release of of the door, and had to pick some issue to 
fix (fixing all of them would be too much time). I'll plan to fix this for the 
next release, it seems fairly trivial to apply and test.

thanks!

Original comment by erwin.coumans on 28 Oct 2013 at 6:35

GoogleCodeExporter commented 9 years ago
That's great. By the way, should it be "!= 0" or "> 0" like I wrote? Maybe it's 
better to change it to "!= 0" for some crazy custom stuff like negative 
damping? ;-)

Original comment by Anton.Br...@gmail.com on 28 Oct 2013 at 7:37

GoogleCodeExporter commented 9 years ago
If you add a !=0, you would trigger some warning when using -Wfloat-equal, see 
this issue:

https://code.google.com/p/bullet/issues/detail?id=756&colspec=Modified%20ID%20Ty
pe%20Stars%20Status%20Owner%20Summary

so at least there should be a fuzzyZero check ;-)

Original comment by erwin.coumans on 28 Oct 2013 at 7:42

GoogleCodeExporter commented 9 years ago
Hmm, and it emits this warning even for comparisons with zero constant value? I 
always thought that exact comparisons with zero are OK because zero will be 
always zero no matter how you cast it. I'm reading this discussion 
http://stackoverflow.com/questions/3915138/comparing-floating-point-0#comment417
4486_3915200 and it seems that there will be problems only when comparing to 
NaN/infinite values. But maybe compiler is too paranoid, so yes, either do 
"epsilon" compare or just "> 0".

Original comment by Anton.Br...@gmail.com on 28 Oct 2013 at 8:00

GoogleCodeExporter commented 9 years ago
moved to https://github.com/bulletphysics/bullet3/issues/80

Original comment by erwin.coumans on 30 Mar 2014 at 5:44