llSetPhysicsMaterial
function
Function syntax
llSetPhysicsMaterial(integer mask,// Bitwise mask combination specifying which of the floats (DENSITY,FRICTION,RESTITUTION, orGRAVITY_MULTIPLIER) to apply. Values: PhysicsMaterialParamfloat gravity_multiplier,// Gravity multiplier float value (range [-1.0, +28.0], default is 1.0).float restitution,// Elasticity restitution float value (range [0.0, 1.0]).float friction,// Friction coefficient float value (range [0.0, 255.0]).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.
llSetPhysicsMaterial(0, 0.0, 0.0, 0.0, 0.0);Specification
Section titled “Specification”| mask Flags | V | Description | |||||
|---|---|---|---|---|---|---|---|
DENSITY | 1 | Indicates that density parameter is enabled and will override the previous value. | |||||
FRICTION | 2 | Indicates that friction parameter is enabled and will override the previous value. | |||||
RESTITUTION | 4 | Indicates that restitution parameter is enabled and will override the previous value. | |||||
GRAVITY_MULTIPLIER | 8 | Indicates that gravity_multiplier parameter is enabled and will override the previous value. | |||||
Caveats
Section titled “Caveats”- Using
PRIM_MATERIALto set the material type will reset the values for friction and restitution to that material’s defaults. llSetPhysicsMaterialsilently fails if called from an attachment.
Examples
Section titled “Examples”Example 1
- Basic Example
llSetPhysicsMaterial(FRICTION, 1.0,0.9,0.1,0.5); // Sets FRICTION to 0.1Example 2
- Multiple Settings
llSetPhysicsMaterial(GRAVITY_MULTIPLIER | RESTITUTION | FRICTION | DENSITY, 0.5,0.9,0.1,1.0);History
Section titled “History”Date of Release 23/09/2011
See also
Section titled “See also”Functions
Section titled “Functions”llGetPhysicsMaterialllSetBuoyancy— Set how gravity interacts with an object. Works in attachments (changes are applied to the avatar).
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.