From 7ae9ec217d6e1ec039fbd6ed16c952d56cc63dc6 Mon Sep 17 00:00:00 2001 From: idb Date: Fri, 5 Dec 2008 16:48:47 +0000 Subject: Implementation of the llDetectedTouch* functions --- .../Shared/Api/Implementation/LSL_Api.cs | 54 +++++++++++++++++----- 1 file changed, 42 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7a7c8d6..f98a9bb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -889,46 +889,76 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return new LSL_Integer(parms.LinkNum); } + /// + /// See http://wiki.secondlife.com/wiki/LlDetectedTouchBinormal for details + /// public LSL_Vector llDetectedTouchBinormal(int index) { m_host.AddScriptLPS(1); - NotImplemented("llDetectedTouchBinormal"); - return new LSL_Vector(); + DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, index); + if (detectedParams == null || detectedParams.TouchBinormal == null) + return new LSL_Vector(); + return detectedParams.TouchBinormal; } + /// + /// See http://wiki.secondlife.com/wiki/LlDetectedTouchFace for details + /// public LSL_Integer llDetectedTouchFace(int index) { m_host.AddScriptLPS(1); - NotImplemented("llDetectedTouchFace"); - return new LSL_Integer(0); + DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, index); + if (detectedParams == null || detectedParams.TouchFace == null) + return new LSL_Integer(-1); + return new LSL_Integer(detectedParams.TouchFace); } + /// + /// See http://wiki.secondlife.com/wiki/LlDetectedTouchNormal for details + /// public LSL_Vector llDetectedTouchNormal(int index) { m_host.AddScriptLPS(1); - NotImplemented("llDetectedTouchNormal"); - return new LSL_Vector(); + DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, index); + if (detectedParams == null || detectedParams.TouchNormal == null) + return new LSL_Vector(); + return detectedParams.TouchNormal; } + /// + /// See http://wiki.secondlife.com/wiki/LlDetectedTouchPos for details + /// public LSL_Vector llDetectedTouchPos(int index) { m_host.AddScriptLPS(1); - NotImplemented("llDetectedTouchPos"); - return new LSL_Vector(); + DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, index); + if (detectedParams == null || detectedParams.TouchPos == null) + return new LSL_Vector(); + return detectedParams.TouchPos; } + /// + /// See http://wiki.secondlife.com/wiki/LlDetectedTouchST for details + /// public LSL_Vector llDetectedTouchST(int index) { m_host.AddScriptLPS(1); - NotImplemented("llDetectedTouchST"); - return new LSL_Vector(); + DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, index); + if (detectedParams == null || detectedParams.TouchST == null) + return new LSL_Vector(-1.0, -1.0, 0.0); + return detectedParams.TouchST; } + /// + /// See http://wiki.secondlife.com/wiki/LlDetectedTouchUV for details + /// public LSL_Vector llDetectedTouchUV(int index) { m_host.AddScriptLPS(1); - NotImplemented("llDetectedTouchUV"); - return new LSL_Vector(); + DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, index); + if (detectedParams == null || detectedParams.TouchUV == null) + return new LSL_Vector(-1.0, -1.0, 0.0); + return detectedParams.TouchUV; } public void llDie() -- cgit v1.1