aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x[-rw-r--r--]OpenSim/Region/Framework/Scenes/SceneGraph.cs59
1 files changed, 55 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 51f50d9..c2e9b61 100644..100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -67,7 +67,9 @@ namespace OpenSim.Region.Framework.Scenes
67 protected Scene m_parentScene; 67 protected Scene m_parentScene;
68 protected Dictionary<UUID, SceneObjectGroup> m_updateList = new Dictionary<UUID, SceneObjectGroup>(); 68 protected Dictionary<UUID, SceneObjectGroup> m_updateList = new Dictionary<UUID, SceneObjectGroup>();
69 protected int m_numRootAgents = 0; 69 protected int m_numRootAgents = 0;
70 protected int m_numTotalPrim = 0;
70 protected int m_numPrim = 0; 71 protected int m_numPrim = 0;
72 protected int m_numMesh = 0;
71 protected int m_numChildAgents = 0; 73 protected int m_numChildAgents = 0;
72 protected int m_physicalPrim = 0; 74 protected int m_physicalPrim = 0;
73 75
@@ -368,7 +370,8 @@ namespace OpenSim.Region.Framework.Scenes
368 370
369 SceneObjectPart[] parts = sceneObject.Parts; 371 SceneObjectPart[] parts = sceneObject.Parts;
370 372
371 // Clamp child prim sizes and add child prims to the m_numPrim count 373 // Clamp the sizes (scales) of the child prims and add the child prims to the count of all primitives
374 // (meshes and geometric primitives) in the scene; add child prims to m_numTotalPrim count
372 if (m_parentScene.m_clampPrimSize) 375 if (m_parentScene.m_clampPrimSize)
373 { 376 {
374 foreach (SceneObjectPart part in parts) 377 foreach (SceneObjectPart part in parts)
@@ -382,7 +385,19 @@ namespace OpenSim.Region.Framework.Scenes
382 part.Shape.Scale = scale; 385 part.Shape.Scale = scale;
383 } 386 }
384 } 387 }
385 m_numPrim += parts.Length; 388 m_numTotalPrim += parts.Length;
389
390 // Go through all parts (geometric primitives and meshes) of this Scene Object
391 foreach (SceneObjectPart part in parts)
392 {
393 // Keep track of the total number of meshes or geometric primitives now in the scene;
394 // determine which object this is based on its primitive type: sculpted (sculpt) prim refers to
395 // a mesh and all other prims (i.e. box, sphere, etc) are geometric primitives
396 if (part.GetPrimType() == PrimType.SCULPT)
397 m_numMesh++;
398 else
399 m_numPrim++;
400 }
386 401
387 sceneObject.AttachToScene(m_parentScene); 402 sceneObject.AttachToScene(m_parentScene);
388 403
@@ -437,7 +452,21 @@ namespace OpenSim.Region.Framework.Scenes
437 452
438 if (!resultOfObjectLinked) 453 if (!resultOfObjectLinked)
439 { 454 {
440 m_numPrim -= grp.PrimCount; 455 // Decrement the total number of primitives (meshes and geometric primitives)
456 // that are part of the Scene Object being removed
457 m_numTotalPrim -= grp.PrimCount;
458
459 // Go through all parts (primitives and meshes) of this Scene Object
460 foreach (SceneObjectPart part in grp.Parts)
461 {
462 // Keep track of the total number of meshes or geometric primitives left in the scene;
463 // determine which object this is based on its primitive type: sculpted (sculpt) prim refers to
464 // a mesh and all other prims (i.e. box, sphere, etc) are geometric primitives
465 if (part.GetPrimType() == PrimType.SCULPT)
466 m_numMesh--;
467 else
468 m_numPrim--;
469 }
441 470
442 if ((grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics) 471 if ((grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
443 RemovePhysicalPrim(grp.PrimCount); 472 RemovePhysicalPrim(grp.PrimCount);
@@ -687,9 +716,19 @@ namespace OpenSim.Region.Framework.Scenes
687 716
688 public int GetTotalObjectsCount() 717 public int GetTotalObjectsCount()
689 { 718 {
719 return m_numTotalPrim;
720 }
721
722 public int GetTotalPrimObjectsCount()
723 {
690 return m_numPrim; 724 return m_numPrim;
691 } 725 }
692 726
727 public int GetTotalMeshObjectsCount()
728 {
729 return m_numMesh;
730 }
731
693 public int GetActiveObjectsCount() 732 public int GetActiveObjectsCount()
694 { 733 {
695 return m_physicalPrim; 734 return m_physicalPrim;
@@ -1970,7 +2009,19 @@ namespace OpenSim.Region.Framework.Scenes
1970 // think it's selected, so it will never send a deselect... 2009 // think it's selected, so it will never send a deselect...
1971 copy.IsSelected = false; 2010 copy.IsSelected = false;
1972 2011
1973 m_numPrim += copy.Parts.Length; 2012 m_numTotalPrim += copy.Parts.Length;
2013
2014 // Go through all parts (primitives and meshes) of this Scene Object
2015 foreach (SceneObjectPart part in copy.Parts)
2016 {
2017 // Keep track of the total number of meshes or geometric primitives now in the scene;
2018 // determine which object this is based on its primitive type: sculpted (sculpt) prim refers to
2019 // a mesh and all other prims (i.e. box, sphere, etc) are geometric primitives
2020 if (part.GetPrimType() == PrimType.SCULPT)
2021 m_numMesh++;
2022 else
2023 m_numPrim++;
2024 }
1974 2025
1975 if (rot != Quaternion.Identity) 2026 if (rot != Quaternion.Identity)
1976 { 2027 {