Skip to content
lsl.devlsl.devLSL Dev

llSetPhysicsMaterial

function
Function syntax
llSetPhysicsMaterial(
  1. integer mask,// Bitwise mask combination specifying which of the floats (DENSITY, FRICTION, RESTITUTION, or GRAVITY_MULTIPLIER) to apply. Values: PhysicsMaterialParam
  2. float gravity_multiplier,// Gravity multiplier float value (range [-1.0, +28.0], default is 1.0).
  3. float restitution,// Elasticity restitution float value (range [0.0, 1.0]).
  4. float friction,// Friction coefficient float value (range [0.0, 255.0]).
  5. float density// Density float value in kg/m³ (range [1.0, 22587.0]).
);
Energy
10

Configures the physical characteristics of an object. The mask bitfield specifies which of the other parameters (gravity_multiplier, restitution, friction, or density) should be applied to the object.

Used to set the physical characteristics of an object.

How to use
llSetPhysicsMaterial(0, 0.0, 0.0, 0.0, 0.0);
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.
  • Using PRIM_MATERIAL to set the material type will reset the values for friction and restitution to that material’s defaults.
  • llSetPhysicsMaterial silently fails if called from an attachment.
Example 1
  • Basic Example
llSetPhysicsMaterial(FRICTION, 1.0,0.9,0.1,0.5); // Sets FRICTION to 0.1
Example 2
  • Multiple Settings
llSetPhysicsMaterial(GRAVITY_MULTIPLIER | RESTITUTION | FRICTION | DENSITY, 0.5,0.9,0.1,1.0);

Date of Release 23/09/2011

Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.