I think we would benefit greatly from the ability to set the buoyancy of individual objects, especially from script. This would solve a bunch of problems. This has been brought up before:

https://help.sansar.com/hc/en-us/community/posts/115000279067--FEATURE-Water-Buoyancy-for-Sansar?input_string=Buoyancy

One big problem I run into is that to animate smooth movements of things like my doors, I must set mass to 0. If I don't, the doors (etc.) continually drop down a little between updates. This works great, but then when someone tries to stand on top of one of these zero-mass objects, they go "crazy". Were I able to call Body.SetBuoyancy(-Body.GetMass()), then I could set the mass of such an object to a very high amount so it doesn't easily rotate, thanks to its momentum. And it will continue to float fairly smoothly.

Another good usage would be in dealing with airships and variable density atmospheres. Imagine such an airship that finds a natural elevation based on higher density "air" down lower. All you need to do that is to alter the buoyancy of the object based on its elevation.

An extreme example of variable buoyancy is air versus water. The thousand ton boat falls out of the sky, but because it displaces water, it resists sinking into the water. Again, it's enough to just have the buoyancy amount change continuously as a boat transitions up and down over, say, twenty feet of draft.

By being able to alter this in script, there's an awful lot we can do with dynamic objects.

It would be valuable to set the buoyancy for avatars in script, too.

• Gindipple

Air resistance, friction, mass to mass force, terminal velocity. There's a whole bunch of physics laws available.

Probably getting some basic statics working right should take precedence

Buoyancy is generally a concept associated with water, which we have none of yet.

• Galen

Yes, but water is just one use. And the physics of buoyancy should be very easy to implement.

• gfcprogramer

Galen, buoyancy is fantastic,  Its all we need to simulate gravity. It would instead of shaking like a hell, skyrocket into heaven for being inside another poly, just diminish into a wave pattern in a harden/frozen/coagulated matter, called by our fellow terrestrians: wood or metal.

We have so much so much to explore. And there is so much so much wrong and limited statements in the fundamental physics they teach you on "MITs" of this time and dimension.

• Galen

RigidBodyComponent.SetBuoyancy(float Buoyancy, [ float AtElevation ], [ float Gradient ])

In this case, Buoyancy represents how much mass can be displaced and would typically be derived from RigidBodyComponent.GetMass().

AtElevation, an optional parameter, would indicate the Z value where the specific buoyancy amount is equal to what it passed in. This would only have meaning if Gradient is also supplied. Gradient represents how the buoyancy changes as one goes farther above or below AtElevation. By default it would be 1, meaning the buoyancy is the same at all elevations. The specific buoyancy value the object would have would be computed as Buoyancy + MyCurrentMass * Gradient * (AtElevation - MyCurrentElevation).

And, of course, this buoyancy amount would essentially be a force with its vector pointing up to counter the force of gravity pulling down. This computation should not add much cost at all to the physics engine.

This would be quite useful for a number of scenarios. For example, a boat could use this function to define how it rises and falls in the water within its narrow range between where it is completely above water or finally underwater. When it gets to either condition, the control script would call this function to change its buoyancy function again, of course, to make it sink or behave like an object falling in air.

But this could also be used for airships with a much shallower gradient to simulate the impact of different air pressures at different elevations.

There are different ways to express a .SetBuoyancy() method, too. The one I suggest above is just one way. Buoyancy could be a multiplier that is applied to the object's mass, for instance, so a value of 1 would be perfectly countering the mass and a value of 0 would be equal to no buoyancy at all. And the gradient could be represented as the elevation where buoyancy is 0 and the elevation where it is 1, and above or below that range, the buoyancy would simply go above 1 or below 0, respectively.

Edited by Galen
• Gindipple

We're going to need the ideal gas law implemented as well lol

Air pressures ya know

• Galen

That sounds like overkill. I'm not proposing that they add a perfect fluid dynamics model. My suggestion is for something pretty simple that whose calculations would be a trivial addition for the physics engine.