Difference between revisions of "LlSetBuoyancy"

From Second Life Wiki
Jump to navigation Jump to search
Line 5: Line 5:
|func=llSetBuoyancy
|func=llSetBuoyancy
|p1_type=float|p1_name=buoyancy|p1_desc
|p1_type=float|p1_name=buoyancy|p1_desc
|func_desc=Sets the buoyancy of the task or object.
|func_desc=Sets the buoyancy of the task or object. Requires [[STATUS_PHYSICS|physics]] to be enabled.
|func_footnote=if ('''buoyancy''' == 0.0) disables<br/>if ('''buoyancy''' < 1.0) sinks <br/>if ('''buoyancy''' == 1.0) floats <br/>If ('''buoyancy''' > 1.0) rises
|func_footnote=if ('''buoyancy''' == 0.0) disables<br/>if ('''buoyancy''' < 1.0) sinks <br/>if ('''buoyancy''' == 1.0) floats <br/>if ('''buoyancy''' > 1.0) rises
|spec
|spec
|caveats=*[[llWind|Wind]] can cause the prim to drift.
|caveats=*[[llWind|Wind]] can cause the prim to drift.
*Unlike some other characteristics, this is cancelled if the script that set buoyancy is removed from the prim.
*Unlike some other characteristics, this is cancelled if the script that set buoyancy is removed from the prim.
*This function eats [[energy]] to keep the object floating. Large objects many not be able to supply enough energy to keep the object floating.
|constants
|constants
|examples=Makes an object float up slowly (e.g. a red balloon)<pre>
|examples=Makes an object float up slowly (e.g. a red balloon)<pre>

Revision as of 00:31, 8 August 2007

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.
  • Unlike some other characteristics, this is cancelled if the script that set buoyancy is removed from the prim.
  • This function eats energy to keep the object floating. Large objects many not be able to supply enough energy to keep the object floating.
All Issues ~ Search JIRA for related Bugs

Examples

Makes an object float up slowly (e.g. a red balloon)
default
{
    state_entry()
    {
        llSetStatus(STATUS_PHYSICS, TRUE);
        llSetBuoyancy(1.05);
    }
}

Deep Notes

Search JIRA for related Issues

Signature

function void llSetBuoyancy( float buoyancy );