aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2009-04-09 10:07:40 +0000
committerAdam Frisby2009-04-09 10:07:40 +0000
commit1b56fff7c8ca3a3e14e576ecb0137d9d34997205 (patch)
tree760ceb7dc7918c287293fb7db2b7df12e6085fd9
parent* Thank you, mpallari for a patch that updates NHibernate inventory base mapp... (diff)
downloadopensim-SC_OLD-1b56fff7c8ca3a3e14e576ecb0137d9d34997205.zip
opensim-SC_OLD-1b56fff7c8ca3a3e14e576ecb0137d9d34997205.tar.gz
opensim-SC_OLD-1b56fff7c8ca3a3e14e576ecb0137d9d34997205.tar.bz2
opensim-SC_OLD-1b56fff7c8ca3a3e14e576ecb0137d9d34997205.tar.xz
* 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.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs3
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs5
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/Test/TestModule.cs13
3 files changed, 16 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index d6aca31..c2f9fd2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -860,6 +860,9 @@ namespace OpenSim.Region.Framework.Scenes
860 /// <returns>null if no scene object group containing that prim is found</returns> 860 /// <returns>null if no scene object group containing that prim is found</returns>
861 private SceneObjectGroup GetGroupByPrim(uint localID) 861 private SceneObjectGroup GetGroupByPrim(uint localID)
862 { 862 {
863 if (Entities.ContainsKey(localID))
864 return Entities[localID] as SceneObjectGroup;
865
863 //m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID); 866 //m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID);
864 List<EntityBase> EntityList = GetEntities(); 867 List<EntityBase> EntityList = GetEntities();
865 foreach (EntityBase ent in EntityList) 868 foreach (EntityBase ent in EntityList)
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
index 4734fa9..75ec33a 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
@@ -53,10 +53,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
53 /// <returns></returns> 53 /// <returns></returns>
54 private SceneObjectPart GetSOP() 54 private SceneObjectPart GetSOP()
55 { 55 {
56 if (m_rootScene.Entities.ContainsKey(m_localID)) 56 return m_rootScene.GetSceneObjectPart(m_localID);
57 return ((SceneObjectGroup) m_rootScene.Entities[m_localID]).RootPart;
58
59 return null;
60 } 57 }
61 58
62 #region OnTouch 59 #region OnTouch
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Test/TestModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Test/TestModule.cs
index e56d5eb..702ac74 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Test/TestModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Test/TestModule.cs
@@ -33,7 +33,18 @@ namespace OpenSim
33 { 33 {
34 public override void Start() 34 public override void Start()
35 { 35 {
36 Host.Console.Info("Hello World!"); 36 // Say Hello
37 Host.Object.Say("Hello, Avatar!");
38
39 // Register ourselves to listen
40 // for touch events.
41 Host.Object.OnTouch += OnTouched;
42 }
43
44 // This is our touch event handler
45 void OnTouched(IObject sender, TouchEventArgs e)
46 {
47 Host.Object.Say("Touched.");
37 } 48 }
38 49
39 public override void Stop() 50 public override void Stop()