llDetectedTouchPos
function
Function syntax
vector llDetectedTouchPos(integer index// Index of the detection information.
);- Returns
vector- Energy
- 10
For the touch category of events only. The prim that was touched may not be the prim receiving the event, use llDetectedLinkNumber to check for this; likewise you can use llDetectedTouchFace to determine which face was touched.
vector result = llDetectedTouchPos(0);Caveats
Section titled “Caveats”TOUCH_INVALID_VECTORis returned when…- The avatar’s viewer does not support face touch detection.
- To check if face touch detection is supported check the return of
llDetectedTouchFace. - The touch has moved off the surface of the prim.
- The event triggered is not a touch event.
Examples
Section titled “Examples”Example 1
default{ touch_start(integer num_detected) { llWhisper(0, "Pos clicked: " + (string)llDetectedTouchPos(0)); }}Example 2
vector GetRealTouchPos(vector pos){// By Ariu Arai for free use to anyone// Returns a useful HUD Position Vector from the llDetectedTouchPos(); function// USE: vector pos = GetRealTouchPos(llDetectedTouchPos(0)); .. Etc.// This function is intended to be used to move child prims to where the user clicks. This does not work on the root prim.
13 collapsed lines
integer point = llGetAttached(); vector offset;
if (point == ATTACH_HUD_TOP_RIGHT) offset = <1.0, 0.933,-0.5>; else if (point == ATTACH_HUD_TOP_CENTER) offset = <1.0, 0.000,-0.5>; else if (point == ATTACH_HUD_TOP_LEFT) offset = <1.0,-0.933,-0.5>; else if (point == ATTACH_HUD_BOTTOM_LEFT) offset = <1.0,-0.933, 0.5>; else if (point == ATTACH_HUD_BOTTOM) offset = <1.0, 0.000, 0.5>; else if (point == ATTACH_HUD_BOTTOM_RIGHT) offset = <1.0, 0.933, 0.5>;
//return (pos - llGetLocalPos()) + (offset * llGetLocalRot()); return ((offset - llGetLocalPos()) + pos) / llGetLocalRot();}History
Section titled “History”- Introduced in Viewer SVN:870 r92872 Branch:Release Wednesday, 23 July 2008.
- Server support available in Second Life Server 1.24.7.98039, client support in Release Candidate viewer 1.21.4 (98167).
- Date of Release Server 29-08-2008
- Date of Release Client 16-10-2008
Shared wiki templates
Section titled “Shared wiki templates”The wiki article also includes shared templates whose conditional content is not reproduced here: Template:Issues/SVC-3425.
See also
Section titled “See also”Functions
Section titled “Functions”llDetectedLinkNumberllDetectedTouchFacellDetectedTouchSTllDetectedTouchUVllDetectedTouchNormalllDetectedTouchBinormal
Events
Section titled “Events”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.