Difference between revisions of "PRIM PHYSICS MATERIAL"

From Second Life Wiki
Jump to navigation Jump to search
m
m (Move content to template)
 
(14 intermediate revisions by the same user not shown)
Line 3: Line 3:
{{#vardefine:physics_material_const|{{LSL Const|PRIM_PHYSICS_MATERIAL|integer|31|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the prim's physics material properties}}}}
{{#vardefine:physics_material_const|{{LSL Const|PRIM_PHYSICS_MATERIAL|integer|31|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the prim's physics material properties}}}}


{{#vardefine:p_material_bits_desc|bitwise combination of [[DENSITY]], [[FRICTION]], [[RESTITUTION]], and [[GRAVITY_MULTIPLIER]] and specifies which floats to actually apply}}
{{LSL_Function/physics_materials}}
{{#vardefine:p_gravity_multiplier_desc|between -1.0 and +28.0}}
{{#vardefine:p_restitution_desc|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)}}
{{#vardefine:p_friction_desc|between 0.0 and 255.0}}
{{#vardefine:p_density_desc|between 1.0 and 22587.0 (in [[llGetMassMKS|kg]]/m^3)}}
 
{{#vardefine:p_material_bits_hover|bitwise combination of DENSITY, FRICTION, RESTITUTION, and GRAVITY_MULTIPLIER and specifies which floats to actually apply}}
{{#vardefine:p_gravity_multiplier_hover|between -1.0 and +28.0}}
{{#vardefine:p_restitution_hover|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)}}
{{#vardefine:p_friction_hover|between 0.0 and 255.0}}
{{#vardefine:p_density_hover|between 1.0 and 22587.0 (in kg/m^3)}}


}}</onlyinclude>{{#if:
}}</onlyinclude>{{#if:
Line 19: Line 9:
}}
}}
{{LSL Constant
{{LSL Constant
|inject-1={{LSL_Generic/request{{#var:lang}}}}
|name=PRIM_PHYSICS_MATERIAL
|name=PRIM_PHYSICS_MATERIAL
|type=integer
|type=integer
Line 43: Line 34:
|r5_type=float|r5_name=density
|r5_type=float|r5_name=density
}}
}}
|pc=
{{{!}} class="sortable" {{Prettytable|style=margin-top:0;}}
{{!}}- {{Hl2}}
{{#var:physics_material_rows}}
{{!}}}
|examples
|examples
|constants=
|constants=
Line 56: Line 52:
<!--{{LSL DefineRow||[[changed]]|}}-->
<!--{{LSL DefineRow||[[changed]]|}}-->
|history=
|history=
*Introduced in [[Release Notes/Second Life RC BlueSteel/11#11.09.09.240509|Second Life RC BlueSteel 11.09.09.240509]], September 9, 2011
*Introduced in [[Release Notes/Second Life RC LeTigre/11#11.09.09.240509|Second Life RC LeTigre 11.09.09.240509]], September 9, 2011
*[http://www.sluniverse.com/php/vb/scripting/61203-future-physics-functions-tease.html#post1305775 SLUniverse:Future physics functions tease]
*[http://www.sluniverse.com/php/vb/scripting/61203-future-physics-functions-tease.html#post1305775 SLUniverse:Future physics functions tease]
|location
|location
|cat1=Prim
<!--|cat1=Prim
|cat2=Movement
|cat2=Movement
|cat3
|cat3=Material
|cat4
|cat4=Physics/Material-->
}}
}}

Latest revision as of 10:30, 8 August 2012

Emblem-important-yellow.png LSL Feature Request
The described constant does not exist. This article is a feature request.

Description

Constant: integer PRIM_PHYSICS_MATERIAL = 31;

The integer constant PRIM_PHYSICS_MATERIAL has the value 31

PRIM_PHYSICS_MATERIAL is used to get or set the prim's physics material properties.

llSetPrimitiveParams

llSetPrimitiveParams([ PRIM_PHYSICS_MATERIAL, integer material_bits, float gravity_multiplier, float restitution, float friction, float density ]);
• 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

When used with llSetPrimitiveParams & llSetLinkPrimitiveParams

llGetPrimitiveParams

llGetPrimitiveParams([ PRIM_PHYSICS_MATERIAL ]);

Returns the list [ integer material_bits, float gravity_multiplier, float restitution, float friction, float density ]

• 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
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.


Deep Notes

History

Search JIRA for related Issues

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

//integer PRIM_PHYSICS_MATERIAL = 31;