* 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.
parent
07a94fdf89
commit
dc15190365
|
@ -35,5 +35,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
IObject this[int index] { get; }
|
IObject this[int index] { get; }
|
||||||
IObject this[uint index] { get; }
|
IObject this[uint index] { get; }
|
||||||
IObject this[UUID index] { get; }
|
IObject this[UUID index] { get; }
|
||||||
|
IObject Create(Vector3 position);
|
||||||
|
IObject Create(Vector3 position, Quaternion rotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -29,6 +29,7 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
using OpenSim.Framework;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
using IEnumerable=System.Collections.IEnumerable;
|
using IEnumerable=System.Collections.IEnumerable;
|
||||||
|
|
||||||
|
@ -108,6 +109,25 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IObject Create(Vector3 position)
|
||||||
|
{
|
||||||
|
return Create(position, Quaternion.Identity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IObject Create(Vector3 position, Quaternion rotation)
|
||||||
|
{
|
||||||
|
|
||||||
|
SceneObjectGroup sog = m_scene.AddNewPrim(m_scene.RegionInfo.MasterAvatarAssignedUUID,
|
||||||
|
UUID.Zero,
|
||||||
|
position,
|
||||||
|
rotation,
|
||||||
|
PrimitiveBaseShape.CreateBox());
|
||||||
|
|
||||||
|
IObject ret = new SOPObject(m_scene, sog.LocalId);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public IEnumerator<IObject> GetEnumerator()
|
public IEnumerator<IObject> GetEnumerator()
|
||||||
{
|
{
|
||||||
return new IObjEnum(m_scene);
|
return new IObjEnum(m_scene);
|
||||||
|
|
Loading…
Reference in New Issue