Difference between revisions of "LlGetMass"

From Second Life Wiki
Jump to navigation Jump to search
m
(16 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|func_id=109|func_sleep=0.0|func_energy=10.0
|func_id=109|func_sleep=0.0|func_energy=10.0|func=llGetMass|return_type=float
|func=llGetMass|return_type=float
|func_footnote
|func_footnote
|func_desc
|func_desc
|return_text=that is the mass of object that script is attached to.
|return_text=that is the mass of object (in Lindograms) that script is attached to.
|spec
|spec
|caveats
|caveats=*Attachments do not effect an avatar's mass, only certain Appearance settings.
|constants
|constants
|examples
|examples=<source lang="lsl2">//A way of making a constant force that returns the same speed visually whatever the object is
default
{
    touch_start()
    {
        llApplyImpulse(<0.0, 0.0, 5.0> * llGetMass(), FALSE);
        // This fires the object up at the same m/s whatever the size (or difference!)
    }
}//Written by El Taka</source>
NOTE:This example is inaccurate because [[llApplyImpulse]] measures the force in Kilograms. For a more accurate useage it is recommended to use [[llGetMassMKS]] for solving weight compensation.
|helpers
|helpers
|also_functions
|also_functions=
{{LSL DefineRow||[[llGetObjectMass]]|Gets the object mass.}}
{{LSL DefineRow||[[llGetForce]]|Gets the objects force}}
{{LSL DefineRow||[[llGetOmega]]|}}
{{LSL DefineRow||[[llGetVel]]|}}
{{LSL DefineRow||[[llGetTorque]]|}}
{{LSL DefineRow||[[llGetAccel]]|}}
{{LSL DefineRow||[[llGetMassMKS]]|}}
|also_events
|also_events
|also_tests
|also_tests
Line 18: Line 33:
|negative_index
|negative_index
|cat1=Physics
|cat1=Physics
|cat2
|cat2=Object
|cat3
|cat3
|cat4=Stub
|cat4
}}
}}

Revision as of 02:11, 22 January 2015

Summary

Function: float llGetMass( );

Returns a float that is the mass of object (in Lindograms) that script is attached to.

Caveats

  • Attachments do not effect an avatar's mass, only certain Appearance settings.
All Issues ~ Search JIRA for related Bugs

Examples

//A way of making a constant force that returns the same speed visually whatever the object is
default
{
    touch_start()
    {
        llApplyImpulse(<0.0, 0.0, 5.0> * llGetMass(), FALSE);
        // This fires the object up at the same m/s whatever the size (or difference!)
    }
}//Written by El Taka
NOTE:This example is inaccurate because llApplyImpulse measures the force in Kilograms. For a more accurate useage it is recommended to use llGetMassMKS for solving weight compensation.

See Also

Functions

•  llGetObjectMass Gets the object mass.
•  llGetForce Gets the objects force
•  llGetOmega
•  llGetVel
•  llGetTorque
•  llGetAccel
•  llGetMassMKS

Deep Notes

Search JIRA for related Issues

Signature

function float llGetMass();