Difference between revisions of "LlVolumeDetect"

From Second Life Wiki
Jump to navigation Jump to search
m (Replaced old <LSL> block with <source lang="lsl2">)
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Issues/SVC-2996}}{{LSL_Function/boolean|detect}}
{{LSL_Function
{{LSL_Function
|inject-2={{Issues/SVC-2490}}{{Issues/SVC-8141}}{{Issues/SVC-2996}}{{LSL_Function/boolean|detect|default=false}}
|func_id=248|func_sleep=0.0|func_energy=10.0
|func_id=248|func_sleep=0.0|func_energy=10.0
|func=llVolumeDetect|p1_type=integer|p1_name=detect
|func=llVolumeDetect|p1_type=integer|p1_subtype=boolean|p1_name=detect
|func_footnote
|func_footnote=This works much like Phantom, but unlike Phantom, VolumeDetect objects trigger [[collision_start]] and [[collision_end]] events when interpenetrating. Collision events will trigger in any script in the object.
|func_desc=If '''detect''' is [[TRUE]], VolumeDetect is enabled, physical object and avatars can pass through the object. This works much like Phantom, but unlike Phantom, VolumeDetect objects trigger [[collision_start]] and [[collision_end]] events when interpenetrating. Collision events will trigger
|func_desc=If {{LSLP|detect}} is [[TRUE]], VolumeDetect is enabled, physical object and avatars can pass through the object.
in any script in the object.
|return_text
|return_text
|spec=
|spec=
====Differences====
{{{!}} {{Prettytable|style=float:left;}}
There are a couple differences in how Phantom and VolumeDetect handle collisions.
{{!}}+ Events queued depending on type
 
{{{!}} {{Prettytable}}
{{!}}-  
{{!}}-  
{{!}}
!
! {{Hl2}} {{!}} {{LSLGC|Land Collision|Land Collisions}}
! {{Hl2}} {{!}} VolumeDetect
! {{Hl2}} {{!}} {{LSLGC|Collision Events|Object/Avatar Collisions}}
! {{Hl2}} {{!}} Phantom
{{!}}- align="center"
{{!}}- align="center"
! {{Hl2}} {{!}} Phantom
! {{Hl2}} {{!}} Events<br/>Supported
{{!!}} Supported
{{!!}} [[collision_start]]<br/><br/>[[collision_end]]
{{!!}} Not Supported
{{!!}} [[land_collision_start]]<br/>[[land_collision]]<br/>[[land_collision_end]]
{{!}}- align="center"
{{!}}- align="center"
! {{Hl2}} {{!}} VolumeDetect
{{!!}} Not Supported
{{!!}} Supported
{{!}}}
{{!}}}


=====VolumeDetect=====
====Differences====
There are a couple differences in how Phantom and VolumeDetect handle collisions; specifically which events are supported and how they handle the ground.
<div style="clear:left;">
======VolumeDetect======
*When physical they fall through the ground with the risk of going off-world.
*When physical they fall through the ground with the risk of going off-world.
=====Phantom=====
*[[collision]] events are not triggered
*When physical they collide with the ground but will not pass through (normal physical object behavior), land collision events are queued.
======Phantom======
*When physical they collide with the ground but will not pass through (normal physical object behavior), {{LSLGC|Land Collision|land collision}} events are queued.
</div>
|caveats=
|caveats=
*It cannot be enabled on attachments{{Footnote|Attachments aren't included in the avatar bounding box, so it's moot}}.
*It can only be applied to the root prim (which will make the entire object VolumeDetect).
*It can only be applied to the root prim (which will make the entire object VolumeDetect).
*It only detects physical objects and avatars.
*It only detects physical objects and avatars.
*When moving via [[llSetPos]]() by a loop of stages, {{LSLGC|Collision|collision events}} will not trigger.
*When moving via [[llSetPos]]() by a loop of stages, {{LSLGC|Collision|collision events}} will not trigger.
*Attachments will not register collision events when the avatar collides with a VolumeDetect object.
===Attachments===
'''Note:''' Attachments are not included in the avatar's bounding box. {{LSLGC|Collision|Collision events}} received by attachments are collisions the avatar is having with the world, not collisions the attachment is having. Nothing actually can collide with an attachment{{Footnote|Even if attachments were included in an avatars bounding box, you would not like the outcome, the avatars bounding box is not deformed by animations.}}.
*It is meaningless to enabled on attachments. Attachments cannot collide with anything.
*Attachments do not receive collision events for avatar collisions with VolumeDetect objects.
**Attachments do receive collision events for avatar collisions with non-VolumeDetect, non-phantom objects.
|constants
|constants
|examples=<lsl>default
|examples=<source lang="lsl2">default
{
{
     state_entry()
     state_entry()
Line 47: Line 49:
         llSay(0, "Detected!"); // Tells you when something penetrates the prim
         llSay(0, "Detected!"); // Tells you when something penetrates the prim
     }
     }
}</lsl>
}</source>
|helpers
|helpers
|also_functions=
|also_functions=

Revision as of 11:57, 22 January 2015

Summary

Function: llVolumeDetect( integer detect );

If detect is TRUE, VolumeDetect is enabled, physical object and avatars can pass through the object.

• integer detect TRUE enables, FALSE (default) disables

This works much like Phantom, but unlike Phantom, VolumeDetect objects trigger collision_start and collision_end events when interpenetrating. Collision events will trigger in any script in the object.

Specification

Events queued depending on type
VolumeDetect Phantom
Events
Supported
collision_start

collision_end
land_collision_start
land_collision
land_collision_end

Differences

There are a couple differences in how Phantom and VolumeDetect handle collisions; specifically which events are supported and how they handle the ground.

VolumeDetect
  • When physical they fall through the ground with the risk of going off-world.
  • collision events are not triggered
Phantom
  • When physical they collide with the ground but will not pass through (normal physical object behavior), land collision events are queued.

Caveats

Attachments

Note: Attachments are not included in the avatar's bounding box. Collision events received by attachments are collisions the avatar is having with the world, not collisions the attachment is having. Nothing actually can collide with an attachment[1].

  • It is meaningless to enabled on attachments. Attachments cannot collide with anything.
  • Attachments do not receive collision events for avatar collisions with VolumeDetect objects.
    • Attachments do receive collision events for avatar collisions with non-VolumeDetect, non-phantom objects.

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)
   Volume Detect objects are not always allowing objects to pass through.

Examples

default
{
    state_entry()
    {
        llVolumeDetect(TRUE); // Starts llVolumeDetect
    }
    collision_start(integer total_number)
    {
        llSay(0, "Detected!"); // Tells you when something penetrates the prim
    }
}

See Also

Events

•  collision_start
•  collision
•  collision_end

Functions

•  llPassCollisions

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)
   Volume Detect objects are not always allowing objects to pass through.
   llDetectedLinkNumber returns 0 with llVolumeDetect(TRUE)

Footnotes

  1. ^ Even if attachments were included in an avatars bounding box, you would not like the outcome, the avatars bounding box is not deformed by animations.

Signature

function void llVolumeDetect( integer detect );