| 22 |
private RexScriptEngine myScriptEngine; |
private RexScriptEngine myScriptEngine; |
| 23 |
private static readonly ILog m_log = |
private static readonly ILog m_log = |
| 24 |
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
| 25 |
|
private ModrexObjects m_rexObjects; |
| 26 |
|
|
| 27 |
public RexScriptInterface(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID, RexScriptEngine vScriptEngine) |
public RexScriptInterface(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID, RexScriptEngine vScriptEngine) |
| 28 |
{ |
{ |
| 57 |
{ |
{ |
| 58 |
m_log.Error("[REXSCRIPT]: Initializting rex scriptengine failed: " + e.ToString()); |
m_log.Error("[REXSCRIPT]: Initializting rex scriptengine failed: " + e.ToString()); |
| 59 |
} |
} |
| 60 |
|
|
| 61 |
|
OpenSim.Region.Environment.Interfaces.IRegionModule module = myScriptEngine.World.Modules["RexObjectsModule"]; |
| 62 |
|
if (module != null && module is ModrexObjects) |
| 63 |
|
{ |
| 64 |
|
m_rexObjects = (ModrexObjects)module; |
| 65 |
|
} |
| 66 |
} |
} |
| 67 |
|
|
| 68 |
private EntityBase GetEntityBase(uint vId) |
private EntityBase GetEntityBase(uint vId) |
| 301 |
|
|
| 302 |
|
|
| 303 |
|
|
| 304 |
public string SpawnActor(LSL_Types.Vector3 vLoc, int vShape, bool vbTemporary, string vPyClass) |
public string SpawnActor(LSL_Types.Vector3 location, int shape, bool temporary, string pythonClass) |
| 305 |
{ |
{ |
| 306 |
throw new NotImplementedException("Could not spawn actor to scene"); |
//throw new NotImplementedException("Could not spawn actor to scene"); |
| 307 |
//UUID TempID = myScriptEngine.World.RegionInfo.MasterAvatarAssignedUUID; |
UUID TempID = myScriptEngine.World.RegionInfo.MasterAvatarAssignedUUID; |
| 308 |
//Vector3 pos = new Vector3((float)vLoc.x, (float)vLoc.y, (float)vLoc.z); |
Vector3 pos = new Vector3((float)location.x, (float)location.y, (float)location.z); |
| 309 |
//Quaternion rot = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f); |
Quaternion rot = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f); |
| 310 |
|
|
| 311 |
|
SceneObjectGroup sog = myScriptEngine.World.AddNewPrim(TempID, TempID, pos, rot, GetShape(shape)); |
| 312 |
|
uint AddResult = sog.RootPart.LocalId; |
| 313 |
|
|
| 314 |
|
ModularRex.RexFramework.RexObjectProperties rop = m_rexObjects.Load(sog.RootPart.UUID); |
| 315 |
|
rop.RexClassName = pythonClass; |
| 316 |
|
m_rexObjects.Save(rop); |
| 317 |
|
|
| 318 |
|
//TODO: vbTemporary |
| 319 |
//uint AddResult = myScriptEngine.World.AddNewPrimReturningId(TempID, pos, rot, GetShape(vShape),vbTemporary,vPyClass); |
//uint AddResult = myScriptEngine.World.AddNewPrimReturningId(TempID, pos, rot, GetShape(vShape),vbTemporary,vPyClass); |
| 320 |
//return AddResult.ToString(); |
return AddResult.ToString(); |
| 321 |
} |
} |
| 322 |
|
|
| 323 |
public bool DestroyActor(string vId) |
public bool DestroyActor(string vId) |