Difference between revisions of "LlGetObjectMass"

From Second Life Wiki
Jump to navigation Jump to search
m
m (Replaced <source> with <syntaxhighlight>)
 
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-2={{LSL_Function/uuid|id|sim=*|object=*|group=}}
|func_id=295|func_sleep=0.0|func_energy=10.0
|func_id=295|func_sleep=0.0|func_energy=10.0
|func=llGetObjectMass
|func=llGetObjectMass
|return_type=float|p1_type=key|p1_name=id|p1_desc=Avatar or object in the sim
|return_type=float|p1_type=key|p1_name=id
|func_footnote
|func_footnote
|func_desc
|func_desc
Line 8: Line 9:
|spec
|spec
|caveats=
|caveats=
*Returns zero if '''id''' is not found in the sim.
* Returns zero if '''id''' is not found in the region.
* '''id''' can be any prim in the object.
|constants
|constants
|examples=
|examples=
<lsl>default
<syntaxhighlight lang="lsl2">default
{
{
     touch(integer n)
     touch(integer n)
     {
     {
         llSay(0, llDetectedName(0) + " your mass is " + (string)llGetObjectMass( llDetectedKey(0)) + " Lindens.");
         llSay(0, llDetectedName(0) + " your mass is " + (string)llGetObjectMass(llDetectedKey(0)) + " lindogram.");
     }
     }
}//Anylyn Hax 15:02, 28 July 2007 (PDT)</lsl>
}
//Anylyn Hax 15:02, 28 July 2007 (PDT)</syntaxhighlight>
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||[[llGetMass]]|Gets the current object mass.}}
{{LSL DefineRow||[[llGetMass]]|Gets the current object mass.}}
|also_tests
|also_tests=
{{LSL DefineRow||[[llGetObjectMass_Test]]}}
|also_events
|also_events
|also_articles
|also_articles
|history=Prior to server code version 1.18.6.76747 avatar mass was fixed at 1.954922 Lindens. It is now relative to Avatar shape/size.
|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.
|notes=
|notes=
* Mass for Avatars is relative to shape/size, and unaffected by attachments.
* [http://en.wikipedia.org/wiki/Mass Mass] in SL is expressed as ''lindogram''. One lindogram appears to be equal to 100 kilograms.
* Mass[m] is the quantity of material that something contains, and is expressed in Kg (Kilogramms). The Weight [G] is a Force, expressed in N (Newtons), and it is m * g, where g is the the gravitational atraction (g = 9.81 on Earth). Mass is NOT weight or density. Ex. objects with bouancy still have mass and still require energy to move.
* 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.
|cat1=Object
|cat1=Object
|cat2=Physics
|cat2=Physics

Latest revision as of 09:40, 4 September 2023

Summary

Function: float llGetObjectMass( key id );
0.0 Forced Delay
10.0 Energy

Returns a float that is the mass of id

• key id 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.

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.

Tests

•  llGetObjectMass_Test

Signature

function float llGetObjectMass( key id );