Hi again, Greg! I agree that it needs a new attribute, but it's gravity that makes mass continue down, not the sudden loss of drag. In our simple simulation a constant drag force applied in opposite to gravity should be sufficient, we don't have to take in account all the other details of non-solid friction. Naturally, just like in real life the drag force cannot exceed the force pulling it down, i.e gravity. A drag force equal to gravity would be considered solid, anything below make it sink very slow or very fast depending on viscosity.
I'm experimenting with something now that simulates viscosity using the extra attribute "viscosity" where 0.0 is vacuum and 1.0 is a solid. What happens in zero gravity is that the drag actually will stop the bodies at some point given enough time in the netwonian fluid unless other forces are applied. I haven't started experimenting with bouyancy yet, that will be done in a separate step and involves only already existing attributes (mass and, normally volume, but for us area), but I'm thinking of adding "density" as an extra attribute, I'll get into detail on this once I have viscosity working. The one thing I have not been able to do yet is properly reduce rotation velocity, if an edge hits the "water" with enough speed it should roll on the surface until the drag has reduced it to zero. There's all sorts of odd circumstances that doesn't have to work. The normal case is having a huge area with water with a large mass. A smaller solid object falls into and penetrates the water, but consider the other way around; Small fluid objects hitting a large solid, in particular statics, will seem to sink into the solid, this behavior does not work or look like rain hitting pavement, for example. I think this is a fair trade-off for the 99% of the time scenario where solids and non-solids hit large areas of static non-solids. I could even go as far as to decide that all non-solids are considered static in our little pretend universe, just because that is how they will mostly be used. Other simulations will require enhancement outside the scope of simple game creation. /Peter On 2008-08-17 (Sun) 11:40, Greg Ewing wrote: > Peter Gebauer wrote: > >> Great point, I was thinking about using the friction attribute to >> achieve this, but maybe something like viscosity is better to calculate >> drag? > > A separate parameter would probably be better, since unlike > friction between solid surfaces, the drag force has to be > velocity-dependent -- otherwise the object would slow down > and stop somewhere in the fluid instead of reaching a > terminal velocity. > > -- > Greg > >