Difference between revisions of "LlSetBuoyancy"

From Second Life Wiki
Jump to navigation Jump to search
(adding caveat for comparison with llSetPhysicsMaterial)
(adding second difference with llSetPhysicsMaterial( GRAVITY_MULTIPLIER)
Line 14: Line 14:
* For better performances , replace by [[llSetPhysicsMaterial]](GRAVITY_MULTIPLIER , gravity ,0.0,0.0,0.0) who doesn t eat energy
* For better performances , replace by [[llSetPhysicsMaterial]](GRAVITY_MULTIPLIER , gravity ,0.0,0.0,0.0) who doesn t eat energy
|constants . For instance , replace llSetBuoyancy(1.5) by  llSetPhysicsMaterial( GRAVITY_MULTIPLIER, -0.5 ,0.0, 0.0, 0.0 ) to raise an object ; llSetBuoyancy(1.0) by  llSetPhysicsMaterial( GRAVITY_MULTIPLIER, 0.0 ,0.0, 0.0, 0.0 ) to float a object
|constants . For instance , replace llSetBuoyancy(1.5) by  llSetPhysicsMaterial( GRAVITY_MULTIPLIER, -0.5 ,0.0, 0.0, 0.0 ) to raise an object ; llSetBuoyancy(1.0) by  llSetPhysicsMaterial( GRAVITY_MULTIPLIER, 0.0 ,0.0, 0.0, 0.0 ) to float a object
*When you change the buoyancy , the object is again affect by the last value . For instance , if you set it to 1.5 to raise the object , and while the move , you change it to 0.0 , the object continues to raise while a moment , because  it doesn t inverse the force , it cancels it . With [[llSetPhysicsMaterial]]( GRAVITY_MULTIPLIER, -0.5 ,0.0, 0.0, 0.0 ) followed by [[llSetPhysicsMaterial]]( GRAVITY_MULTIPLIER, 1.0 ,0.0, 0.0, 0.0 ) , the change of the move is immediate , and the object starts to fall at the same time when the second call is done
|examples=Makes an object float up slowly (e.g. a red balloon)<lsl>default
|examples=Makes an object float up slowly (e.g. a red balloon)<lsl>default
{
{

Revision as of 00:31, 12 June 2013

Summary

Function: llSetBuoyancy( float buoyancy );

Sets the buoyancy of the task or object. Requires physics to be enabled.

• float buoyancy

if (buoyancy == 0.0) disables
if (buoyancy < 1.0) sinks
if (buoyancy == 1.0) floats
if (buoyancy > 1.0) rises

Caveats

  • Wind can cause the prim to drift. (server 1.38.4 this appears not to be true)
  • Unlike some other characteristics, this is cancelled if the script that set buoyancy is removed from the prim.
  • This function cannot be used to set relative levels of buoyancy in parts of a linked object e.g. to simulate a helium balloon weighted by its string. The most recent call of llSetBuoyancy in any child prim appears to set the global buoyancy level for the object.
  • This function eats energy to keep the object floating. Large objects may not be able to supply enough energy to keep the object floating.
  • For better performances , replace by llSetPhysicsMaterial(GRAVITY_MULTIPLIER , gravity ,0.0,0.0,0.0) who doesn t eat energy
All Issues ~ Search JIRA for related Bugs

Examples

Makes an object float up slowly (e.g. a red balloon)<lsl>default {

   state_entry()
   {
       llSetStatus(STATUS_PHYSICS, TRUE);
       llSetBuoyancy(1.05);
   }
}</lsl>

Notes

Often used to make an object look like gravity does not affect it.

Deep Notes

Search JIRA for related Issues

Signature

function void llSetBuoyancy( float buoyancy );