Difference between revisions of "LlCollisionFilter"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
{{LSL_Function/uuid|id|object=*}}{{LSL_Function
{{LSL_Function
|inject-2={{LSL_Function/uuid|id|object=*|pd=filter by}}
{{LSL_Function/boolean|accept|pd=|ph=|td=only process collisions that match|fd=instead excludes matches}}
|func_id=110|func_sleep=0.0|func_energy=10.0
|func_id=110|func_sleep=0.0|func_energy=10.0
|sort=CollisionFilter
|sort=CollisionFilter
|func=llCollisionFilter
|func=llCollisionFilter
|p1_type=string|p1_name=name
|p1_type=string|p1_name=name|p1_desc=filter for specific prim name or avatar {{LSLGC|Avatar/Name|legacy name}}|p1_hover=filter for specific prim name or avatar legacy name
|p2_type=key|p2_name=id
|p2_type=key|p2_name=id
|p3_type=integer|p3_name=accept
|p3_type=integer|p3_name=accept
|func_footnote=if '''accept''' == {{LSLG|TRUE}}, only accept collisions with objects '''name''' AND '''id''' (either is optional), otherwise with objects not '''name''' AND '''id'''
|func_footnote=if '''accept''' == [[TRUE]], only accept collisions with objects '''name''' AND '''id''' (either is optional), otherwise with objects not '''name''' AND '''id'''
|func_desc=Sets the collision filter, exclusively or inclusively.
|func_desc=Sets the collision filter, exclusively or inclusively.
|return_text
|return_text

Revision as of 18:15, 7 December 2010

Summary

Function: llCollisionFilter( string name, key id, integer accept );

Sets the collision filter, exclusively or inclusively.

• string name filter for specific prim name or avatar legacy name
• key id filter by group, avatar or object UUID
• integer accept TRUE only process collisions that match, FALSE instead excludes matches

if accept == TRUE, only accept collisions with objects name AND id (either is optional), otherwise with objects not name AND id

Examples

Stop filtering: <lsl>llCollisionFilter("", NULL_KEY, TRUE);</lsl> Filter out all collisions: <lsl>llCollisionFilter("", NULL_KEY, FALSE);</lsl> This script, placed in a wearable object, detects a collision when the person wearing it collides with an object named "Post": <lsl>default {

   state_entry()
   {
       llCollisionFilter("Post","",TRUE);
   }
   collision_start(integer total_number)
   {
       llSay(0, "OUCH!");
   }
}</lsl>

See Also

Events

•  collision_start
•  collision
•  collision_end

Functions

•  llPassCollisions
•  llVolumeDetect

Deep Notes

Search JIRA for related Issues

Signature

function void llCollisionFilter( string name, key id, integer accept );