* Implements retrieving child primitives via World.Objects[id] (MRM)

* Optimizes SceneGraph - fetches on primitives via "GetGroupByPrim" wont search the entire list if the primitive is infact the root. (Core)
* Updates Test MRM.
0.6.5-rc1
Adam Frisby 2009-04-09 10:07:40 +00:00
parent 73ab6bd455
commit 1b56fff7c8
3 changed files with 16 additions and 5 deletions

View File

@ -860,6 +860,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>null if no scene object group containing that prim is found</returns> /// <returns>null if no scene object group containing that prim is found</returns>
private SceneObjectGroup GetGroupByPrim(uint localID) private SceneObjectGroup GetGroupByPrim(uint localID)
{ {
if (Entities.ContainsKey(localID))
return Entities[localID] as SceneObjectGroup;
//m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID); //m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID);
List<EntityBase> EntityList = GetEntities(); List<EntityBase> EntityList = GetEntities();
foreach (EntityBase ent in EntityList) foreach (EntityBase ent in EntityList)

View File

@ -53,10 +53,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
/// <returns></returns> /// <returns></returns>
private SceneObjectPart GetSOP() private SceneObjectPart GetSOP()
{ {
if (m_rootScene.Entities.ContainsKey(m_localID)) return m_rootScene.GetSceneObjectPart(m_localID);
return ((SceneObjectGroup) m_rootScene.Entities[m_localID]).RootPart;
return null;
} }
#region OnTouch #region OnTouch

View File

@ -33,7 +33,18 @@ namespace OpenSim
{ {
public override void Start() public override void Start()
{ {
Host.Console.Info("Hello World!"); // Say Hello
Host.Object.Say("Hello, Avatar!");
// Register ourselves to listen
// for touch events.
Host.Object.OnTouch += OnTouched;
}
// This is our touch event handler
void OnTouched(IObject sender, TouchEventArgs e)
{
Host.Object.Say("Touched.");
} }
public override void Stop() public override void Stop()