So here's what I have: ***** FRICTION ***** Here are the possibilities we've considered: • The product of the two frictions • The geometric mean (sqrt(a*b)) • The lower of the two • The higher of the two
Frictions 1000 on 0.001 get the same as 1 on 1. Therefore it has to be product-related.
The only way I can determine one vs two is to have a single-bounce test, where the friction ideally restricts the velocity of the object. If it's #1 then frictions {1,2} will have twice the restriction as {1,1}. If it's #2 then frictions {1,2} will have sqrt(2) times the slowing of {1,1}. At least, I think this is how friction works.
***** RESTITUTION ***** I'm 95% confident it's simply the higher of the two. When a 1-restitution object hits anything less than 1, the result is 1. Simple as that. We could use tests with the OnPostCollide function and get the linear velocity, but eh. Unless someone has a profound argument against it, we'll assume it's the higher number.----------------- If less people are active, that will only make for even less activity. Start making those designs! Currently working on a one-round no-elimination quick RP game...
On mine both blocks go "12.555648000000003" meters away from the start.----------------- If less people are active, that will only make for even less activity. Start making those designs! Currently working on a one-round no-elimination quick RP game...
A few years ago we had some discussion on this topic, and I've fished out the known results: - Friction is the signed geometric mean of the absolute friction values (or sgn(f1*f2) * sqrt(abs(f1*f2)) ). - Restitution is the greater of the two values.
Good to see that you're thinking about this though! If you wanted to find it out for yourself, it's a matter of approaching it scientifically - try designing methods to obtain more empirical evidence like I did (to a limited extent) for restitution:
Why is it that? Multiplication of the two values would've made much more sense. :P That way, 0 restitution shapes would be able to actually stop a shape with >1 restitution completely. (Realistically.)----------------- Orange is my favorite number.
I also did some testing with friction a while back, i add varuos identical balls of varing frictions ranging from 0 to 1.something, and i found that after a bit, there was no differance in the speed at which the objects went.----------------- puzzled
Xyuzhg is right. Here is the source code: https://github.com/Phyard/Phyard-Builder/blob/master/external/box2d_as3_v210/Box2D/Common/b2Settings.as
This is the current implementation. It would be easy to support more implementations, even can be implemented as an event handler style callback.----------------- My games: Tapir Games My phyards: Tapir@phyard
btw, I moved the Phyard Builder project from bitbucket to github. I just added a feature request there: https://github.com/Phyard/Phyard-Builder/issues----------------- My games: Tapir Games My phyards: Tapir@phyard
Unfortunately, I don't know Flash.----------------- If less people are active, that will only make for even less activity. Start making those designs! Currently working on a one-round no-elimination quick RP game...