Difference between revisions of "LlCollisionFilter"

From Second Life Wiki
Jump to navigation Jump to search
(updated caveat with specifics, included workaround.)
m
Line 15: Line 15:
|spec
|spec
|caveats=
|caveats=
*Any call of llCollisionFilter in the same event as [[llVolumeDetect]] changing (not just being called, but actually moving from FALSE to TRUE or vice versa) will be disregarded (before or after). See [[#SVC-2490]]
*Any call of llCollisionFilter in the same event as [[llVolumeDetect]] changing (not just being called, but actually moving from [[FALSE]] to [[TRUE]] or vice versa) will be disregarded (before or after). See [[#SVC-2490]]
:You can get around this by calling them in separate events, such as [[touch_start]] and [[touch_end]].
:You can get around this by calling them in separate events, such as [[touch_start]] and [[touch_end]].
|constants
|constants

Revision as of 22:38, 6 January 2014

Summary

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

Sets the collision filter, exclusively or inclusively.

• string name filter for specific object 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
If name or id are blank they are not used to filter incoming messages (or you could say they match everything). If id is an invalid key or a null key, it is considered blank.

Caveats

  • Any call of llCollisionFilter in the same event as llVolumeDetect changing (not just being called, but actually moving from FALSE to TRUE or vice versa) will be disregarded (before or after). See #SVC-2490
You can get around this by calling them in separate events, such as touch_start and touch_end.

Important Issues

~ All Issues ~ Search JIRA for related Bugs
   llCollisionFilter completely ignored after call to user-defined function and then a call to llVolumeDetect(TRUE)

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":

  • 1st instance :

an object named "Post" has several child prims named "Object" . The prim named "Post" hits the scripted object or scripted prim , the collision will be detected

  • 2nd instance :

an object named "Post" has several child prims named "Object" . A child prim named "Object" hits the scripted object or scripted prim, the collision will be detected

  • 3rd instance :

an object named "Object" has several child prims named "Post" . A prim named "Post" hits the scripted object or scripted prim, the collision will not be detected

<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

All Issues

~ Search JIRA for related Issues
   llCollisionFilter completely ignored after call to user-defined function and then a call to llVolumeDetect(TRUE)

Signature

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