Difference between revisions of "PRIM PHYSICS MATERIAL"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 25: Line 25:


{{#vardefine:caveats|{{#var:caveats}}
{{#vardefine:caveats|{{#var:caveats}}
* A collision between two objects with '''{{LSL Param|restitution}}''' 1.0 will still not be perfectly elastic due to damping in the physics engine.
* A collision between two objects with {{LSLP|restitution}} 1.0 will still not be perfectly elastic due to damping in the physics engine.
}}
}}


{{#vardefine:physics_material_rows|
{{#vardefine:physics_material_rows|
!{{!}} {{LSL Param|material_bits}} Flags
!{{!}} {{LSLPT|material_bits}} Flags
! title="value" {{!}} V
! title="value" {{!}} V
! colspan="6" {{!}} Description
! colspan="6" {{!}} Description
Line 35: Line 35:
{{!}} {{LSL Const|DENSITY|integer|}}
{{!}} {{LSL Const|DENSITY|integer|}}
{{!}} {{#var:value}}
{{!}} {{#var:value}}
{{!}} colspan="6" {{!}} Indicates that '''{{LSL Param|density}}''' parameter is enabled
{{!}} colspan="6" {{!}} Indicates that {{LSLP|density}} parameter is enabled
{{!}}-
{{!}}-
{{!}} {{LSL Const|FRICTION|integer|}}
{{!}} {{LSL Const|FRICTION|integer|}}
{{!}} {{#var:value}}
{{!}} {{#var:value}}
{{!}} colspan="6" {{!}} Indicates that '''{{LSL Param|friction}}''' parameter is enabled
{{!}} colspan="6" {{!}} Indicates that {{LSLP|friction}} parameter is enabled
{{!}}-
{{!}}-
{{!}} {{LSL Const|RESTITUTION|integer|}}
{{!}} {{LSL Const|RESTITUTION|integer|}}
{{!}} {{#var:value}}
{{!}} {{#var:value}}
{{!}} colspan="6" {{!}} Indicates that '''{{LSL Param|restitution}}''' parameter is enabled
{{!}} colspan="6" {{!}} Indicates that {{LSLP|restitution}} parameter is enabled
{{!}}-
{{!}}-
{{!}} {{LSL Const|GRAVITY_MULTIPLIER|integer|}}
{{!}} {{LSL Const|GRAVITY_MULTIPLIER|integer|}}
{{!}} {{#var:value}}
{{!}} {{#var:value}}
{{!}} colspan="6" {{!}} Indicates that '''{{LSL Param|gravity_multiplier}}''' parameter is enabled
{{!}} colspan="6" {{!}} Indicates that {{LSLP|gravity_multiplier}} parameter is enabled
}}
}}



Revision as of 12:49, 8 June 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 bitwise combination of DENSITY, FRICTION, RESTITUTION, and GRAVITY_MULTIPLIER and specifies which floats to actually apply
• float gravity_multiplier range [-1.0, +28.0]
• float restitution range [0.0, 1.0]
• float friction range [0.0, 255.0]
• float density range [1.0, 22587.0] kg/m^3

When used with llSetPrimitiveParams & llSetLinkPrimitiveParams All Issues ~ Search JIRA for related Bugs

llGetPrimitiveParams

llGetPrimitiveParams([ PRIM_PHYSICS_MATERIAL ]);

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

• integer material_bits bitwise combination of DENSITY, FRICTION, RESTITUTION, and GRAVITY_MULTIPLIER and specifies which floats to actually apply
• float gravity_multiplier range [-1.0, +28.0]
• float restitution range [0.0, 1.0]
• float friction range [0.0, 255.0]
• float density range [1.0, 22587.0] kg/m^3

All Issues ~ Search JIRA for related Bugs

material_bits Flags V Description
DENSITY Indicates that density parameter is enabled
FRICTION Indicates that friction parameter is enabled
RESTITUTION Indicates that restitution parameter is enabled
GRAVITY_MULTIPLIER Indicates that gravity_multiplier parameter is enabled

Caveats

  • A collision between two objects with restitution 1.0 will still not be perfectly elastic due to damping in the physics engine.
All Issues ~ Search JIRA for related Bugs

Deep Notes

History

Search JIRA for related Issues

Footnotes

  1. ^ The ranges in this article are written in Interval Notation.

Signature

//integer PRIM_PHYSICS_MATERIAL = 31;
integer DENSITY;//range 1.0 to 22587.0 (in kg/m^3)
integer FRICTION;//range 0.0 to 255.0
integer RESTITUTION;//range 0.0 to 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)
integer GRAVITY_MULTIPLIER;//range -1.0 to +28.0