LSL Wiki Mirror 10-5-2006: llVolumeDetect

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
llVolumeDetect(integer detect)

When detect = TRUE, this makes the entire link set the script is attached to phantom. But, if another object interpenetrates it, it will get a collision_start event. When an object stops interpenetrating, a collision_end event is generated. While the other is interpenetrating, collision events are NOT generated. The script must be applied to the root object of the link set to get the collision events. Collision filters work normally (see llCollisionFilter).

The object can NOT be set to phantom by any other means, or else llVolumeDetect will not work. llVolumeDetect will set phantom automatically.

Example:
llVolumeDetect(TRUE); // turns llVolumeDetect on.

A script that uses llVolumeDetect will say "Attachments cannot use llVolumeDetect." if the object containing the script is attached at the time llVolumeDetect is called. If llVolumeDetect is used in an attachment, the collision events will still be triggered.

When enabled llVolumeDetect will remain in effect as long as there is a script on the object. It will be automatically removed when the last script is deleted, however the phantom state will persist.

Note:
As of SL 1.6.7, llVolumeDetect should not be used on physical objects! Doing so will cause the object to fall through the ground and go off-world. Presumably, this is because llVolumeDetect does not use the same mechanism as a regular phantom object and that the Lindens goofed up. The Lindens have been notified of this issue, but it has not yet been fixed. If you need the object to be physical, you can use llSetBuoyancy(1.0) to fix the falling problem. I see this as a feature not a bug.

Note:
As of SL 1.6.7, llDetectedLinkNumber will only ever return 0 when used with llVolumeDetect, even when used in a multi-prim object. This may be caused by the fact that llVolumeDetect was added some time after the original detected functions. There is not yet any word on when this might be fixed.

Note:
land_collision_start, land_collision_end and land_collision events aren't generated anymore after setting llVolumeDetect to TRUE.



Functions | Detected | Collisions | Phantom
There are 5 comments on this page. [Display comments/form]