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
afrisby
Sean Dague 2007-09-13 13:06:54 +00:00
parent afea5f2205
commit af6c9d355d
2 changed files with 19 additions and 5 deletions

View File

@ -22,11 +22,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
private System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); private System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
private ScriptEngine m_ScriptEngine; private ScriptEngine m_ScriptEngine;
private IScriptHost m_host; private SceneObjectPart m_host;
private uint m_localID; private uint m_localID;
private LLUUID m_itemID; 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_ScriptEngine = ScriptEngine;
m_host = host; 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 LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset) { return new LSL_Types.Vector3(); }
public void llSetStatus(int status, int value) { return; } public void llSetStatus(int status, int value) { return; }
public int llGetStatus(int status) { return 0; } 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 void llSetColor(LSL_Types.Vector3 color, int face) { return; }
public double llGetAlpha(int face) { return 0; } public double llGetAlpha(int face) { return 0; }
public void llSetAlpha(double alpha, int face) { return; } public void llSetAlpha(double alpha, int face) { return; }

View File

@ -257,7 +257,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// It will be up to the script itself to hook up the correct events. // It will be up to the script itself to hook up the correct events.
string FileName = ""; string FileName = "";
IScriptHost m_host = World.GetSceneObjectPart(localID); SceneObjectPart m_host = World.GetSceneObjectPart(localID);
try try
{ {