diff options
author | Justin Clarke Casey | 2008-11-07 21:07:14 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-07 21:07:14 +0000 |
commit | 54e10e5b61aa543102bcc3a7415877c44aabb5df (patch) | |
tree | d16149d29a5ef4921e9256f6128cbb9cc17aadc0 /OpenSim/Region/Environment/Scenes | |
parent | * refactor: stop unnecessary passing of scene to sog copy constructor (diff) | |
download | opensim-SC_OLD-54e10e5b61aa543102bcc3a7415877c44aabb5df.zip opensim-SC_OLD-54e10e5b61aa543102bcc3a7415877c44aabb5df.tar.gz opensim-SC_OLD-54e10e5b61aa543102bcc3a7415877c44aabb5df.tar.bz2 opensim-SC_OLD-54e10e5b61aa543102bcc3a7415877c44aabb5df.tar.xz |
* Stop requiring local ids in the SOG constructors.
* These are assigned when the object is attached to the scene
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
5 files changed, 25 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 95d9f2a..3931cf0 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1735,12 +1735,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1735 | //m_log.DebugFormat( | 1735 | //m_log.DebugFormat( |
1736 | // "[SCENE]: Scene.AddNewPrim() called for agent {0} in {1}", ownerID, RegionInfo.RegionName); | 1736 | // "[SCENE]: Scene.AddNewPrim() called for agent {0} in {1}", ownerID, RegionInfo.RegionName); |
1737 | 1737 | ||
1738 | SceneObjectGroup sceneOb = new SceneObjectGroup(ownerID, PrimIDAllocate(), pos, rot, shape); | 1738 | SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); |
1739 | 1739 | ||
1740 | SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); | 1740 | SceneObjectPart rootPart = sceneObject.GetChildPart(sceneObject.UUID); |
1741 | // if grass or tree, make phantom | 1741 | // if grass or tree, make phantom |
1742 | //rootPart.TrimPermissions(); | 1742 | //rootPart.TrimPermissions(); |
1743 | if ((rootPart.Shape.PCode == (byte)PCode.Grass) || (rootPart.Shape.PCode == (byte)PCode.Tree) || (rootPart.Shape.PCode == (byte)PCode.NewTree)) | 1743 | if ((rootPart.Shape.PCode == (byte)PCode.Grass) |
1744 | || (rootPart.Shape.PCode == (byte)PCode.Tree) || (rootPart.Shape.PCode == (byte)PCode.NewTree)) | ||
1744 | { | 1745 | { |
1745 | rootPart.AddFlag(PrimFlags.Phantom); | 1746 | rootPart.AddFlag(PrimFlags.Phantom); |
1746 | //rootPart.ObjectFlags += (uint)PrimFlags.Phantom; | 1747 | //rootPart.ObjectFlags += (uint)PrimFlags.Phantom; |
@@ -1748,9 +1749,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1748 | AdaptTree(ref shape); | 1749 | AdaptTree(ref shape); |
1749 | } | 1750 | } |
1750 | 1751 | ||
1751 | AddNewSceneObject(sceneOb, true); | 1752 | AddNewSceneObject(sceneObject, true); |
1752 | 1753 | ||
1753 | return sceneOb; | 1754 | return sceneObject; |
1754 | } | 1755 | } |
1755 | 1756 | ||
1756 | void AdaptTree(ref PrimitiveBaseShape tree) | 1757 | void AdaptTree(ref PrimitiveBaseShape tree) |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index dec8bf4..54ccaad 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -504,11 +504,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
504 | /// <summary> | 504 | /// <summary> |
505 | /// Constructor. This object is added to the scene later via AttachToScene() | 505 | /// Constructor. This object is added to the scene later via AttachToScene() |
506 | /// </summary> | 506 | /// </summary> |
507 | public SceneObjectGroup(UUID ownerID, uint localID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) | 507 | public SceneObjectGroup(UUID ownerID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) |
508 | { | 508 | { |
509 | Vector3 rootOffset = new Vector3(0, 0, 0); | 509 | Vector3 rootOffset = new Vector3(0, 0, 0); |
510 | SceneObjectPart newPart = | 510 | SceneObjectPart newPart = new SceneObjectPart(this, ownerID, shape, pos, rot, rootOffset); |
511 | new SceneObjectPart(this, ownerID, localID, shape, pos, rot, rootOffset); | ||
512 | newPart.LinkNum = 0; | 511 | newPart.LinkNum = 0; |
513 | m_parts.Add(newPart.UUID, newPart); | 512 | m_parts.Add(newPart.UUID, newPart); |
514 | SetPartAsRoot(newPart); | 513 | SetPartAsRoot(newPart); |
@@ -517,8 +516,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
517 | /// <summary> | 516 | /// <summary> |
518 | /// Constructor. | 517 | /// Constructor. |
519 | /// </summary> | 518 | /// </summary> |
520 | public SceneObjectGroup(UUID ownerID, uint localID, Vector3 pos, PrimitiveBaseShape shape) | 519 | public SceneObjectGroup(UUID ownerID, Vector3 pos, PrimitiveBaseShape shape) |
521 | : this(ownerID, localID, pos, Quaternion.Identity, shape) | 520 | : this(ownerID, pos, Quaternion.Identity, shape) |
522 | { | 521 | { |
523 | } | 522 | } |
524 | 523 | ||
@@ -1927,6 +1926,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
1927 | DelinkFromGroup(partID, true); | 1926 | DelinkFromGroup(partID, true); |
1928 | } | 1927 | } |
1929 | 1928 | ||
1929 | /// <summary> | ||
1930 | /// Delink the given prim from this group. The delinked prim is established as | ||
1931 | /// an independent SceneObjectGroup. | ||
1932 | /// </summary> | ||
1933 | /// <param name="partID"></param> | ||
1934 | /// <param name="sendEvents"></param> | ||
1930 | public void DelinkFromGroup(uint partID, bool sendEvents) | 1935 | public void DelinkFromGroup(uint partID, bool sendEvents) |
1931 | { | 1936 | { |
1932 | SceneObjectPart linkPart = GetChildPart(partID); | 1937 | SceneObjectPart linkPart = GetChildPart(partID); |
@@ -2006,6 +2011,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2006 | { | 2011 | { |
2007 | if (m_isBackedUp) | 2012 | if (m_isBackedUp) |
2008 | m_scene.EventManager.OnBackup -= ProcessBackup; | 2013 | m_scene.EventManager.OnBackup -= ProcessBackup; |
2014 | |||
2009 | m_isBackedUp = false; | 2015 | m_isBackedUp = false; |
2010 | } | 2016 | } |
2011 | 2017 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index d746ec4..d2c4253 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -216,9 +216,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
216 | Rezzed = DateTime.Now; | 216 | Rezzed = DateTime.Now; |
217 | } | 217 | } |
218 | 218 | ||
219 | public SceneObjectPart(SceneObjectGroup parent, UUID ownerID, uint localID, | 219 | public SceneObjectPart(SceneObjectGroup parent, UUID ownerID, |
220 | PrimitiveBaseShape shape, Vector3 groupPosition, Vector3 offsetPosition) | 220 | PrimitiveBaseShape shape, Vector3 groupPosition, Vector3 offsetPosition) |
221 | : this(parent, ownerID, localID, shape, groupPosition, Quaternion.Identity, offsetPosition) | 221 | : this(parent, ownerID, shape, groupPosition, Quaternion.Identity, offsetPosition) |
222 | { | 222 | { |
223 | } | 223 | } |
224 | 224 | ||
@@ -228,14 +228,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
228 | /// <param name="regionHandle"></param> | 228 | /// <param name="regionHandle"></param> |
229 | /// <param name="parent"></param> | 229 | /// <param name="parent"></param> |
230 | /// <param name="ownerID"></param> | 230 | /// <param name="ownerID"></param> |
231 | /// <param name="localID"></param> | ||
232 | /// <param name="shape"></param> | 231 | /// <param name="shape"></param> |
233 | /// <param name="position"></param> | 232 | /// <param name="position"></param> |
234 | /// <param name="rotationOffset"></param> | 233 | /// <param name="rotationOffset"></param> |
235 | /// <param name="offsetPosition"></param> | 234 | /// <param name="offsetPosition"></param> |
236 | public SceneObjectPart(SceneObjectGroup parent, UUID ownerID, uint localID, | 235 | public SceneObjectPart( |
237 | PrimitiveBaseShape shape, Vector3 groupPosition, Quaternion rotationOffset, | 236 | SceneObjectGroup parent, UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, |
238 | Vector3 offsetPosition) | 237 | Quaternion rotationOffset, Vector3 offsetPosition) |
239 | { | 238 | { |
240 | m_name = "Primitive"; | 239 | m_name = "Primitive"; |
241 | m_parentGroup = parent; | 240 | m_parentGroup = parent; |
@@ -246,7 +245,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
246 | _creatorID = _ownerID; | 245 | _creatorID = _ownerID; |
247 | _lastOwnerID = UUID.Zero; | 246 | _lastOwnerID = UUID.Zero; |
248 | UUID = UUID.Random(); | 247 | UUID = UUID.Random(); |
249 | LocalId = (uint) (localID); | ||
250 | Shape = shape; | 248 | Shape = shape; |
251 | // Todo: Add More Object Parameter from above! | 249 | // Todo: Add More Object Parameter from above! |
252 | _ownershipCost = 0; | 250 | _ownershipCost = 0; |
@@ -286,7 +284,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
286 | /// <param name="shape"></param> | 284 | /// <param name="shape"></param> |
287 | /// <param name="position"></param> | 285 | /// <param name="position"></param> |
288 | public SceneObjectPart(SceneObjectGroup parent, int creationDate, UUID ownerID, | 286 | public SceneObjectPart(SceneObjectGroup parent, int creationDate, UUID ownerID, |
289 | UUID creatorID, UUID lastOwnerID, uint localID, PrimitiveBaseShape shape, | 287 | UUID creatorID, UUID lastOwnerID, PrimitiveBaseShape shape, |
290 | Vector3 position, Quaternion rotation, uint flags) | 288 | Vector3 position, Quaternion rotation, uint flags) |
291 | { | 289 | { |
292 | m_parentGroup = parent; | 290 | m_parentGroup = parent; |
@@ -296,7 +294,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
296 | _creatorID = creatorID; | 294 | _creatorID = creatorID; |
297 | _lastOwnerID = lastOwnerID; | 295 | _lastOwnerID = lastOwnerID; |
298 | UUID = UUID.Random(); | 296 | UUID = UUID.Random(); |
299 | LocalId = (uint) (localID); | ||
300 | Shape = shape; | 297 | Shape = shape; |
301 | _ownershipCost = 0; | 298 | _ownershipCost = 0; |
302 | _objectSaleType = (byte) 0; | 299 | _objectSaleType = (byte) 0; |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index d37006a..beca44c 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -1118,9 +1118,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1118 | m_sitAtAutoTarget = false; | 1118 | m_sitAtAutoTarget = false; |
1119 | PrimitiveBaseShape proxy = PrimitiveBaseShape.Default; | 1119 | PrimitiveBaseShape proxy = PrimitiveBaseShape.Default; |
1120 | //proxy.PCode = (byte)PCode.ParticleSystem; | 1120 | //proxy.PCode = (byte)PCode.ParticleSystem; |
1121 | uint nextUUID = m_scene.NextLocalId; | ||
1122 | 1121 | ||
1123 | proxyObjectGroup = new SceneObjectGroup(UUID, nextUUID, Pos, Rotation, proxy); | 1122 | proxyObjectGroup = new SceneObjectGroup(UUID, Pos, Rotation, proxy); |
1124 | proxyObjectGroup.AttachToScene(m_scene); | 1123 | proxyObjectGroup.AttachToScene(m_scene); |
1125 | 1124 | ||
1126 | // Commented out this code since it could never have executed, but might still be informative. | 1125 | // Commented out this code since it could never have executed, but might still be informative. |
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs index 0b0f606..9d48802 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
74 | = new Scene(regInfo, acm, cm, scs, null, sm, null, null, false, false, false, configSource, null); | 74 | = new Scene(regInfo, acm, cm, scs, null, sm, null, null, false, false, false, configSource, null); |
75 | 75 | ||
76 | SceneObjectGroup sceneObject = new SceneObjectGroup(); | 76 | SceneObjectGroup sceneObject = new SceneObjectGroup(); |
77 | new SceneObjectPart(sceneObject, UUID.Zero, 1, null, Vector3.Zero, Quaternion.Identity, Vector3.Zero); | 77 | new SceneObjectPart(sceneObject, UUID.Zero, null, Vector3.Zero, Quaternion.Identity, Vector3.Zero); |
78 | 78 | ||
79 | scene.AddNewSceneObject(sceneObject, false); | 79 | scene.AddNewSceneObject(sceneObject, false); |
80 | } | 80 | } |