diff options
Diffstat (limited to 'OpenSim/Region')
8 files changed, 38 insertions, 35 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 | } |
diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs index 3a0b05d..607a620 100644 --- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs | |||
@@ -51,9 +51,9 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
51 | { | 51 | { |
52 | } | 52 | } |
53 | 53 | ||
54 | public RotatingWheel(SceneObjectGroup parent, UUID ownerID, uint localID, | 54 | public RotatingWheel(SceneObjectGroup parent, UUID ownerID, |
55 | Vector3 groupPosition, Vector3 offsetPosition, Quaternion rotationDirection) | 55 | Vector3 groupPosition, Vector3 offsetPosition, Quaternion rotationDirection) |
56 | : base(parent, ownerID, localID, PrimitiveBaseShape.Default, groupPosition, offsetPosition) | 56 | : base(parent, ownerID, PrimitiveBaseShape.Default, groupPosition, offsetPosition) |
57 | { | 57 | { |
58 | m_rotationDirection = rotationDirection; | 58 | m_rotationDirection = rotationDirection; |
59 | 59 | ||
@@ -78,29 +78,29 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
78 | } | 78 | } |
79 | 79 | ||
80 | public ComplexObject(Scene scene, ulong regionHandle, UUID ownerID, uint localID, Vector3 pos) | 80 | public ComplexObject(Scene scene, ulong regionHandle, UUID ownerID, uint localID, Vector3 pos) |
81 | : base(ownerID, localID, pos, PrimitiveBaseShape.Default) | 81 | : base(ownerID, pos, PrimitiveBaseShape.Default) |
82 | { | 82 | { |
83 | m_rotationDirection = new Quaternion(0.05f, 0.1f, 0.15f); | 83 | m_rotationDirection = new Quaternion(0.05f, 0.1f, 0.15f); |
84 | 84 | ||
85 | AddPart( | 85 | AddPart( |
86 | new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0, 0.75f), | 86 | new RotatingWheel(this, ownerID, pos, new Vector3(0, 0, 0.75f), |
87 | new Quaternion(0.05f, 0, 0))); | 87 | new Quaternion(0.05f, 0, 0))); |
88 | AddPart( | 88 | AddPart( |
89 | new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0, -0.75f), | 89 | new RotatingWheel(this, ownerID, pos, new Vector3(0, 0, -0.75f), |
90 | new Quaternion(-0.05f, 0, 0))); | 90 | new Quaternion(-0.05f, 0, 0))); |
91 | 91 | ||
92 | AddPart( | 92 | AddPart( |
93 | new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0.75f, 0), | 93 | new RotatingWheel(this, ownerID, pos, new Vector3(0, 0.75f, 0), |
94 | new Quaternion(0.5f, 0, 0.05f))); | 94 | new Quaternion(0.5f, 0, 0.05f))); |
95 | AddPart( | 95 | AddPart( |
96 | new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, -0.75f, 0), | 96 | new RotatingWheel(this, ownerID, pos, new Vector3(0, -0.75f, 0), |
97 | new Quaternion(-0.5f, 0, -0.05f))); | 97 | new Quaternion(-0.5f, 0, -0.05f))); |
98 | 98 | ||
99 | AddPart( | 99 | AddPart( |
100 | new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0.75f, 0, 0), | 100 | new RotatingWheel(this, ownerID, pos, new Vector3(0.75f, 0, 0), |
101 | new Quaternion(0, 0.5f, 0.05f))); | 101 | new Quaternion(0, 0.5f, 0.05f))); |
102 | AddPart( | 102 | AddPart( |
103 | new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(-0.75f, 0, 0), | 103 | new RotatingWheel(this, ownerID, pos, new Vector3(-0.75f, 0, 0), |
104 | new Quaternion(0, -0.5f, -0.05f))); | 104 | new Quaternion(0, -0.5f, -0.05f))); |
105 | 105 | ||
106 | RootPart.Flags |= PrimFlags.Touch; | 106 | RootPart.Flags |= PrimFlags.Touch; |
diff --git a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs index 83bced5..4038564 100644 --- a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs | |||
@@ -45,8 +45,8 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
45 | 45 | ||
46 | private PerformanceCounter m_counter; | 46 | private PerformanceCounter m_counter; |
47 | 47 | ||
48 | public CpuCounterObject(UUID ownerID, uint localID, Vector3 pos) | 48 | public CpuCounterObject(UUID ownerID, Vector3 pos) |
49 | : base(ownerID, localID, pos, PrimitiveBaseShape.Default) | 49 | : base(ownerID, pos, PrimitiveBaseShape.Default) |
50 | { | 50 | { |
51 | String objectName = "Processor"; | 51 | String objectName = "Processor"; |
52 | String counterName = "% Processor Time"; | 52 | String counterName = "% Processor Time"; |
diff --git a/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs b/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs index 0903edd..2b84f1d 100644 --- a/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs | |||
@@ -34,8 +34,8 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
34 | { | 34 | { |
35 | public class FileSystemObject : SceneObjectGroup | 35 | public class FileSystemObject : SceneObjectGroup |
36 | { | 36 | { |
37 | public FileSystemObject(Scene world, FileInfo fileInfo, Vector3 pos) | 37 | public FileSystemObject(FileInfo fileInfo, Vector3 pos) |
38 | : base(UUID.Zero, world.NextLocalId, pos, PrimitiveBaseShape.Default) | 38 | : base(UUID.Zero, pos, PrimitiveBaseShape.Default) |
39 | { | 39 | { |
40 | Text = fileInfo.Name; | 40 | Text = fileInfo.Name; |
41 | } | 41 | } |