LlGetObjectMass: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Anylyn Hax (talk | contribs)
No edit summary
Strife Onizuka (talk | contribs)
mNo edit summary
(9 intermediate revisions by 6 users not shown)
Line 2: Line 2:
|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=Agent or object
|return_type=float|p1_type=key|p1_name=id|p1_desc=Avatar or object in the sim
|func_footnote
|func_footnote
|func_desc
|func_desc
|return_text=that is the mass of '''id'''
|return_text=that is the mass of '''id'''
|spec
|spec
|caveats
|caveats=
*Returns zero if '''id''' is not found in the sim.
|constants
|constants
|examples=<pre>
|examples=
This one of my favorite, because it is a example of usless function.
<lsl>default
Every avatar, regardless how tall he is, or how much soup he has got from his mama, weight 19.177782 N. (1.954922 Kg)
Try it ;
default
{
{
  touch(integer n)
    touch(integer n)
  {
    {
  llSay(0, llDetectedName(0) + " your weight is " + (string)(llGetObjectMass( llDetectedKey(0) ) * 9.81) + " N ");
        llSay(0, llDetectedName(0) + " your mass is " + (string)llGetObjectMass( llDetectedKey(0)) + " lindogram.");
  }
    }
}
}
Because 50% of my students don't know difference between mass and weight, I whould like to explain it here again.
//Anylyn Hax 15:02, 28 July 2007 (PDT)</lsl>
Mass [m] is the quantity of materia that a avatar has inside itself, 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.
On the Earth the g is 9.81 m/s², on the Moon 1.63 m/s², on Venus 8.60 m/s², on Mars 3.70 m/s² and on the Sun 274 m/s².
</pre>
Anylyn Hax 15:02, 28 July 2007 (PDT)
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||{{LSLG|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
|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.
|notes=
* [http://en.wikipedia.org/wiki/Mass Mass] in SL is expressed as ''lindogram''.
* Mass for avatars is relative to shape/size, and unaffected by attachments.
|cat1=Object
|cat1=Object
|cat2
|cat2=Physics
|cat3
|cat3
|cat4
|cat4
}}
}}

Revision as of 12:44, 3 November 2008

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 in the sim

Caveats

  • Returns zero if id is not found in the sim.

Examples

<lsl>default {

   touch(integer n)
   {
       llSay(0, llDetectedName(0) + " your mass is " + (string)llGetObjectMass( llDetectedKey(0)) + " lindogram.");
   }

}

//Anylyn Hax 15:02, 28 July 2007 (PDT)</lsl>

Notes

  • Mass in SL is expressed as lindogram.
  • Mass for avatars is relative to shape/size, and unaffected by attachments.

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 );