aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs (renamed from OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs)143
1 files changed, 102 insertions, 41 deletions
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 86610c0..b7bc229 100644
--- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -11,12 +11,12 @@ namespace OpenSim.Region.Environment.Scenes
11{ 11{
12 // public delegate void PrimCountTaintedDelegate(); 12 // public delegate void PrimCountTaintedDelegate();
13 13
14 public class AllNewSceneObjectGroup2 : EntityBase 14 public class SceneObjectGroup : EntityBase
15 { 15 {
16 private Encoding enc = Encoding.ASCII; 16 private Encoding enc = Encoding.ASCII;
17 17
18 protected AllNewSceneObjectPart2 m_rootPart; 18 protected SceneObjectPart m_rootPart;
19 protected Dictionary<LLUUID, AllNewSceneObjectPart2> m_parts = new Dictionary<LLUUID, AllNewSceneObjectPart2>(); 19 protected Dictionary<LLUUID, SceneObjectPart> m_parts = new Dictionary<LLUUID, SceneObjectPart>();
20 20
21 protected ulong m_regionHandle; 21 protected ulong m_regionHandle;
22 22
@@ -38,6 +38,12 @@ namespace OpenSim.Region.Environment.Scenes
38 get { return new LLVector3(0, 0, 0); } 38 get { return new LLVector3(0, 0, 0); }
39 } 39 }
40 40
41 public Dictionary<LLUUID, SceneObjectPart> Children
42 {
43 get { return this.m_parts; }
44 set { m_parts = value; }
45 }
46
41 public override LLVector3 Pos 47 public override LLVector3 Pos
42 { 48 {
43 get { return m_rootPart.GroupPosition; } 49 get { return m_rootPart.GroupPosition; }
@@ -45,7 +51,7 @@ namespace OpenSim.Region.Environment.Scenes
45 { 51 {
46 lock (this.m_parts) 52 lock (this.m_parts)
47 { 53 {
48 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) 54 foreach (SceneObjectPart part in this.m_parts.Values)
49 { 55 {
50 part.GroupPosition = value; 56 part.GroupPosition = value;
51 } 57 }
@@ -65,10 +71,29 @@ namespace OpenSim.Region.Environment.Scenes
65 set { m_rootPart.UUID = value; } 71 set { m_rootPart.UUID = value; }
66 } 72 }
67 73
74 public LLUUID OwnerID
75 {
76 get { return m_rootPart.OwnerID; }
77 }
78
79 /// <summary>
80 /// Added because the Parcel code seems to use it
81 /// but not sure a object should have this
82 /// as what does it tell us? that some avatar has selected it
83 /// think really there should be a list (or whatever) in each scenepresence
84 /// saying what prim(s) that user has selected at any time.
85 /// </summary>
86 protected bool m_isSelected = false;
87 public bool IsSelected
88 {
89 get{ return m_isSelected;}
90 set { m_isSelected = value; }
91 }
92
68 /// <summary> 93 /// <summary>
69 /// 94 ///
70 /// </summary> 95 /// </summary>
71 public AllNewSceneObjectGroup2() 96 public SceneObjectGroup()
72 { 97 {
73 98
74 } 99 }
@@ -76,7 +101,7 @@ namespace OpenSim.Region.Environment.Scenes
76 /// <summary> 101 /// <summary>
77 /// 102 ///
78 /// </summary> 103 /// </summary>
79 public AllNewSceneObjectGroup2(byte[] data) 104 public SceneObjectGroup(byte[] data)
80 { 105 {
81 106
82 } 107 }
@@ -84,14 +109,14 @@ namespace OpenSim.Region.Environment.Scenes
84 /// <summary> 109 /// <summary>
85 /// 110 ///
86 /// </summary> 111 /// </summary>
87 public AllNewSceneObjectGroup2(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) 112 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
88 { 113 {
89 m_regionHandle = regionHandle; 114 m_regionHandle = regionHandle;
90 m_scene = scene; 115 m_scene = scene;
91 116
92 this.Pos = pos; 117 this.Pos = pos;
93 LLVector3 rootOffset = new LLVector3(0, 0, 0); 118 LLVector3 rootOffset = new LLVector3(0, 0, 0);
94 AllNewSceneObjectPart2 newPart = new AllNewSceneObjectPart2(m_regionHandle, this, ownerID, localID, shape, pos, rootOffset); 119 SceneObjectPart newPart = new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rootOffset);
95 this.m_parts.Add(newPart.UUID, newPart); 120 this.m_parts.Add(newPart.UUID, newPart);
96 this.SetPartAsRoot(newPart); 121 this.SetPartAsRoot(newPart);
97 } 122 }
@@ -102,16 +127,16 @@ namespace OpenSim.Region.Environment.Scenes
102 /// 127 ///
103 /// </summary> 128 /// </summary>
104 /// <returns></returns> 129 /// <returns></returns>
105 public new AllNewSceneObjectGroup2 Copy() 130 public new SceneObjectGroup Copy()
106 { 131 {
107 AllNewSceneObjectGroup2 dupe = (AllNewSceneObjectGroup2)this.MemberwiseClone(); 132 SceneObjectGroup dupe = (SceneObjectGroup)this.MemberwiseClone();
108 dupe.Pos = new LLVector3(Pos.X, Pos.Y, Pos.Z); 133 dupe.Pos = new LLVector3(Pos.X, Pos.Y, Pos.Z);
109 dupe.m_scene = m_scene; 134 dupe.m_scene = m_scene;
110 dupe.m_regionHandle = this.m_regionHandle; 135 dupe.m_regionHandle = this.m_regionHandle;
111 136
112 dupe.CopyRootPart(this.m_rootPart); 137 dupe.CopyRootPart(this.m_rootPart);
113 138
114 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) 139 foreach (SceneObjectPart part in this.m_parts.Values)
115 { 140 {
116 if (part.UUID != this.m_rootPart.UUID) 141 if (part.UUID != this.m_rootPart.UUID)
117 { 142 {
@@ -125,9 +150,9 @@ namespace OpenSim.Region.Environment.Scenes
125 /// 150 ///
126 /// </summary> 151 /// </summary>
127 /// <param name="part"></param> 152 /// <param name="part"></param>
128 public void CopyRootPart(AllNewSceneObjectPart2 part) 153 public void CopyRootPart(SceneObjectPart part)
129 { 154 {
130 AllNewSceneObjectPart2 newPart = part.Copy(m_scene.PrimIDAllocate()); 155 SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate());
131 this.m_parts.Add(newPart.UUID, newPart); 156 this.m_parts.Add(newPart.UUID, newPart);
132 this.SetPartAsRoot(newPart); 157 this.SetPartAsRoot(newPart);
133 } 158 }
@@ -136,9 +161,9 @@ namespace OpenSim.Region.Environment.Scenes
136 /// 161 ///
137 /// </summary> 162 /// </summary>
138 /// <param name="part"></param> 163 /// <param name="part"></param>
139 public void CopyPart(AllNewSceneObjectPart2 part) 164 public void CopyPart(SceneObjectPart part)
140 { 165 {
141 AllNewSceneObjectPart2 newPart = part.Copy(m_scene.PrimIDAllocate()); 166 SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate());
142 this.m_parts.Add(newPart.UUID, newPart); 167 this.m_parts.Add(newPart.UUID, newPart);
143 this.SetPartAsNonRoot(newPart); 168 this.SetPartAsNonRoot(newPart);
144 } 169 }
@@ -149,7 +174,7 @@ namespace OpenSim.Region.Environment.Scenes
149 /// </summary> 174 /// </summary>
150 public override void Update() 175 public override void Update()
151 { 176 {
152 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) 177 foreach (SceneObjectPart part in this.m_parts.Values)
153 { 178 {
154 part.SendScheduledUpdates(); 179 part.SendScheduledUpdates();
155 } 180 }
@@ -160,7 +185,7 @@ namespace OpenSim.Region.Environment.Scenes
160 /// </summary> 185 /// </summary>
161 public void ScheduleGroupForFullUpdate() 186 public void ScheduleGroupForFullUpdate()
162 { 187 {
163 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) 188 foreach (SceneObjectPart part in this.m_parts.Values)
164 { 189 {
165 part.ScheduleFullUpdate(); 190 part.ScheduleFullUpdate();
166 } 191 }
@@ -171,7 +196,7 @@ namespace OpenSim.Region.Environment.Scenes
171 /// </summary> 196 /// </summary>
172 public void ScheduleGroupForTerseUpdate() 197 public void ScheduleGroupForTerseUpdate()
173 { 198 {
174 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) 199 foreach (SceneObjectPart part in this.m_parts.Values)
175 { 200 {
176 part.ScheduleTerseUpdate(); 201 part.ScheduleTerseUpdate();
177 } 202 }
@@ -182,7 +207,7 @@ namespace OpenSim.Region.Environment.Scenes
182 /// </summary> 207 /// </summary>
183 public void SendGroupFullUpdate() 208 public void SendGroupFullUpdate()
184 { 209 {
185 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) 210 foreach (SceneObjectPart part in this.m_parts.Values)
186 { 211 {
187 part.SendFullUpdateToAllClients(); 212 part.SendFullUpdateToAllClients();
188 } 213 }
@@ -193,7 +218,7 @@ namespace OpenSim.Region.Environment.Scenes
193 /// </summary> 218 /// </summary>
194 public void SendGroupTerseUpdate() 219 public void SendGroupTerseUpdate()
195 { 220 {
196 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) 221 foreach (SceneObjectPart part in this.m_parts.Values)
197 { 222 {
198 part.SendTerseUpdateToAllClients(); 223 part.SendTerseUpdateToAllClients();
199 } 224 }
@@ -203,7 +228,7 @@ namespace OpenSim.Region.Environment.Scenes
203 /// 228 ///
204 /// </summary> 229 /// </summary>
205 /// <param name="objectGroup"></param> 230 /// <param name="objectGroup"></param>
206 public void LinkToGroup(AllNewSceneObjectGroup2 objectGroup) 231 public void LinkToGroup(SceneObjectGroup objectGroup)
207 { 232 {
208 233
209 } 234 }
@@ -213,9 +238,9 @@ namespace OpenSim.Region.Environment.Scenes
213 /// </summary> 238 /// </summary>
214 /// <param name="primID"></param> 239 /// <param name="primID"></param>
215 /// <returns></returns> 240 /// <returns></returns>
216 private AllNewSceneObjectPart2 GetChildPrim(LLUUID primID) 241 private SceneObjectPart GetChildPrim(LLUUID primID)
217 { 242 {
218 AllNewSceneObjectPart2 childPart = null; 243 SceneObjectPart childPart = null;
219 if (this.m_parts.ContainsKey(primID)) 244 if (this.m_parts.ContainsKey(primID))
220 { 245 {
221 childPart = this.m_parts[primID]; 246 childPart = this.m_parts[primID];
@@ -228,9 +253,9 @@ namespace OpenSim.Region.Environment.Scenes
228 /// </summary> 253 /// </summary>
229 /// <param name="localID"></param> 254 /// <param name="localID"></param>
230 /// <returns></returns> 255 /// <returns></returns>
231 private AllNewSceneObjectPart2 GetChildPrim(uint localID) 256 private SceneObjectPart GetChildPrim(uint localID)
232 { 257 {
233 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) 258 foreach (SceneObjectPart part in this.m_parts.Values)
234 { 259 {
235 if (part.LocalID == localID) 260 if (part.LocalID == localID)
236 { 261 {
@@ -248,7 +273,7 @@ namespace OpenSim.Region.Environment.Scenes
248 /// <returns></returns> 273 /// <returns></returns>
249 public bool HasChildPrim(LLUUID primID) 274 public bool HasChildPrim(LLUUID primID)
250 { 275 {
251 AllNewSceneObjectPart2 childPart = null; 276 SceneObjectPart childPart = null;
252 if (this.m_parts.ContainsKey(primID)) 277 if (this.m_parts.ContainsKey(primID))
253 { 278 {
254 childPart = this.m_parts[primID]; 279 childPart = this.m_parts[primID];
@@ -265,7 +290,7 @@ namespace OpenSim.Region.Environment.Scenes
265 /// <returns></returns> 290 /// <returns></returns>
266 public bool HasChildPrim(uint localID) 291 public bool HasChildPrim(uint localID)
267 { 292 {
268 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) 293 foreach (SceneObjectPart part in this.m_parts.Values)
269 { 294 {
270 if (part.LocalID == localID) 295 if (part.LocalID == localID)
271 { 296 {
@@ -315,7 +340,7 @@ namespace OpenSim.Region.Environment.Scenes
315 proper.ObjectData[0].GroupID = LLUUID.Zero; 340 proper.ObjectData[0].GroupID = LLUUID.Zero;
316 proper.ObjectData[0].InventorySerial = 0; 341 proper.ObjectData[0].InventorySerial = 0;
317 proper.ObjectData[0].LastOwnerID = this.m_rootPart.LastOwnerID; 342 proper.ObjectData[0].LastOwnerID = this.m_rootPart.LastOwnerID;
318 proper.ObjectData[0].ObjectID = this.m_uuid; 343 proper.ObjectData[0].ObjectID = this.UUID;
319 proper.ObjectData[0].OwnerID = this.m_rootPart.OwnerID; 344 proper.ObjectData[0].OwnerID = this.m_rootPart.OwnerID;
320 proper.ObjectData[0].TouchName = enc.GetBytes(this.m_rootPart.TouchName + "\0"); 345 proper.ObjectData[0].TouchName = enc.GetBytes(this.m_rootPart.TouchName + "\0");
321 proper.ObjectData[0].TextureID = new byte[0]; 346 proper.ObjectData[0].TextureID = new byte[0];
@@ -334,11 +359,33 @@ namespace OpenSim.Region.Environment.Scenes
334 /// <summary> 359 /// <summary>
335 /// 360 ///
336 /// </summary> 361 /// </summary>
362 /// <param name="name"></param>
363 public void SetPartName(string name, uint localID)
364 {
365 SceneObjectPart part = this.GetChildPrim(localID);
366 if (part != null)
367 {
368 part.PartName = name;
369 }
370 }
371
372 public void SetPartDescription(string des, uint localID)
373 {
374 SceneObjectPart part = this.GetChildPrim(localID);
375 if (part != null)
376 {
377 part.Description = des;
378 }
379 }
380
381 /// <summary>
382 ///
383 /// </summary>
337 /// <param name="remoteClient"></param> 384 /// <param name="remoteClient"></param>
338 /// <param name="localID"></param> 385 /// <param name="localID"></param>
339 public void GetInventory(IClientAPI remoteClient, uint localID) 386 public void GetPartInventory(IClientAPI remoteClient, uint localID)
340 { 387 {
341 AllNewSceneObjectPart2 part = this.GetChildPrim(localID); 388 SceneObjectPart part = this.GetChildPrim(localID);
342 if (part != null) 389 if (part != null)
343 { 390 {
344 part.GetInventory(remoteClient, localID); 391 part.GetInventory(remoteClient, localID);
@@ -354,7 +401,7 @@ namespace OpenSim.Region.Environment.Scenes
354 /// <param name="data"></param> 401 /// <param name="data"></param>
355 public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data) 402 public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
356 { 403 {
357 AllNewSceneObjectPart2 part = this.GetChildPrim(localID); 404 SceneObjectPart part = this.GetChildPrim(localID);
358 if (part != null) 405 if (part != null)
359 { 406 {
360 part.UpdateExtraParam(type, inUse, data); 407 part.UpdateExtraParam(type, inUse, data);
@@ -368,7 +415,7 @@ namespace OpenSim.Region.Environment.Scenes
368 /// <param name="textureEntry"></param> 415 /// <param name="textureEntry"></param>
369 public void UpdateTextureEntry(uint localID, byte[] textureEntry) 416 public void UpdateTextureEntry(uint localID, byte[] textureEntry)
370 { 417 {
371 AllNewSceneObjectPart2 part = this.GetChildPrim(localID); 418 SceneObjectPart part = this.GetChildPrim(localID);
372 if (part != null) 419 if (part != null)
373 { 420 {
374 part.UpdateTextureEntry(textureEntry); 421 part.UpdateTextureEntry(textureEntry);
@@ -382,7 +429,7 @@ namespace OpenSim.Region.Environment.Scenes
382 /// <param name="shapeBlock"></param> 429 /// <param name="shapeBlock"></param>
383 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID) 430 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
384 { 431 {
385 AllNewSceneObjectPart2 part = this.GetChildPrim(localID); 432 SceneObjectPart part = this.GetChildPrim(localID);
386 if (part != null) 433 if (part != null)
387 { 434 {
388 part.UpdateShape(shapeBlock); 435 part.UpdateShape(shapeBlock);
@@ -390,6 +437,20 @@ namespace OpenSim.Region.Environment.Scenes
390 } 437 }
391 #endregion 438 #endregion
392 439
440 /// <summary>
441 ///
442 /// </summary>
443 /// <param name="scale"></param>
444 /// <param name="localID"></param>
445 public void Resize(LLVector3 scale, uint localID)
446 {
447 SceneObjectPart part = this.GetChildPrim(localID);
448 if (part != null)
449 {
450 part.Resize(scale);
451 }
452 }
453
393 #region Position 454 #region Position
394 /// <summary> 455 /// <summary>
395 /// 456 ///
@@ -407,7 +468,7 @@ namespace OpenSim.Region.Environment.Scenes
407 /// <param name="localID"></param> 468 /// <param name="localID"></param>
408 public void UpdateSinglePosition(LLVector3 pos, uint localID) 469 public void UpdateSinglePosition(LLVector3 pos, uint localID)
409 { 470 {
410 AllNewSceneObjectPart2 part = this.GetChildPrim(localID); 471 SceneObjectPart part = this.GetChildPrim(localID);
411 if (part != null) 472 if (part != null)
412 { 473 {
413 if (part.UUID == this.m_rootPart.UUID) 474 if (part.UUID == this.m_rootPart.UUID)
@@ -437,7 +498,7 @@ namespace OpenSim.Region.Environment.Scenes
437 diff.Y = axDiff.y; 498 diff.Y = axDiff.y;
438 diff.Z = axDiff.z; 499 diff.Z = axDiff.z;
439 500
440 foreach (AllNewSceneObjectPart2 obPart in this.m_parts.Values) 501 foreach (SceneObjectPart obPart in this.m_parts.Values)
441 { 502 {
442 if (obPart.UUID != this.m_rootPart.UUID) 503 if (obPart.UUID != this.m_rootPart.UUID)
443 { 504 {
@@ -479,7 +540,7 @@ namespace OpenSim.Region.Environment.Scenes
479 /// <param name="localID"></param> 540 /// <param name="localID"></param>
480 public void UpdateSingleRotation(LLQuaternion rot, uint localID) 541 public void UpdateSingleRotation(LLQuaternion rot, uint localID)
481 { 542 {
482 AllNewSceneObjectPart2 part = this.GetChildPrim(localID); 543 SceneObjectPart part = this.GetChildPrim(localID);
483 if (part != null) 544 if (part != null)
484 { 545 {
485 if (part.UUID == this.m_rootPart.UUID) 546 if (part.UUID == this.m_rootPart.UUID)
@@ -503,7 +564,7 @@ namespace OpenSim.Region.Environment.Scenes
503 Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); 564 Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z);
504 Axiom.Math.Quaternion oldParentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z); 565 Axiom.Math.Quaternion oldParentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z);
505 566
506 foreach (AllNewSceneObjectPart2 prim in this.m_parts.Values) 567 foreach (SceneObjectPart prim in this.m_parts.Values)
507 { 568 {
508 if (prim.UUID != this.m_rootPart.UUID) 569 if (prim.UUID != this.m_rootPart.UUID)
509 { 570 {
@@ -524,7 +585,7 @@ namespace OpenSim.Region.Environment.Scenes
524 /// 585 ///
525 /// </summary> 586 /// </summary>
526 /// <param name="part"></param> 587 /// <param name="part"></param>
527 private void SetPartAsRoot(AllNewSceneObjectPart2 part) 588 private void SetPartAsRoot(SceneObjectPart part)
528 { 589 {
529 this.m_rootPart = part; 590 this.m_rootPart = part;
530 //this.m_uuid= part.UUID; 591 //this.m_uuid= part.UUID;
@@ -535,7 +596,7 @@ namespace OpenSim.Region.Environment.Scenes
535 /// 596 ///
536 /// </summary> 597 /// </summary>
537 /// <param name="part"></param> 598 /// <param name="part"></param>
538 private void SetPartAsNonRoot(AllNewSceneObjectPart2 part) 599 private void SetPartAsNonRoot(SceneObjectPart part)
539 { 600 {
540 part.ParentID = this.m_rootPart.LocalID; 601 part.ParentID = this.m_rootPart.LocalID;
541 } 602 }
@@ -554,7 +615,7 @@ namespace OpenSim.Region.Environment.Scenes
554 /// </summary> 615 /// </summary>
555 /// <param name="remoteClient"></param> 616 /// <param name="remoteClient"></param>
556 /// <param name="part"></param> 617 /// <param name="part"></param>
557 internal void SendPartFullUpdate(IClientAPI remoteClient, AllNewSceneObjectPart2 part) 618 internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part)
558 { 619 {
559 if( m_rootPart == part ) 620 if( m_rootPart == part )
560 { 621 {
@@ -571,7 +632,7 @@ namespace OpenSim.Region.Environment.Scenes
571 /// </summary> 632 /// </summary>
572 /// <param name="remoteClient"></param> 633 /// <param name="remoteClient"></param>
573 /// <param name="part"></param> 634 /// <param name="part"></param>
574 internal void SendPartTerseUpdate(IClientAPI remoteClient, AllNewSceneObjectPart2 part) 635 internal void SendPartTerseUpdate(IClientAPI remoteClient, SceneObjectPart part)
575 { 636 {
576 if (m_rootPart == part) 637 if (m_rootPart == part)
577 { 638 {