llDetectedTouchNormal
function
Function syntax
vector llDetectedTouchNormal(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.To find the third tangent vector, cross the binormal with this vector.
Returns a vector that is the surface normal (perpendicular to the surface) where the touch event was triggered. Along with llDetectedTouchBinormal, this information can be used to find the tangent space at the touch location.
vector result = llDetectedTouchNormal(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.
- The rotation of a legacy sphere prim does not influence touch normal like it does with other legacy prims.
Examples
Section titled “Examples”Example 1
default{ touch_start(integer total_num) { llOwnerSay((string)llDetectedTouchNormal(0)); //Says the vector where the touched face is pointing to. }}Helper functions
Section titled “Helper functions”touch_start(integer total_number){ // rotates the prim, so the touched position points upwards llSetRot(llGetRot()*llRotBetween(llDetectedTouchNormal(0),<0,0,1>));}History
Section titled “History”- Introduced in Viewer SVN:870 r92872 Branch:Release Wednesday, 23 July 2008, no server support, no viewer binary released.
- Server support available on preview grid in Second Life Beta Server 1.24, client support in Preview Grid viewer 1.20.15 (93532)
- Date of Release Server 29-08-2008
- Date of Release Client 16-10-2008
See also
Section titled “See also”Functions
Section titled “Functions”llDetectedLinkNumberllDetectedTouchFacellDetectedTouchSTllDetectedTouchUVllDetectedTouchPosllDetectedTouchBinormal
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.