Difference between revisions of "LlVolumeDetect"

From Second Life Wiki
Jump to navigation Jump to search
(volumedetect can detect non-physics/avatar objects, if the object itself is physical)
(this must have changed: moving an object in a setpos loop *will* trigger collision_start/end events against both avs and physical objects)
 
Line 32: Line 32:
*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).
*If the volume detecting object is ''not'' physical, it can only detect physical objects and avatars. If the object ''is'' physical, it can detect its collisions with static and [[llSetKeyframedMotion|keyframed motion]] objects as well.
*If the volume detecting object is ''not'' physical, it can only detect physical objects and avatars. If the object ''is'' physical, it can detect its collisions with static and [[llSetKeyframedMotion|keyframed motion]] objects as well.
*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. {{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.}}.  
'''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.}}.  

Latest revision as of 03:24, 11 October 2024

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 (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.

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

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 );