Difference between revisions of "LlSetPhysicsMaterial"

From Second Life Wiki
Jump to navigation Jump to search
m (Category sort key)
m
Line 1: Line 1:
''NOTE: This article is a stub. Content taken from [[Release Notes/Second Life Server/11#11.09.23.241511]]''
{{LSL Function
 
|inject-2=
void llSetPhysicsMaterial( integer material_bits, float gravity_multiplier, float restitution, float friction, float density )
<!-- caveats & parameter descriptions imported from PRIM_PHYSICS_MATERIAL article -->
 
{{:PRIM_PHYSICS_MATERIAL}}
* material_bits is a bitwise combination of DENSITY, FRICTION, RESTITUTION, and GRAVITY_MULTIPLIER and specifies which floats to actually apply
|func=llSetPhysicsMaterial
* gravity_multiplier must be between -1.0 and +28.0
|func_id=?
* restitution must be between 0.0 and 1.0 (note, a collision between two objects with restitution 1.0 will still not be perfectly elastic due to damping in the physics engine)
|func_desc=Used to set the physical characteristics of an object.
* friction must be between 0.0 and 255.0
|history=Content taken from [[Release Notes/Second Life Server/11#11.09.23.241511]]''
* density must be between 1.0 and 22587.0 (in kg/m^3 -- see if you can figure out what 22587 represents)
|p1_type=integer|p1_name=material_bits
 
|p2_type=float|p2_name=gravity_multiplier
[[Category:LSL Physics|SetPhysicsMaterial]]
|p3_type=float|p3_name=restitution
[[Category:LSL Functions|SetPhysicsMaterial]]
|p4_type=float|p4_name=friction
|p5_type=float|p5_name=density
|cat1=Physics
}}

Revision as of 10:44, 20 January 2012

Summary

Function: llSetPhysicsMaterial( integer material_bits, float gravity_multiplier, float restitution, float friction, float density );

Used to set the physical characteristics of an object.

• integer material_bits
• float gravity_multiplier range [-1.0, +28.0], default: 1.0
• float restitution range [0.0, 1.0], default: [0.3, 0.9] [1]
• float friction range [0.0, 255.0], default: [0.2, 0.9][1]
• float density range [1.0, 22587.0] kg/m^3, default: 1000.0

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

Caveats

  • A collision between two objects with restitution 1.0 will still not be perfectly elastic due to damping in the physics engine.

Examples

Deep Notes

History

Content taken from Release Notes/Second Life Server/11#11.09.23.241511

Footnotes

  1. ^ The default values for friction and restitution depend upon the prim's material.
  2. ^ The ranges in this article are written in Interval Notation.

Signature

function void llSetPhysicsMaterial( integer material_bits, float gravity_multiplier, float restitution, float friction, float density );