aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorMW2007-08-07 18:31:20 +0000
committerMW2007-08-07 18:31:20 +0000
commit266b27267378bf9030f74135ac14af418a37e5ec (patch)
tree385d012d29ad61d849c1f8fd52d54d5091cbd655 /OpenSim/Region/Environment
parent* koncept bugfix (diff)
downloadopensim-SC_OLD-266b27267378bf9030f74135ac14af418a37e5ec.zip
opensim-SC_OLD-266b27267378bf9030f74135ac14af418a37e5ec.tar.gz
opensim-SC_OLD-266b27267378bf9030f74135ac14af418a37e5ec.tar.bz2
opensim-SC_OLD-266b27267378bf9030f74135ac14af418a37e5ec.tar.xz
Some more work on new Sceneobject.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs57
-rw-r--r--OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs52
-rw-r--r--OpenSim/Region/Environment/Scenes/EntityBase.cs4
3 files changed, 91 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs
index 4638d70..86610c0 100644
--- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs
+++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs
@@ -38,6 +38,33 @@ 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 override LLVector3 Pos
42 {
43 get { return m_rootPart.GroupPosition; }
44 set
45 {
46 lock (this.m_parts)
47 {
48 foreach (AllNewSceneObjectPart2 part in this.m_parts.Values)
49 {
50 part.GroupPosition = value;
51 }
52 }
53 }
54 }
55
56 public override uint LocalId
57 {
58 get { return m_rootPart.LocalID; }
59 set { m_rootPart.LocalID = value; }
60 }
61
62 public override LLUUID UUID
63 {
64 get { return m_rootPart.UUID; }
65 set { m_rootPart.UUID = value; }
66 }
67
41 /// <summary> 68 /// <summary>
42 /// 69 ///
43 /// </summary> 70 /// </summary>
@@ -370,7 +397,7 @@ namespace OpenSim.Region.Environment.Scenes
370 /// <param name="pos"></param> 397 /// <param name="pos"></param>
371 public void UpdateGroupPosition(LLVector3 pos) 398 public void UpdateGroupPosition(LLVector3 pos)
372 { 399 {
373 this.m_pos = pos; 400 this.Pos = pos;
374 } 401 }
375 402
376 /// <summary> 403 /// <summary>
@@ -442,7 +469,7 @@ namespace OpenSim.Region.Environment.Scenes
442 public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot) 469 public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot)
443 { 470 {
444 this.m_rootPart.UpdateRotation(rot); 471 this.m_rootPart.UpdateRotation(rot);
445 this.m_pos = pos; 472 this.Pos = pos;
446 } 473 }
447 474
448 /// <summary> 475 /// <summary>
@@ -500,8 +527,8 @@ namespace OpenSim.Region.Environment.Scenes
500 private void SetPartAsRoot(AllNewSceneObjectPart2 part) 527 private void SetPartAsRoot(AllNewSceneObjectPart2 part)
501 { 528 {
502 this.m_rootPart = part; 529 this.m_rootPart = part;
503 this.m_uuid = part.UUID; 530 //this.m_uuid= part.UUID;
504 this.m_localId = part.LocalID; 531 // this.m_localId = part.LocalID;
505 } 532 }
506 533
507 /// <summary> 534 /// <summary>
@@ -522,6 +549,11 @@ namespace OpenSim.Region.Environment.Scenes
522 return m_scene.RequestAvatarList(); 549 return m_scene.RequestAvatarList();
523 } 550 }
524 551
552 /// <summary>
553 ///
554 /// </summary>
555 /// <param name="remoteClient"></param>
556 /// <param name="part"></param>
525 internal void SendPartFullUpdate(IClientAPI remoteClient, AllNewSceneObjectPart2 part) 557 internal void SendPartFullUpdate(IClientAPI remoteClient, AllNewSceneObjectPart2 part)
526 { 558 {
527 if( m_rootPart == part ) 559 if( m_rootPart == part )
@@ -533,5 +565,22 @@ namespace OpenSim.Region.Environment.Scenes
533 part.SendFullUpdateToClient( remoteClient ); 565 part.SendFullUpdateToClient( remoteClient );
534 } 566 }
535 } 567 }
568
569 /// <summary>
570 ///
571 /// </summary>
572 /// <param name="remoteClient"></param>
573 /// <param name="part"></param>
574 internal void SendPartTerseUpdate(IClientAPI remoteClient, AllNewSceneObjectPart2 part)
575 {
576 if (m_rootPart == part)
577 {
578 part.SendTerseUpdateToClient(remoteClient, Pos);
579 }
580 else
581 {
582 part.SendTerseUpdateToClient(remoteClient);
583 }
584 }
536 } 585 }
537} 586}
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs
index 7b6676b..c91701a 100644
--- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs
+++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs
@@ -172,14 +172,6 @@ namespace OpenSim.Region.Environment.Scenes
172 } 172 }
173 #endregion 173 #endregion
174 174
175 //might not end up being used
176 protected bool m_isRoot;
177 public bool IsRoot
178 {
179 set { m_isRoot = value; }
180 get { return this.m_isRoot; }
181 }
182
183 #region Constructors 175 #region Constructors
184 /// <summary> 176 /// <summary>
185 /// 177 ///
@@ -209,9 +201,9 @@ namespace OpenSim.Region.Environment.Scenes
209 this.LastOwnerID = LLUUID.Zero; 201 this.LastOwnerID = LLUUID.Zero;
210 this.UUID = LLUUID.Random(); 202 this.UUID = LLUUID.Random();
211 this.LocalID = (uint)(localID); 203 this.LocalID = (uint)(localID);
212 this.m_shape = shape; 204 this.Shape = shape;
213 205
214 this.m_groupPosition = groupPosition; 206 this.GroupPosition = groupPosition;
215 this.OffsetPosition = offsetPosition; 207 this.OffsetPosition = offsetPosition;
216 this.RotationOffset = LLQuaternion.Identity; 208 this.RotationOffset = LLQuaternion.Identity;
217 this.Velocity = new LLVector3(0, 0, 0); 209 this.Velocity = new LLVector3(0, 0, 0);
@@ -245,7 +237,7 @@ namespace OpenSim.Region.Environment.Scenes
245 this.LastOwnerID = lastOwnerID; 237 this.LastOwnerID = lastOwnerID;
246 this.UUID = LLUUID.Random(); 238 this.UUID = LLUUID.Random();
247 this.LocalID = (uint)(localID); 239 this.LocalID = (uint)(localID);
248 this.m_shape = shape; 240 this.Shape = shape;
249 241
250 this.OffsetPosition = position; 242 this.OffsetPosition = position;
251 this.RotationOffset = rotation; 243 this.RotationOffset = rotation;
@@ -265,12 +257,14 @@ namespace OpenSim.Region.Environment.Scenes
265 dupe.m_regionHandle = m_regionHandle; 257 dupe.m_regionHandle = m_regionHandle;
266 dupe.UUID = LLUUID.Random(); 258 dupe.UUID = LLUUID.Random();
267 dupe.LocalID = localID; 259 dupe.LocalID = localID;
260 dupe.GroupPosition = new LLVector3(GroupPosition.X, GroupPosition.Y, GroupPosition.Z);
268 dupe.OffsetPosition = new LLVector3(OffsetPosition.X, OffsetPosition.Y, OffsetPosition.Z); 261 dupe.OffsetPosition = new LLVector3(OffsetPosition.X, OffsetPosition.Y, OffsetPosition.Z);
269 dupe.RotationOffset = new LLQuaternion(RotationOffset.X, RotationOffset.Y, RotationOffset.Z, RotationOffset.W); 262 dupe.RotationOffset = new LLQuaternion(RotationOffset.X, RotationOffset.Y, RotationOffset.Z, RotationOffset.W);
270 dupe.Velocity = new LLVector3(0, 0, 0); 263 dupe.Velocity = new LLVector3(0, 0, 0);
271 dupe.Acceleration = new LLVector3(0, 0, 0); 264 dupe.Acceleration = new LLVector3(0, 0, 0);
272 dupe.AngularVelocity = new LLVector3(0, 0, 0); 265 dupe.AngularVelocity = new LLVector3(0, 0, 0);
273 dupe.ObjectFlags = this.ObjectFlags; 266 dupe.ObjectFlags = this.ObjectFlags;
267 //TODO copy extraparams data and anything else not currently copied
274 return dupe; 268 return dupe;
275 } 269 }
276 #endregion 270 #endregion
@@ -439,13 +433,15 @@ namespace OpenSim.Region.Environment.Scenes
439 List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars(); 433 List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars();
440 for (int i = 0; i < avatars.Count; i++) 434 for (int i = 0; i < avatars.Count; i++)
441 { 435 {
442 SendFullUpdateToClient(avatars[i].ControllingClient); 436 m_parentGroup.SendPartFullUpdate(avatars[i].ControllingClient, this);
443 } 437 }
444 } 438 }
445 439
446 440 /// <summary>
447 441 ///
448 public void FullUpdate(IClientAPI remoteClient) 442 /// </summary>
443 /// <param name="remoteClient"></param>
444 public void SendFullUpdate(IClientAPI remoteClient)
449 { 445 {
450 m_parentGroup.SendPartFullUpdate( remoteClient, this ); 446 m_parentGroup.SendPartFullUpdate( remoteClient, this );
451 } 447 }
@@ -461,6 +457,11 @@ namespace OpenSim.Region.Environment.Scenes
461 SendFullUpdateToClient(remoteClient, lPos); 457 SendFullUpdateToClient(remoteClient, lPos);
462 } 458 }
463 459
460 /// <summary>
461 ///
462 /// </summary>
463 /// <param name="remoteClient"></param>
464 /// <param name="lPos"></param>
464 public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos) 465 public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos)
465 { 466 {
466 LLQuaternion lRot; 467 LLQuaternion lRot;
@@ -478,20 +479,39 @@ namespace OpenSim.Region.Environment.Scenes
478 List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars(); 479 List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars();
479 for (int i = 0; i < avatars.Count; i++) 480 for (int i = 0; i < avatars.Count; i++)
480 { 481 {
481 SendTerseUpdateToClient(avatars[i].ControllingClient); 482 m_parentGroup.SendPartTerseUpdate(avatars[i].ControllingClient, this);
482 } 483 }
483 } 484 }
484 485
485 /// <summary> 486 /// <summary>
486 /// 487 ///
487 /// </summary> 488 /// </summary>
489 /// <param name="remoteClient"></param>
490 public void SendTerseUpdate(IClientAPI remoteClient)
491 {
492 m_parentGroup.SendPartTerseUpdate(remoteClient, this);
493 }
494
495 /// <summary>
496 ///
497 /// </summary>
488 /// <param name="RemoteClient"></param> 498 /// <param name="RemoteClient"></param>
489 public void SendTerseUpdateToClient(IClientAPI remoteClient) 499 public void SendTerseUpdateToClient(IClientAPI remoteClient)
490 { 500 {
491 LLVector3 lPos; 501 LLVector3 lPos;
492 lPos = this.OffsetPosition; 502 lPos = this.OffsetPosition;
493 LLQuaternion mRot = this.RotationOffset; 503 LLQuaternion mRot = this.RotationOffset;
504 remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot);
505 }
494 506
507 /// <summary>
508 ///
509 /// </summary>
510 /// <param name="remoteClient"></param>
511 /// <param name="lPos"></param>
512 public void SendTerseUpdateToClient(IClientAPI remoteClient, LLVector3 lPos)
513 {
514 LLQuaternion mRot = this.RotationOffset;
495 remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot); 515 remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot);
496 } 516 }
497 #endregion 517 #endregion
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs
index fa0fc33..5f2634d 100644
--- a/OpenSim/Region/Environment/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs
@@ -11,7 +11,7 @@ namespace OpenSim.Region.Environment.Scenes
11 protected Scene m_scene; 11 protected Scene m_scene;
12 12
13 public LLUUID m_uuid; 13 public LLUUID m_uuid;
14 public LLUUID UUID 14 public virtual LLUUID UUID
15 { 15 {
16 get 16 get
17 { 17 {
@@ -61,7 +61,7 @@ namespace OpenSim.Region.Environment.Scenes
61 } 61 }
62 62
63 protected uint m_localId; 63 protected uint m_localId;
64 public uint LocalId 64 public virtual uint LocalId
65 { 65 {
66 get { return m_localId; } 66 get { return m_localId; }
67 set { m_localId = value; } 67 set { m_localId = value; }