Difference between revisions of "LlGetObjectMass"

From Second Life Wiki
Jump to navigation Jump to search
m (Clarified that one lindogram is basically 100 kilograms, and avatars are apparently much denser than one would expect.)
m (Added a tip that llGetObjectMass() is a handy way to see if an object or avatar with a particular key still exists on a region (hat tip scotty.muircastle))
Line 34: Line 34:
* Sitting avatars add their mass to the object.
* Sitting avatars add their mass to the object.
* This function returns a mass of 0.01 for child agents.
* This function returns a mass of 0.01 for child agents.
* This function is a handy way to determine if an object or avatar still exists on a region. Other methods exist (such as checking that [[OBJECT_OWNER]] returned by [[llGetObjectDetails]] is a valid key), but this has slightly less overhead.
|cat1=Object
|cat1=Object
|cat2=Physics
|cat2=Physics

Revision as of 18:30, 15 December 2018

Summary

Function: float llGetObjectMass( key id );

Returns a float that is the mass of id

• key id group, avatar or object UUID that is in the same region

Caveats

  • Returns zero if id is not found in the region.
  • id can be any prim in the object.
All Issues ~ Search JIRA for related Bugs

Examples

default
{
    touch(integer n)
    {
        llSay(0, llDetectedName(0) + " your mass is " + (string)llGetObjectMass( llDetectedKey(0)) + " lindogram.");
    }
}
//Anylyn Hax 15:02, 28 July 2007 (PDT)

Notes

  • Mass in SL is expressed as lindogram. One lindogram appears to be equal to 100 kilograms.
  • Mass for avatars is relative to shape/size, and unaffected by attachments. However, a survey of masses for avatars shows less variation than one would expect relative to shape/size, and the lindogram masses do not appear in any way realistic.
  • Sitting avatars add their mass to the object.
  • This function returns a mass of 0.01 for child agents.
  • This function is a handy way to determine if an object or avatar still exists on a region. Other methods exist (such as checking that OBJECT_OWNER returned by llGetObjectDetails is a valid key), but this has slightly less overhead.

See Also

Functions

•  llGetMass Gets the current object mass.

Deep Notes

History

Prior to server code version 1.18.6.76747 avatar mass was fixed at 1.954922 lindogram. It is now relative to Avatar shape/size.
Search JIRA for related Issues

Tests

•  llGetObjectMass_Test

Signature

function float llGetObjectMass( key id );