aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-09-13 17:56:02 +0100
committerJustin Clark-Casey (justincc)2011-09-13 17:56:02 +0100
commit07ba28f1dece06309cfbf7f487b7a779e49033bb (patch)
treecf3fe29e3f0929d012583139a32a79cb5d66bd8b /OpenSim
parentAdd new TestGetSceneObjectByPartLocalId() for retrieving a scene object via t... (diff)
downloadopensim-SC_OLD-07ba28f1dece06309cfbf7f487b7a779e49033bb.zip
opensim-SC_OLD-07ba28f1dece06309cfbf7f487b7a779e49033bb.tar.gz
opensim-SC_OLD-07ba28f1dece06309cfbf7f487b7a779e49033bb.tar.bz2
opensim-SC_OLD-07ba28f1dece06309cfbf7f487b7a779e49033bb.tar.xz
In SG.AddSceneObject(), stop unnecessarily adding the root part to object indexes sepearately from the other parts.
The SOG.Parts property contains the root part as well as the non-root parts
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs12
1 files changed, 5 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 40dc2f8..4d7bc0c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -369,12 +369,12 @@ namespace OpenSim.Region.Framework.Scenes
369// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}", 369// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
370// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName); 370// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName);
371 371
372 SceneObjectPart[] children = sceneObject.Parts; 372 SceneObjectPart[] parts = sceneObject.Parts;
373 373
374 // Clamp child prim sizes and add child prims to the m_numPrim count 374 // Clamp child prim sizes and add child prims to the m_numPrim count
375 if (m_parentScene.m_clampPrimSize) 375 if (m_parentScene.m_clampPrimSize)
376 { 376 {
377 foreach (SceneObjectPart part in children) 377 foreach (SceneObjectPart part in parts)
378 { 378 {
379 Vector3 scale = part.Shape.Scale; 379 Vector3 scale = part.Shape.Scale;
380 380
@@ -388,7 +388,7 @@ namespace OpenSim.Region.Framework.Scenes
388 part.Shape.Scale = scale; 388 part.Shape.Scale = scale;
389 } 389 }
390 } 390 }
391 m_numPrim += children.Length; 391 m_numPrim += parts.Length;
392 392
393 sceneObject.AttachToScene(m_parentScene); 393 sceneObject.AttachToScene(m_parentScene);
394 394
@@ -408,8 +408,7 @@ namespace OpenSim.Region.Framework.Scenes
408 408
409 lock (SceneObjectGroupsByFullPartID) 409 lock (SceneObjectGroupsByFullPartID)
410 { 410 {
411 SceneObjectGroupsByFullPartID[sceneObject.UUID] = sceneObject; 411 foreach (SceneObjectPart part in parts)
412 foreach (SceneObjectPart part in children)
413 SceneObjectGroupsByFullPartID[part.UUID] = sceneObject; 412 SceneObjectGroupsByFullPartID[part.UUID] = sceneObject;
414 } 413 }
415 414
@@ -419,8 +418,7 @@ namespace OpenSim.Region.Framework.Scenes
419// "[SCENE GRAPH]: Adding scene object {0} {1} {2} to SceneObjectGroupsByLocalPartID in {3}", 418// "[SCENE GRAPH]: Adding scene object {0} {1} {2} to SceneObjectGroupsByLocalPartID in {3}",
420// sceneObject.Name, sceneObject.UUID, sceneObject.LocalId, m_parentScene.RegionInfo.RegionName); 419// sceneObject.Name, sceneObject.UUID, sceneObject.LocalId, m_parentScene.RegionInfo.RegionName);
421 420
422 SceneObjectGroupsByLocalPartID[sceneObject.LocalId] = sceneObject; 421 foreach (SceneObjectPart part in parts)
423 foreach (SceneObjectPart part in children)
424 SceneObjectGroupsByLocalPartID[part.LocalId] = sceneObject; 422 SceneObjectGroupsByLocalPartID[part.LocalId] = sceneObject;
425 } 423 }
426 424