From af6c9d355da94c1547a3ea0b50e85dd21120b8f4 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 13 Sep 2007 13:06:54 +0000 Subject: implement llGetScale and llSetScale drop IScriptHost for now and just use SceneObjectPart, given how many of SceneObjectPart's properties we need for the script engine --- .../Compiler/Server_API/LSL_BuiltIn_Commands.cs | 22 ++++++++++++++++++---- .../ScriptEngine/DotNetEngine/ScriptManager.cs | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'OpenSim') 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 c98da48..9b533f9 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 @@ -22,11 +22,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler private System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); private ScriptEngine m_ScriptEngine; - private IScriptHost m_host; + private SceneObjectPart m_host; private uint m_localID; private LLUUID m_itemID; - public LSL_BuiltIn_Commands(ScriptEngine ScriptEngine, IScriptHost host, uint localID, LLUUID itemID) + public LSL_BuiltIn_Commands(ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) { m_ScriptEngine = ScriptEngine; m_host = host; @@ -208,8 +208,22 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler public LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset) { return new LSL_Types.Vector3(); } public void llSetStatus(int status, int value) { return; } public int llGetStatus(int status) { return 0; } - public void llSetScale(LSL_Types.Vector3 scale) { return; } - public LSL_Types.Vector3 llGetScale() { return new LSL_Types.Vector3(); } + + public void llSetScale(LSL_Types.Vector3 scale) + { + // TODO: this needs to trigger a persistance save as well + LLVector3 tmp = m_host.Scale; + tmp.X = (float)scale.X; + tmp.Y = (float)scale.Y; + tmp.Z = (float)scale.Z; + m_host.Scale = tmp; + return; + } + public LSL_Types.Vector3 llGetScale() + { + return new LSL_Types.Vector3(m_host.Scale.X, m_host.Scale.Y, m_host.Scale.Z); + } + public void llSetColor(LSL_Types.Vector3 color, int face) { return; } public double llGetAlpha(int face) { return 0; } public void llSetAlpha(double alpha, int face) { return; } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index ec50b93..f731cb4 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs @@ -257,7 +257,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine // It will be up to the script itself to hook up the correct events. string FileName = ""; - IScriptHost m_host = World.GetSceneObjectPart(localID); + SceneObjectPart m_host = World.GetSceneObjectPart(localID); try { -- cgit v1.1