aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2009-05-31 12:53:05 +0000
committerAdam Frisby2009-05-31 12:53:05 +0000
commitdc151903650525c20fe26b2b17924a990e2d1a0a (patch)
treef3f678d7ec681aeeb456659f88b3302c6addeb8f
parentFix IRCd init check for config section (diff)
downloadopensim-SC-dc151903650525c20fe26b2b17924a990e2d1a0a.zip
opensim-SC-dc151903650525c20fe26b2b17924a990e2d1a0a.tar.gz
opensim-SC-dc151903650525c20fe26b2b17924a990e2d1a0a.tar.bz2
opensim-SC-dc151903650525c20fe26b2b17924a990e2d1a0a.tar.xz
* Adds MRM scripting commands, World.Objects.Create(Vector3 position) and World.Objects.Create(Vector3 position, Quaternion rotation). These rez a 'default box' object at the specified coordinates, and return the associated IObject.
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObjectAccessor.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs20
2 files changed, 22 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObjectAccessor.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObjectAccessor.cs
index 7aed41b..a6c8c36 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObjectAccessor.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObjectAccessor.cs
@@ -35,5 +35,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
35 IObject this[int index] { get; } 35 IObject this[int index] { get; }
36 IObject this[uint index] { get; } 36 IObject this[uint index] { get; }
37 IObject this[UUID index] { get; } 37 IObject this[UUID index] { get; }
38 IObject Create(Vector3 position);
39 IObject Create(Vector3 position, Quaternion rotation);
38 } 40 }
39} \ No newline at end of file 41} \ No newline at end of file
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs
index a64a1c2..4638ad0 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using OpenMetaverse; 31using OpenMetaverse;
32using OpenSim.Framework;
32using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
33using IEnumerable=System.Collections.IEnumerable; 34using IEnumerable=System.Collections.IEnumerable;
34 35
@@ -108,6 +109,25 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
108 } 109 }
109 } 110 }
110 111
112 public IObject Create(Vector3 position)
113 {
114 return Create(position, Quaternion.Identity);
115 }
116
117 public IObject Create(Vector3 position, Quaternion rotation)
118 {
119
120 SceneObjectGroup sog = m_scene.AddNewPrim(m_scene.RegionInfo.MasterAvatarAssignedUUID,
121 UUID.Zero,
122 position,
123 rotation,
124 PrimitiveBaseShape.CreateBox());
125
126 IObject ret = new SOPObject(m_scene, sog.LocalId);
127
128 return ret;
129 }
130
111 public IEnumerator<IObject> GetEnumerator() 131 public IEnumerator<IObject> GetEnumerator()
112 { 132 {
113 return new IObjEnum(m_scene); 133 return new IObjEnum(m_scene);