Used to set the physical characteristics of an object.

Syntax

void llSetPhysicsMaterial( integer mask, float gravity_multiplier, float restitution, float friction, float density );
integer DENSITY = 1;//range 1.0 to 22587.0 (in kg/m^3), default: 1000.0
integer FRICTION = 2;//range 0.0 to 255.0, default values are in the range 0.2 to 0.9
integer RESTITUTION = 4;//range 0.0 to 1.0, default values are in the range 0.3 to 0.9 (note, a collision between two objects with restitution 1.0 will still not be perfectly elastic due to damping in the physics engine)
integer GRAVITY_MULTIPLIER = 8;//range -1.0 to +28.0, default: 1.0

Parameters

integer mask
bitwise combination of DENSITY, FRICTION, RESTITUTION, and GRAVITY_MULTIPLIER and specifies which floats to actually apply
float gravity_multiplier
range gravity_multiplier (≥ -1.0, ≤ +28.0), default: 1.0
float restitution
range restitution (≥ 0.0, ≤ 1.0), default: restitution (≥ 0.3, ≤ 0.9) [1]
float friction
range friction (≥ 0.0, ≤ 255.0), default: friction (≥ 0.2, ≤ 0.9)[1]
float density
range density (≥ 1.0, ≤ 22587.0) kg/m^3, default: 1000.0

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

Constants

mask FlagsVDescription
DENSITY1Indicates that density parameter is enabled and will override the previous value.
FRICTION2Indicates that friction parameter is enabled and will override the previous value.
RESTITUTION4Indicates that restitution parameter is enabled and will override the previous value.
GRAVITY_MULTIPLIER8Indicates that gravity_multiplier parameter is enabled and will override the previous value.

Caveats

Examples

     llSetPhysicsMaterial(FRICTION, 1.0,0.9,0.1,0.5); // Sets FRICTION to 0.1
     llSetPhysicsMaterial(GRAVITY_MULTIPLIER | RESTITUTION | FRICTION | DENSITY, 0.5,0.9,0.1,1.0);

See also

Constants

Functions

Deep notes

Material Defaults

Using PRIM_MATERIAL changes the the values for friction and restitution to the values listed for the material type.

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

llSetPhysicsMaterial cannot use these flags.

History

Date of Release 23/09/2011

Tests

Footnotes

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