aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2012-03-08 19:32:21 -0800
committerDiva Canto2012-03-08 19:32:21 -0800
commitf545d669de7b43092445185392e33bccabe24927 (patch)
tree6dc0c91472e4794e61ded1f0634e734b96f0255d
parentMore on the freeze on HG inventory transfers: spawn a threadlet on the funct... (diff)
parentSimplify minimap coarse location code by just reference SP.AbsolutePosition (diff)
downloadopensim-SC_OLD-f545d669de7b43092445185392e33bccabe24927.zip
opensim-SC_OLD-f545d669de7b43092445185392e33bccabe24927.tar.gz
opensim-SC_OLD-f545d669de7b43092445185392e33bccabe24927.tar.bz2
opensim-SC_OLD-f545d669de7b43092445185392e33bccabe24927.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs24
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs51
-rw-r--r--OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs25
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs24
4 files changed, 36 insertions, 88 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 66fb493..bc3400a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -215,27 +215,9 @@ namespace OpenSim.Region.Framework.Scenes
215 if (sp.IsChildAgent) 215 if (sp.IsChildAgent)
216 continue; 216 continue;
217 217
218 if (sp.ParentID != 0) 218 coarseLocations.Add(sp.AbsolutePosition);
219 { 219
220 // sitting avatar 220 avatarUUIDs.Add(sp.UUID);
221 SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID);
222 if (sop != null)
223 {
224 coarseLocations.Add(sop.AbsolutePosition + sp.OffsetPosition);
225 avatarUUIDs.Add(sp.UUID);
226 }
227 else
228 {
229 // we can't find the parent.. ! arg!
230 coarseLocations.Add(sp.AbsolutePosition);
231 avatarUUIDs.Add(sp.UUID);
232 }
233 }
234 else
235 {
236 coarseLocations.Add(sp.AbsolutePosition);
237 avatarUUIDs.Add(sp.UUID);
238 }
239 } 221 }
240 } 222 }
241 223
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index be56fe1..b84660a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Framework.Scenes
432 { 432 {
433 get 433 get
434 { 434 {
435 if (PhysicsActor != null && m_parentID == 0) 435 if (PhysicsActor != null)
436 { 436 {
437 m_pos = PhysicsActor.Position; 437 m_pos = PhysicsActor.Position;
438 438
@@ -477,7 +477,7 @@ namespace OpenSim.Region.Framework.Scenes
477 } 477 }
478 } 478 }
479 479
480 // Don't update while sitting 480 // Don't update while sitting. The PhysicsActor above is null whilst sitting.
481 if (ParentID == 0) 481 if (ParentID == 0)
482 { 482 {
483 m_pos = value; 483 m_pos = value;
@@ -504,6 +504,7 @@ namespace OpenSim.Region.Framework.Scenes
504 // There is no offset position when not seated 504 // There is no offset position when not seated
505 if (ParentID == 0) 505 if (ParentID == 0)
506 return; 506 return;
507
507 m_pos = value; 508 m_pos = value;
508 } 509 }
509 } 510 }
@@ -562,19 +563,18 @@ namespace OpenSim.Region.Framework.Scenes
562 563
563 public bool IsChildAgent { get; set; } 564 public bool IsChildAgent { get; set; }
564 565
565 public uint ParentID 566 /// <summary>
566 { 567 /// If the avatar is sitting, the local ID of the prim that it's sitting on. If not sitting then zero.
567 get { return m_parentID; } 568 /// </summary>
568 set { m_parentID = value; } 569 public uint ParentID { get; set; }
569 }
570 private uint m_parentID;
571 570
572 public SceneObjectPart ParentPart 571 /// <summary>
573 { 572 /// If the avatar is sitting, the prim that it's sitting on. If not sitting then null.
574 get { return m_parentPart; } 573 /// </summary>
575 set { m_parentPart = value; } 574 /// <remarks>
576 } 575 /// If you use this property then you must take a reference since another thread could set it to null.
577 private SceneObjectPart m_parentPart = null; 576 /// </remarks>
577 public SceneObjectPart ParentPart { get; set; }
578 578
579 public float Health 579 public float Health
580 { 580 {
@@ -2204,23 +2204,16 @@ namespace OpenSim.Region.Framework.Scenes
2204// "[SCENE PRESENCE]: Sitting {0} at position {1} ({2} + {3}) on part {4} {5} without sit target", 2204// "[SCENE PRESENCE]: Sitting {0} at position {1} ({2} + {3}) on part {4} {5} without sit target",
2205// Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId); 2205// Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId);
2206 } 2206 }
2207 }
2208 else
2209 {
2210 return;
2211 }
2212 2207
2213 ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); 2208 ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
2214 if (ParentPart == null) 2209 ParentID = m_requestedSitTargetID;
2215 return;
2216 2210
2217 ParentID = m_requestedSitTargetID; 2211 Velocity = Vector3.Zero;
2218 2212 RemoveFromPhysicalScene();
2219 Velocity = Vector3.Zero; 2213
2220 RemoveFromPhysicalScene(); 2214 Animator.TrySetMovementAnimation(sitAnimation);
2221 2215 SendAvatarDataToAllAgents();
2222 Animator.TrySetMovementAnimation(sitAnimation); 2216 }
2223 SendAvatarDataToAllAgents();
2224 } 2217 }
2225 2218
2226 public void HandleAgentSitOnGround() 2219 public void HandleAgentSitOnGround()
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
index 09da97a..eb633b3 100644
--- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
+++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
@@ -712,33 +712,16 @@ namespace OpenSim.Region.RegionCombinerModule
712 712
713 List<Vector3> CoarseLocations = new List<Vector3>(); 713 List<Vector3> CoarseLocations = new List<Vector3>();
714 List<UUID> AvatarUUIDs = new List<UUID>(); 714 List<UUID> AvatarUUIDs = new List<UUID>();
715
715 connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp) 716 connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp)
716 { 717 {
717 if (sp.UUID != presence.UUID) 718 if (sp.UUID != presence.UUID)
718 { 719 {
719 if (sp.ParentID != 0) 720 CoarseLocations.Add(sp.AbsolutePosition);
720 { 721 AvatarUUIDs.Add(sp.UUID);
721 // sitting avatar
722 SceneObjectPart sop = connectiondata.RegionScene.GetSceneObjectPart(sp.ParentID);
723 if (sop != null)
724 {
725 CoarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition);
726 AvatarUUIDs.Add(sp.UUID);
727 }
728 else
729 {
730 // we can't find the parent.. ! arg!
731 CoarseLocations.Add(sp.AbsolutePosition);
732 AvatarUUIDs.Add(sp.UUID);
733 }
734 }
735 else
736 {
737 CoarseLocations.Add(sp.AbsolutePosition);
738 AvatarUUIDs.Add(sp.UUID);
739 }
740 } 722 }
741 }); 723 });
724
742 DistributeCourseLocationUpdates(CoarseLocations, AvatarUUIDs, connectiondata, presence); 725 DistributeCourseLocationUpdates(CoarseLocations, AvatarUUIDs, connectiondata, presence);
743 } 726 }
744 727
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 786ae6e..bb374ed 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3825,7 +3825,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3825 List<String> nametable = new List<String>(); 3825 List<String> nametable = new List<String>();
3826 World.ForEachRootScenePresence(delegate(ScenePresence presence) 3826 World.ForEachRootScenePresence(delegate(ScenePresence presence)
3827 { 3827 {
3828 if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) 3828 SceneObjectPart sitPart = presence.ParentPart;
3829 if (sitPart != null && m_host.ParentGroup.HasChildPrim(sitPart.LocalId))
3829 nametable.Add(presence.ControllingClient.Name); 3830 nametable.Add(presence.ControllingClient.Name);
3830 }); 3831 });
3831 3832
@@ -4393,22 +4394,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4393 4394
4394 // Find pushee position 4395 // Find pushee position
4395 // Pushee Linked? 4396 // Pushee Linked?
4396 if (pusheeav.ParentID != 0) 4397 SceneObjectPart sitPart = pusheeav.ParentPart;
4397 { 4398 if (sitPart != null)
4398 SceneObjectPart parentobj = World.GetSceneObjectPart(pusheeav.ParentID); 4399 PusheePos = sitPart.AbsolutePosition;
4399 if (parentobj != null)
4400 {
4401 PusheePos = parentobj.AbsolutePosition;
4402 }
4403 else
4404 {
4405 PusheePos = pusheeav.AbsolutePosition;
4406 }
4407 }
4408 else 4400 else
4409 {
4410 PusheePos = pusheeav.AbsolutePosition; 4401 PusheePos = pusheeav.AbsolutePosition;
4411 }
4412 } 4402 }
4413 4403
4414 if (!pusheeIsAvatar) 4404 if (!pusheeIsAvatar)
@@ -5603,7 +5593,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5603 flags |= ScriptBaseClass.AGENT_IN_AIR; 5593 flags |= ScriptBaseClass.AGENT_IN_AIR;
5604 } 5594 }
5605 5595
5606 if (agent.ParentID != 0) 5596 if (agent.ParentPart != null)
5607 { 5597 {
5608 flags |= ScriptBaseClass.AGENT_ON_OBJECT; 5598 flags |= ScriptBaseClass.AGENT_ON_OBJECT;
5609 flags |= ScriptBaseClass.AGENT_SITTING; 5599 flags |= ScriptBaseClass.AGENT_SITTING;
@@ -7692,7 +7682,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7692 World.ForEachRootScenePresence(delegate(ScenePresence presence) 7682 World.ForEachRootScenePresence(delegate(ScenePresence presence)
7693 { 7683 {
7694 if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) 7684 if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
7695 avatarCount++; 7685 avatarCount++;
7696 }); 7686 });
7697 7687
7698 return m_host.ParentGroup.PrimCount + avatarCount; 7688 return m_host.ParentGroup.PrimCount + avatarCount;