Difference between revisions of "LlVolumeDetect"
Jump to navigation
Jump to search
Simon Linden (talk | contribs) m (Clarified that collision events are not triggered with volume detect) |
|||
Line 27: | Line 27: | ||
*[[collision]] events are not triggered | *[[collision]] events are not triggered | ||
======Phantom====== | ======Phantom====== | ||
*When physical they collide with the ground but will not pass through (normal physical object behavior), land collision events are queued. | *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> | </div> | ||
|caveats= | |caveats= | ||
*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 | ===Attachments=== | ||
'''Note:''' Attachments are not included in the avatar's bounding box. Nothing 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 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=<lsl>default |
Revision as of 21:06, 14 October 2013
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llVolumeDetect( integer detect );0.0 | Forced Delay |
10.0 | Energy |
If detect is TRUE, VolumeDetect is enabled, physical object and avatars can pass through the object.
• integer | detect | – | TRUE enables, FALSE 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
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
- llDetectedLinkNumber will return 0 in collision_start and collision_end events of VolumeDetect objects (SVC-2996).
- It can only be applied to the root prim (which will make the entire object VolumeDetect).
- It only detects physical objects and avatars.
- When moving via llSetPos() by a loop of stages, collision events will not trigger.
Attachments
Note: Attachments are not included in the avatar's bounding box. Nothing can collide with an attachment[1].
- It is meaningless to enabled on attachments.
- 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.
Examples
<lsl>default {
state_entry() { llVolumeDetect(TRUE); // Starts llVolumeDetect } collision_start(integer total_number) { llSay(0, "Detected!"); // Tells you when something penetrates the prim }}</lsl>