aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-11-07 22:08:58 +0000
committerJustin Clarke Casey2008-11-07 22:08:58 +0000
commitba1d9ca26b7b5e865824e16dc8930e85ef27eb54 (patch)
treef294fd0129360fef926a7ebd610adf4b7b813afa /OpenSim
parent* Rename PrimIDAllocate() to more effectively convey what it does, and put th... (diff)
downloadopensim-SC_OLD-ba1d9ca26b7b5e865824e16dc8930e85ef27eb54.zip
opensim-SC_OLD-ba1d9ca26b7b5e865824e16dc8930e85ef27eb54.tar.gz
opensim-SC_OLD-ba1d9ca26b7b5e865824e16dc8930e85ef27eb54.tar.bz2
opensim-SC_OLD-ba1d9ca26b7b5e865824e16dc8930e85ef27eb54.tar.xz
* refactor: cleanup AllocateLocalPrimId() a bit more
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs1
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs12
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs3
-rw-r--r--OpenSim/Region/Examples/SimpleModule/RegionModule.cs6
9 files changed, 19 insertions, 31 deletions
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs
index aab863a..64b48fe 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs
@@ -57,14 +57,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
57 #region Constructors 57 #region Constructors
58 58
59 //transparency of root part, NOT particle system. Should probably add support for changing particle system transparency. 59 //transparency of root part, NOT particle system. Should probably add support for changing particle system transparency.
60 public AuraMetaEntity(Scene scene, uint LocalId, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale) 60 public AuraMetaEntity(Scene scene, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale)
61 : base(scene, LocalId, groupPos, transparency) 61 : base(scene, groupPos, transparency)
62 { 62 {
63 SetAura(color, scale); 63 SetAura(color, scale);
64 } 64 }
65 65
66 public AuraMetaEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale) 66 public AuraMetaEntity(Scene scene, UUID uuid, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale)
67 : base(scene, uuid, LocalId, groupPos, transparency) 67 : base(scene, uuid, groupPos, transparency)
68 { 68 {
69 SetAura(color, scale); 69 SetAura(color, scale);
70 } 70 }
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs
index ca20ee6..d0015f7 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs
@@ -56,14 +56,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
56 { 56 {
57 #region Constructors 57 #region Constructors
58 58
59 public BeamMetaEntity(Scene scene, uint LocalId, Vector3 groupPos, float transparency, SceneObjectPart To, Vector3 color) 59 public BeamMetaEntity(Scene scene, Vector3 groupPos, float transparency, SceneObjectPart To, Vector3 color)
60 : base(scene, LocalId, groupPos, transparency) 60 : base(scene, groupPos, transparency)
61 { 61 {
62 SetBeamToUUID(To, color); 62 SetBeamToUUID(To, color);
63 } 63 }
64 64
65 public BeamMetaEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos, float transparency, SceneObjectPart To, Vector3 color) 65 public BeamMetaEntity(Scene scene, UUID uuid, Vector3 groupPos, float transparency, SceneObjectPart To, Vector3 color)
66 : base(scene, uuid, LocalId, groupPos, transparency) 66 : base(scene, uuid, groupPos, transparency)
67 { 67 {
68 SetBeamToUUID(To, color); 68 SetBeamToUUID(To, color);
69 } 69 }
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs
index f8c8a96..c1f8a8a 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs
@@ -146,7 +146,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
146 public AuraMetaEntity CreateAuraForNewlyCreatedEntity(SceneObjectPart part) 146 public AuraMetaEntity CreateAuraForNewlyCreatedEntity(SceneObjectPart part)
147 { 147 {
148 AuraMetaEntity ent = new AuraMetaEntity(part.ParentGroup.Scene, 148 AuraMetaEntity ent = new AuraMetaEntity(part.ParentGroup.Scene,
149 part.ParentGroup.Scene.AllocateLocalPrimId(),
150 part.GetWorldPosition(), 149 part.GetWorldPosition(),
151 MetaEntity.TRANSLUCENT, 150 MetaEntity.TRANSLUCENT,
152 new Vector3(0,254,0), 151 new Vector3(0,254,0),
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs
index 9d81262..e58d945 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
110 { 110 {
111 if (m_MetaEntityCollection.Auras.ContainsKey(((SceneObjectPart)missingPart).UUID)) 111 if (m_MetaEntityCollection.Auras.ContainsKey(((SceneObjectPart)missingPart).UUID))
112 continue; 112 continue;
113 newList.Add(m_MetaEntityCollection.CreateAuraForNewlyCreatedEntity((SceneObjectPart)missingPart)); 113 newList.Add(m_MetaEntityCollection.CreateAuraForNewlyCreatedEntity((SceneObjectPart)missingPart));
114 } 114 }
115 m_log.Info("Number of missing objects found: " + newList.Count); 115 m_log.Info("Number of missing objects found: " + newList.Count);
116 return newList; 116 return newList;
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs
index ac2af34..d0b5929 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs
@@ -153,7 +153,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
153 else 153 else
154 { 154 {
155 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, 155 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
156 m_Entity.Scene.AllocateLocalPrimId(),
157 part.GetWorldPosition(), 156 part.GetWorldPosition(),
158 MetaEntity.TRANSLUCENT, 157 MetaEntity.TRANSLUCENT,
159 new Vector3(254,0,0), 158 new Vector3(254,0,0),
@@ -260,7 +259,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
260 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID); 259 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
261 } 260 }
262 BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene, 261 BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
263 m_Entity.Scene.AllocateLocalPrimId(),
264 m_UnchangedEntity.RootPart.GetWorldPosition(), 262 m_UnchangedEntity.RootPart.GetWorldPosition(),
265 MetaEntity.TRANSLUCENT, 263 MetaEntity.TRANSLUCENT,
266 sceneEntityPart, 264 sceneEntityPart,
@@ -275,7 +273,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
275 m_AuraEntities.Remove(UnchangedPart.UUID); 273 m_AuraEntities.Remove(UnchangedPart.UUID);
276 } 274 }
277 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, 275 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
278 m_Entity.Scene.AllocateLocalPrimId(),
279 UnchangedPart.GetWorldPosition(), 276 UnchangedPart.GetWorldPosition(),
280 MetaEntity.TRANSLUCENT, 277 MetaEntity.TRANSLUCENT,
281 new Vector3(0,0,254), 278 new Vector3(0,0,254),
@@ -309,7 +306,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
309 m_AuraEntities.Remove(UnchangedPart.UUID); 306 m_AuraEntities.Remove(UnchangedPart.UUID);
310 } 307 }
311 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, 308 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
312 m_Entity.Scene.AllocateLocalPrimId(),
313 UnchangedPart.GetWorldPosition(), 309 UnchangedPart.GetWorldPosition(),
314 MetaEntity.TRANSLUCENT, 310 MetaEntity.TRANSLUCENT,
315 new Vector3(254,0,0), 311 new Vector3(254,0,0),
@@ -317,7 +313,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
317 ); 313 );
318 m_AuraEntities.Add(UnchangedPart.UUID, auraGroup); 314 m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
319 SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT); 315 SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
320 316
321 DiffersFromSceneGroup = true; 317 DiffersFromSceneGroup = true;
322 } 318 }
323 } 319 }
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs
index a96547b..801f8ff 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs
@@ -166,10 +166,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
166 parts.Add(part.UUID, part); 166 parts.Add(part.UUID, part);
167 } 167 }
168 168
169 // make new localids
170 foreach (SceneObjectPart part in m_Entity.Children.Values)
171 part.LocalId = m_Entity.Scene.AllocateLocalPrimId();
172
173 //finalize 169 //finalize
174 m_Entity.RootPart.PhysActor = null; 170 m_Entity.RootPart.PhysActor = null;
175 m_Entity.Children = parts; 171 m_Entity.Children = parts;
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs
index 81746c5..bf7d944 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs
@@ -56,17 +56,17 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
56 { 56 {
57 #region Constructors 57 #region Constructors
58 58
59 public PointMetaEntity(Scene scene, uint LocalId, Vector3 groupPos, float transparency) 59 public PointMetaEntity(Scene scene, Vector3 groupPos, float transparency)
60 : base() 60 : base()
61 { 61 {
62 CreatePointEntity(scene, UUID.Random(), LocalId, groupPos); 62 CreatePointEntity(scene, UUID.Random(), groupPos);
63 SetPartTransparency(m_Entity.RootPart, transparency); 63 SetPartTransparency(m_Entity.RootPart, transparency);
64 } 64 }
65 65
66 public PointMetaEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos, float transparency) 66 public PointMetaEntity(Scene scene, UUID uuid, Vector3 groupPos, float transparency)
67 : base() 67 : base()
68 { 68 {
69 CreatePointEntity(scene, uuid, LocalId, groupPos); 69 CreatePointEntity(scene, uuid, groupPos);
70 SetPartTransparency(m_Entity.RootPart, transparency); 70 SetPartTransparency(m_Entity.RootPart, transparency);
71 } 71 }
72 72
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
74 74
75 #region Private Methods 75 #region Private Methods
76 76
77 private void CreatePointEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos) 77 private void CreatePointEntity(Scene scene, UUID uuid, Vector3 groupPos)
78 { 78 {
79 SceneObjectGroup x = new SceneObjectGroup(); 79 SceneObjectGroup x = new SceneObjectGroup();
80 SceneObjectPart y = new SceneObjectPart(); 80 SceneObjectPart y = new SceneObjectPart();
@@ -88,8 +88,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
88 y.LastOwnerID = UUID.Zero; 88 y.LastOwnerID = UUID.Zero;
89 y.UUID = uuid; 89 y.UUID = uuid;
90 90
91 y.LocalId = LocalId;
92
93 y.Shape = PrimitiveBaseShape.CreateBox(); 91 y.Shape = PrimitiveBaseShape.CreateBox();
94 y.Scale = new Vector3(0.01f,0.01f,0.01f); 92 y.Scale = new Vector3(0.01f,0.01f,0.01f);
95 y.LastOwnerID = UUID.Zero; 93 y.LastOwnerID = UUID.Zero;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index cb4c2f5..833b765 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1606,6 +1606,7 @@ namespace OpenSim.Region.Environment.Scenes
1606 m_log.ErrorFormat("[SCENE] Found a SceneObjectGroup with m_rootPart == null and {0} children", 1606 m_log.ErrorFormat("[SCENE] Found a SceneObjectGroup with m_rootPart == null and {0} children",
1607 group.Children == null ? 0 : group.Children.Count); 1607 group.Children == null ? 0 : group.Children.Count);
1608 } 1608 }
1609
1609 AddRestoredSceneObject(group, true, true); 1610 AddRestoredSceneObject(group, true, true);
1610 SceneObjectPart rootPart = group.GetChildPart(group.UUID); 1611 SceneObjectPart rootPart = group.GetChildPart(group.UUID);
1611 rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted; 1612 rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted;
@@ -1621,7 +1622,7 @@ namespace OpenSim.Region.Environment.Scenes
1621 /// Returns a new unallocated local primitive ID 1622 /// Returns a new unallocated local primitive ID
1622 /// </summary> 1623 /// </summary>
1623 /// <returns>A brand new local primitive ID</returns> 1624 /// <returns>A brand new local primitive ID</returns>
1624 public uint AllocateLocalPrimId() 1625 protected internal uint AllocateLocalPrimId()
1625 { 1626 {
1626 uint myID; 1627 uint myID;
1627 1628
diff --git a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs
index b3965d7..1bb6cae 100644
--- a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs
+++ b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs
@@ -104,8 +104,7 @@ namespace OpenSim.Region.Examples.SimpleModule
104 // { 104 // {
105 // Vector3 posOffset = new Vector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4); 105 // Vector3 posOffset = new Vector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4);
106 // ComplexObject complexObject = 106 // ComplexObject complexObject =
107 // new ComplexObject(m_scene, regionInfo.RegionHandle, UUID.Zero, m_scene.AllocateLocalPrimId(), 107 // new ComplexObject(m_scene, regionInfo.RegionHandle, UUID.Zero, pos + posOffset);
108 // pos + posOffset);
109 // m_scene.AddNewSceneObject(complexObject, true); 108 // m_scene.AddNewSceneObject(complexObject, true);
110 // } 109 // }
111 // } 110 // }
@@ -113,8 +112,7 @@ namespace OpenSim.Region.Examples.SimpleModule
113 // private void AddCpuCounter(RegionInfo regionInfo, Vector3 pos) 112 // private void AddCpuCounter(RegionInfo regionInfo, Vector3 pos)
114 // { 113 // {
115 // SceneObjectGroup sceneObject = 114 // SceneObjectGroup sceneObject =
116 // new CpuCounterObject(m_scene, regionInfo.RegionHandle, UUID.Zero, m_scene.AllocateLocalPrimId(), 115 // new CpuCounterObject(m_scene, regionInfo.RegionHandle, UUID.Zero, pos + new Vector3(1f, 1f, 1f));
117 // pos + new Vector3(1f, 1f, 1f));
118 // m_scene.AddNewSceneObject(sceneObject, true); 116 // m_scene.AddNewSceneObject(sceneObject, true);
119 // } 117 // }
120 118