From 94e58ff6b9368975925cea4697077a8e59162bc0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 9 Mar 2012 02:38:11 +0000 Subject: Use SP.ParentPart instead of ParentID in places where it's more efficient (saving extra null checks, etc.) However, it looks like we should retain SP.ParentID since it's much easier to use that in places where another thread could change ParentPart to null. Otherwise one has to clumsily put ParentPart in a reference, etc. to avoid a race. --- .../RegionCombinerModule/RegionCombinerModule.cs | 26 ++++++---------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/RegionCombinerModule') diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 09da97a..a2e3ac2 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -716,29 +716,17 @@ namespace OpenSim.Region.RegionCombinerModule { if (sp.UUID != presence.UUID) { - if (sp.ParentID != 0) - { - // sitting avatar - SceneObjectPart sop = connectiondata.RegionScene.GetSceneObjectPart(sp.ParentID); - if (sop != null) - { - CoarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition); - AvatarUUIDs.Add(sp.UUID); - } - else - { - // we can't find the parent.. ! arg! - CoarseLocations.Add(sp.AbsolutePosition); - AvatarUUIDs.Add(sp.UUID); - } - } + SceneObjectPart sitPart = sp.ParentPart; + + if (sitPart != null) + CoarseLocations.Add(sitPart.AbsolutePosition + sp.AbsolutePosition); else - { CoarseLocations.Add(sp.AbsolutePosition); - AvatarUUIDs.Add(sp.UUID); - } + + AvatarUUIDs.Add(sp.UUID); } }); + DistributeCourseLocationUpdates(CoarseLocations, AvatarUUIDs, connectiondata, presence); } -- cgit v1.1 From 06dda14505743bde237362b0e469d16548922f33 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 9 Mar 2012 02:50:57 +0000 Subject: Simplify minimap coarse location code by just reference SP.AbsolutePosition This is rather than checking whether the avatar is sitting and doing its own calculation. --- OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/RegionCombinerModule') diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index a2e3ac2..eb633b3 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -712,17 +712,12 @@ namespace OpenSim.Region.RegionCombinerModule List CoarseLocations = new List(); List AvatarUUIDs = new List(); + connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp) { if (sp.UUID != presence.UUID) { - SceneObjectPart sitPart = sp.ParentPart; - - if (sitPart != null) - CoarseLocations.Add(sitPart.AbsolutePosition + sp.AbsolutePosition); - else - CoarseLocations.Add(sp.AbsolutePosition); - + CoarseLocations.Add(sp.AbsolutePosition); AvatarUUIDs.Add(sp.UUID); } }); -- cgit v1.1 From bdc968f1fcd4008e9f2a6099a7d30edb075ca0f1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 9 Mar 2012 23:57:24 +0000 Subject: Factor out common default animations code into SLUtil. LLClientView now makes use of the SLUtil copy via a method rather than each LLClientView loading a separate copy. As per opensim-users mailing list discussion. --- OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/RegionCombinerModule') diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index eb633b3..a142f26 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -712,7 +712,7 @@ namespace OpenSim.Region.RegionCombinerModule List CoarseLocations = new List(); List AvatarUUIDs = new List(); - + connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp) { if (sp.UUID != presence.UUID) -- cgit v1.1