Used to get the physical characteristics of an object.

Syntax

list llGetPhysicsMaterial();

Return value

Returns a list in the form [ float gravity_multiplier, float restitution, float friction, float density ]

floatgravity_multiplierrange gravity_multiplier (≥ -1.0, ≤ +28.0), default: 1.0
floatrestitutionrange restitution (≥ 0.0, ≤ 1.0), default: restitution (≥ 0.3, ≤ 0.9) [1]
floatfrictionrange friction (≥ 0.0, ≤ 255.0), default: friction (≥ 0.2, ≤ 0.9)[1]
floatdensityrange density (≥ 1.0, ≤ 22587.0) kg/m^3, default: 1000.0

The default values for friction and restitution depend upon the material type.

Caveats

Examples

default
{
    touch_start(integer total_number)
    {
        list params = llGetPhysicsMaterial();
        llOwnerSay(
            "\nGravity multiplier: " + (string)llList2Float(params, 0) +
            "\nRestitution: " + (string)llList2Float(params, 1) +
            "\nFriction: " + (string)llList2Float(params, 2) +
            "\nDensity: " + (string)llList2Float(params, 3) + "kg/m^3"
        );
    }
}

See also

Constants

Functions

Deep notes

Material Defaults

material FlagsDescriptionFrictionRestitution
PRIM_MATERIAL_STONE0stone0.80.4
PRIM_MATERIAL_METAL1metal0.30.4
PRIM_MATERIAL_GLASS2glass0.20.7
PRIM_MATERIAL_WOOD3wood0.60.5
PRIM_MATERIAL_FLESH4flesh0.90.3
PRIM_MATERIAL_PLASTIC5plastic0.40.7
PRIM_MATERIAL_RUBBER6rubber0.90.9
PRIM_MATERIAL_LIGHT7light, DEPRECATED: Looks the same as [ PRIM_FULLBRIGHT, ALL_SIDES, TRUE ]0.60.5

History

Date of Release 23/09/2011

Tests

Footnotes

  1. The default values for friction and restitution depend upon the prim's material.