Difference between revisions of "LlSetPhysicsMaterial"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{LSL Function
{{LSL Function
|inject-2=
|inject-2={{LSL Function/physics materials}}
<!-- caveats & parameter descriptions imported from PRIM_PHYSICS_MATERIAL article -->
{{:PRIM_PHYSICS_MATERIAL|set}}
|func=llSetPhysicsMaterial
|func=llSetPhysicsMaterial
|func_id=?
|func_id=?
|func_desc=Used to set the physical characteristics of an object.
|func_desc=Used to set the physical characteristics of an object.
|constants=
{{{!}} class="sortable" {{Prettytable|style=margin-top:0;}}
{{!}}- {{Hl2}}
{{#var:physics_material_rows}}
{{!}}}
|history=Content taken from [[Release Notes/Second Life Server/11#11.09.23.241511]]''
|history=Content taken from [[Release Notes/Second Life Server/11#11.09.23.241511]]''
|p1_type=integer|p1_name=material_bits
|p1_type=integer|p1_name=material_bits
Line 19: Line 22:
|cat2=Material
|cat2=Material
|cat3=Physics/Material
|cat3=Physics/Material
|signature=
{{LSL Const/Signature|DENSITY|integer|1|c={{#var:p_density_hover}}}}
{{LSL Const/Signature|FRICTION|integer|2|c={{#var:p_friction_hover}}}}
{{LSL Const/Signature|RESTITUTION|integer|4|c={{#var:p_restitution_hover}}}}
{{LSL Const/Signature|GRAVITY_MULTIPLIER|integer|8|c={{#var:p_gravity_multiplier_hover}}}}
}}
}}

Revision as of 10:29, 8 August 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.

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

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

Examples

See Also

Functions

•  llGetPhysicsMaterial

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 );
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