diff options
author | Adam Frisby | 2009-05-31 12:53:05 +0000 |
---|---|---|
committer | Adam Frisby | 2009-05-31 12:53:05 +0000 |
commit | dc151903650525c20fe26b2b17924a990e2d1a0a (patch) | |
tree | f3f678d7ec681aeeb456659f88b3302c6addeb8f /OpenSim/Region/OptionalModules/Scripting | |
parent | Fix IRCd init check for config section (diff) | |
download | opensim-SC_OLD-dc151903650525c20fe26b2b17924a990e2d1a0a.zip opensim-SC_OLD-dc151903650525c20fe26b2b17924a990e2d1a0a.tar.gz opensim-SC_OLD-dc151903650525c20fe26b2b17924a990e2d1a0a.tar.bz2 opensim-SC_OLD-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.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObjectAccessor.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs | 20 |
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; | |||
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | ||
32 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
33 | using IEnumerable=System.Collections.IEnumerable; | 34 | using 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); |