Difference between revisions of "LlPassTouches"

From Second Life Wiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{LSL_Function
 
{{LSL_Function
 +
|inject-2={{Issues/SVC-3306}}{{LSL Function/Pass|pass|{{LSLGC|Touch|touch}}|Touches|default=PASS_ALWAYS|tf=*}}
 
|func_id=154|func_sleep=0.0|func_energy=10.0
 
|func_id=154|func_sleep=0.0|func_energy=10.0
|func=llPassTouches|p1_type=integer|p1_name=pass|p1_desc=boolean, if [[TRUE]], touches are passed from children on to parents
+
|func=llPassTouches|p1_type=integer|p1_subtype=pass|p1_name=pass
|func_footnote=The default is [[TRUE]] if there is no script to handle the touch events.
+
|func_footnote
|func_desc=Sets pass-touches [[prim]] attribute.
+
|func_desc=Sets the pass-touches [[prim]] attribute.
 
|return_text
 
|return_text
 
|spec
 
|spec
|caveats=This has no effect (whether set [[TRUE]] or [[FALSE]]) from the root. Touches are always passed to the parent when there is '''no touch event script in the child''', even if this is set ([[TRUE]] or [[FALSE]]) within another event in a child's script.  If you want to block touches from a child by using this function, you must add a script with a touch event in the child and set to [[FALSE]].
+
|caveats
 
|constants
 
|constants
 +
 
|helpers
 
|helpers
 
|also_events=
 
|also_events=
Line 19: Line 21:
 
|notes
 
|notes
 
|permission
 
|permission
|negative_index
+
|history=
 +
* Introduction: ?
 +
* Change: {{Jira|SVC-5923}} - Server version 1.40.2 - New {{LSLPT|pass}} value added: 2
 
|sort=PassTouches
 
|sort=PassTouches
 
|cat1=Touch
 
|cat1=Touch
 
|cat2=Prim
 
|cat2=Prim
 
|cat3=Detected
 
|cat3=Detected
|cat4
+
|cat4=Passable
 
}}
 
}}

Latest revision as of 12:07, 3 November 2017

Summary

Function: llPassTouches( integer pass );

Sets the pass-touches prim attribute.

• integer pass PASS_* flag

Whether Touches are passed to the root prim depends not only on which PASS_* flag is selected, but may also depend on if there is a script that in the prim that handles one of the touch events. For this reason most users will want to use PASS_ALWAYS or PASS_NEVER as they do not have this variable behavior.

The default value for this attribute is PASS_ALWAYS.

pass Constant Value touch Script No touch Script Description
PASS_IF_NOT_HANDLED 0 not passed passed Touches are passed if there is no script handling the event in the prim.
PASS_ALWAYS 1 passed passed Default: Touches are always passed to the root.
PASS_NEVER 2 not passed not passed Touches are never passed to the root.

Caveats

  • Has no known effect if called from within the root prim.
All Issues ~ Search JIRA for related Bugs

Examples

See Also

Events

•  touch_start
•  touch
•  touch_end

Functions

•  llPassCollisions

Deep Notes

TRUE & FALSE vs. PASS_* flags

Prior to Server Version 1.40.2, pass was couched in terms of being a boolean and the only meaningful values were 0 and 1. The best practice at that time was to use the integer constants TRUE and FALSE. The design of this function left much to be desired. The problem was that while TRUE always caused all Touches to be passed along to the the root, FALSE would only not pass Touches if there the prim had a script that handled a touch event. This meant to fully utilize this function the prim must contain a script that handled touch events! With the release of Server Version 1.40.2, the PASS_* flags were introduced and the subtype of the pass was changed. Specifically the introduction of PASS_NEVER solved this problem, allowing content creators to eliminate scripts that were only in the object to tweak the passing of touch events.

History

  • Introduction: ?
  • Change: SVC-5923 - Server version 1.40.2 - New pass value added: 2

All Issues

~ Search JIRA for related Issues
   Add enumeration to llPassCollisions() to provide PASS_ALWAYS, PASS_IF_NOT_HANDLED, and PASS_NEVER as explicit options.
(Was: Collisions passed to parent REGARDLESS llPassCollisions(FALSE) in child)

Signature

function void llPassTouches( integer pass );