From 23b8e39c1b8ede8b1f685adc7db2547c3b4dbc03 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 13 Sep 2007 14:19:57 +0000 Subject: llSetPos(), llGetPos(), llGetLocalPos() now implemented --- .../Compiler/Server_API/LSL_BuiltIn_Commands.cs | 43 ++++++++++++++++++++-- 1 file changed, 39 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index 9b533f9..10b5181 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs @@ -238,15 +238,50 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler return ""; } - public void llSetPos(LSL_Types.Vector3 pos) { return; } + public void llSetPos(LSL_Types.Vector3 pos) + { + LLVector3 tmp; + if (m_host.ParentID != 0) + { + tmp = m_host.OffsetPosition; + } + else + { + tmp = m_host.GroupPosition; + } + tmp.X = (float)pos.X; + tmp.Y = (float)pos.Y; + tmp.Z = (float)pos.Z; + if (m_host.ParentID != 0) + { + m_host.OffsetPosition = tmp; + } + else + { + m_host.GroupPosition = tmp; + } + return; + } public LSL_Types.Vector3 llGetPos() { - throw new NotImplementedException("llGetPos"); - // return m_host.AbsolutePosition; + return new LSL_Types.Vector3(m_host.AbsolutePosition.X, + m_host.AbsolutePosition.Y, + m_host.AbsolutePosition.Z); } - public LSL_Types.Vector3 llGetLocalPos() { return new LSL_Types.Vector3(); } + public LSL_Types.Vector3 llGetLocalPos() + { + if (m_host.ParentID != 0) { + return new LSL_Types.Vector3(m_host.OffsetPosition.X, + m_host.OffsetPosition.Y, + m_host.OffsetPosition.Z); + } else { + return new LSL_Types.Vector3(m_host.AbsolutePosition.X, + m_host.AbsolutePosition.Y, + m_host.AbsolutePosition.Z); + } + } public void llSetRot(LSL_Types.Quaternion rot) { } public LSL_Types.Quaternion llGetRot() { return new LSL_Types.Quaternion(); } public LSL_Types.Quaternion llGetLocalRot() { return new LSL_Types.Quaternion(); } -- cgit v1.1