aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorMelanie2011-12-18 10:49:45 +0000
committerMelanie2011-12-18 10:49:45 +0000
commit759f1d2dbe0617786068195dfd695e0dfc2cc265 (patch)
tree8e6dcb6ba183abb16b4527376c5fd280693977bb /OpenSim/Region/Framework/Scenes/ScenePresence.cs
parentMake raycast more efficient by checking exclusion flags earlier (diff)
parentProvide user feedback on execution of "backup" region console command (diff)
downloadopensim-SC_OLD-759f1d2dbe0617786068195dfd695e0dfc2cc265.zip
opensim-SC_OLD-759f1d2dbe0617786068195dfd695e0dfc2cc265.tar.gz
opensim-SC_OLD-759f1d2dbe0617786068195dfd695e0dfc2cc265.tar.bz2
opensim-SC_OLD-759f1d2dbe0617786068195dfd695e0dfc2cc265.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs91
1 files changed, 43 insertions, 48 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 49acc02..0eecf77 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -289,16 +289,10 @@ namespace OpenSim.Region.Framework.Scenes
289 289
290 #region Properties 290 #region Properties
291 291
292 protected PhysicsActor m_physicsActor;
293
294 /// <summary> 292 /// <summary>
295 /// Physical scene representation of this Avatar. 293 /// Physical scene representation of this Avatar.
296 /// </summary> 294 /// </summary>
297 public PhysicsActor PhysicsActor 295 public PhysicsActor PhysicsActor { get; private set; }
298 {
299 set { m_physicsActor = value; }
300 get { return m_physicsActor; }
301 }
302 296
303 private byte m_movementflag; 297 private byte m_movementflag;
304 298
@@ -512,9 +506,9 @@ namespace OpenSim.Region.Framework.Scenes
512 { 506 {
513 m_pos = PhysicsActor.Position; 507 m_pos = PhysicsActor.Position;
514 508
515// m_log.DebugFormat( 509 //m_log.DebugFormat(
516// "[SCENE PRESENCE]: Set position {0} for {1} in {2} via getting AbsolutePosition!", 510 // "[SCENE PRESENCE]: Set position {0} for {1} in {2} via getting AbsolutePosition!",
517// m_pos, Name, Scene.RegionInfo.RegionName); 511 // m_pos, Name, Scene.RegionInfo.RegionName);
518 } 512 }
519 else 513 else
520 { 514 {
@@ -544,7 +538,6 @@ namespace OpenSim.Region.Framework.Scenes
544 } 538 }
545 } 539 }
546 } 540 }
547
548 return m_pos; 541 return m_pos;
549 } 542 }
550 set 543 set
@@ -568,9 +561,9 @@ namespace OpenSim.Region.Framework.Scenes
568 ParentPosition = Vector3.Zero; 561 ParentPosition = Vector3.Zero;
569 } 562 }
570 563
571// m_log.DebugFormat( 564 //m_log.DebugFormat(
572// "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", 565 // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}",
573// Scene.RegionInfo.RegionName, Name, m_pos); 566 // Scene.RegionInfo.RegionName, Name, m_pos);
574 } 567 }
575 } 568 }
576 569
@@ -806,7 +799,6 @@ namespace OpenSim.Region.Framework.Scenes
806 public void RegisterToEvents() 799 public void RegisterToEvents()
807 { 800 {
808 ControllingClient.OnCompleteMovementToRegion += CompleteMovement; 801 ControllingClient.OnCompleteMovementToRegion += CompleteMovement;
809 //ControllingClient.OnCompleteMovementToRegion += SendInitialData;
810 ControllingClient.OnAgentUpdate += HandleAgentUpdate; 802 ControllingClient.OnAgentUpdate += HandleAgentUpdate;
811 ControllingClient.OnAgentRequestSit += HandleAgentRequestSit; 803 ControllingClient.OnAgentRequestSit += HandleAgentRequestSit;
812 ControllingClient.OnAgentSit += HandleAgentSit; 804 ControllingClient.OnAgentSit += HandleAgentSit;
@@ -854,11 +846,6 @@ namespace OpenSim.Region.Framework.Scenes
854 846
855 #endregion 847 #endregion
856 848
857 public uint GenerateClientFlags(UUID ObjectID)
858 {
859 return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID);
860 }
861
862 #region Status Methods 849 #region Status Methods
863 850
864 /// <summary> 851 /// <summary>
@@ -1049,18 +1036,19 @@ namespace OpenSim.Region.Framework.Scenes
1049 { 1036 {
1050 if (PhysicsActor != null) 1037 if (PhysicsActor != null)
1051 { 1038 {
1052 try 1039// PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients;
1053 { 1040 PhysicsActor.OnOutOfBounds -= OutOfBoundsCall;
1054 PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; 1041 m_scene.PhysicsScene.RemoveAvatar(PhysicsActor);
1055 PhysicsActor.OnOutOfBounds -= OutOfBoundsCall; 1042 PhysicsActor.UnSubscribeEvents();
1056 m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); 1043 PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
1057 PhysicsActor.UnSubscribeEvents(); 1044 PhysicsActor = null;
1058 PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
1059 PhysicsActor = null;
1060 }
1061 catch
1062 { }
1063 } 1045 }
1046// else
1047// {
1048// m_log.ErrorFormat(
1049// "[SCENE PRESENCE]: Attempt to remove physics actor for {0} on {1} but this scene presence has no physics actor",
1050// Name, Scene.RegionInfo.RegionName);
1051// }
1064 } 1052 }
1065 1053
1066 /// <summary> 1054 /// <summary>
@@ -1173,13 +1161,11 @@ namespace OpenSim.Region.Framework.Scenes
1173 /// <summary> 1161 /// <summary>
1174 /// Sets avatar height in the physics plugin 1162 /// Sets avatar height in the physics plugin
1175 /// </summary> 1163 /// </summary>
1164 /// <param name="height">New height of avatar</param>
1176 public void SetHeight(float height) 1165 public void SetHeight(float height)
1177 { 1166 {
1178 if (PhysicsActor != null && !IsChildAgent) 1167 if (PhysicsActor != null && !IsChildAgent)
1179 { 1168 PhysicsActor.Size = new Vector3(0.45f, 0.6f, height);
1180 Vector3 SetSize = new Vector3(0.45f, 0.6f, height);
1181 PhysicsActor.Size = SetSize;
1182 }
1183 } 1169 }
1184 1170
1185 /// <summary> 1171 /// <summary>
@@ -1945,7 +1931,7 @@ namespace OpenSim.Region.Framework.Scenes
1945// m_log.DebugFormat("[SCENE PRESENCE]: {0} {1}", SitTargetisSet, SitTargetUnOccupied); 1931// m_log.DebugFormat("[SCENE PRESENCE]: {0} {1}", SitTargetisSet, SitTargetUnOccupied);
1946 1932
1947 if (PhysicsActor != null) 1933 if (PhysicsActor != null)
1948 m_sitAvatarHeight = m_physicsActor.Size.Z; 1934 m_sitAvatarHeight = PhysicsActor.Size.Z;
1949 1935
1950 bool canSit = false; 1936 bool canSit = false;
1951 pos = part.AbsolutePosition + offset; 1937 pos = part.AbsolutePosition + offset;
@@ -2592,7 +2578,10 @@ namespace OpenSim.Region.Framework.Scenes
2592 // only send update from root agents to other clients; children are only "listening posts" 2578 // only send update from root agents to other clients; children are only "listening posts"
2593 if (IsChildAgent) 2579 if (IsChildAgent)
2594 { 2580 {
2595 m_log.Warn("[SCENE PRESENCE]: Attempt to send avatar data from a child agent"); 2581 m_log.WarnFormat(
2582 "[SCENE PRESENCE]: Attempt to send avatar data from a child agent for {0} in {1}",
2583 Name, Scene.RegionInfo.RegionName);
2584
2596 return; 2585 return;
2597 } 2586 }
2598 2587
@@ -2650,7 +2639,10 @@ namespace OpenSim.Region.Framework.Scenes
2650 // only send update from root agents to other clients; children are only "listening posts" 2639 // only send update from root agents to other clients; children are only "listening posts"
2651 if (IsChildAgent) 2640 if (IsChildAgent)
2652 { 2641 {
2653 m_log.Warn("[SCENE PRESENCE]: Attempt to send avatar data from a child agent"); 2642 m_log.WarnFormat(
2643 "[SCENE PRESENCE]: Attempt to send avatar data from a child agent for {0} in {1}",
2644 Name, Scene.RegionInfo.RegionName);
2645
2654 return; 2646 return;
2655 } 2647 }
2656 2648
@@ -3032,6 +3024,7 @@ namespace OpenSim.Region.Framework.Scenes
3032 CopyFrom(cAgentData); 3024 CopyFrom(cAgentData);
3033 } 3025 }
3034 3026
3027 private static Vector3 marker = new Vector3(-1f, -1f, -1f);
3035 /// <summary> 3028 /// <summary>
3036 /// This updates important decision making data about a child agent 3029 /// This updates important decision making data about a child agent
3037 /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region 3030 /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region
@@ -3052,8 +3045,8 @@ namespace OpenSim.Region.Framework.Scenes
3052 // region's draw distance. 3045 // region's draw distance.
3053 // DrawDistance = cAgentData.Far; 3046 // DrawDistance = cAgentData.Far;
3054 DrawDistance = Scene.DefaultDrawDistance; 3047 DrawDistance = Scene.DefaultDrawDistance;
3055 3048
3056 if (cAgentData.Position != new Vector3(-1f, -1f, -1f)) // UGH!! 3049 if (cAgentData.Position != marker) // UGH!!
3057 m_pos = cAgentData.Position + offset; 3050 m_pos = cAgentData.Position + offset;
3058 3051
3059 if (Vector3.Distance(AbsolutePosition, posLastSignificantMove) >= Scene.ChildReprioritizationDistance) 3052 if (Vector3.Distance(AbsolutePosition, posLastSignificantMove) >= Scene.ChildReprioritizationDistance)
@@ -3064,8 +3057,6 @@ namespace OpenSim.Region.Framework.Scenes
3064 3057
3065 CameraPosition = cAgentData.Center + offset; 3058 CameraPosition = cAgentData.Center + offset;
3066 3059
3067 //SetHeight(cAgentData.AVHeight);
3068
3069 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) 3060 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0)
3070 ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); 3061 ControllingClient.SetChildAgentThrottle(cAgentData.Throttles);
3071 3062
@@ -3274,6 +3265,13 @@ namespace OpenSim.Region.Framework.Scenes
3274// "[SCENE PRESENCE]: Adding physics actor for {0}, ifFlying = {1} in {2}", 3265// "[SCENE PRESENCE]: Adding physics actor for {0}, ifFlying = {1} in {2}",
3275// Name, isFlying, Scene.RegionInfo.RegionName); 3266// Name, isFlying, Scene.RegionInfo.RegionName);
3276 3267
3268 if (PhysicsActor != null)
3269 {
3270 m_log.ErrorFormat(
3271 "[SCENE PRESENCE]: Adding physics actor for {0} to {1} but this scene presence already has a physics actor",
3272 Name, Scene.RegionInfo.RegionName);
3273 }
3274
3277 if (Appearance.AvatarHeight == 0) 3275 if (Appearance.AvatarHeight == 0)
3278 Appearance.SetHeight(); 3276 Appearance.SetHeight();
3279 3277
@@ -3281,18 +3279,15 @@ namespace OpenSim.Region.Framework.Scenes
3281 3279
3282 Vector3 pVec = AbsolutePosition; 3280 Vector3 pVec = AbsolutePosition;
3283 3281
3284 // Old bug where the height was in centimeters instead of meters 3282 PhysicsActor = scene.AddAvatar(
3285 PhysicsActor = scene.AddAvatar(LocalId, Firstname + "." + Lastname, pVec, 3283 LocalId, Firstname + "." + Lastname, pVec,
3286 new Vector3(0f, 0f, Appearance.AvatarHeight), isFlying); 3284 new Vector3(0f, 0f, Appearance.AvatarHeight), isFlying);
3287 3285
3288 scene.AddPhysicsActorTaint(PhysicsActor);
3289 //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; 3286 //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
3290 PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; 3287 PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
3291 PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong 3288 PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong
3292 PhysicsActor.SubscribeEvents(500); 3289 PhysicsActor.SubscribeEvents(500);
3293 PhysicsActor.LocalID = LocalId; 3290 PhysicsActor.LocalID = LocalId;
3294
3295 SetHeight(Appearance.AvatarHeight);
3296 } 3291 }
3297 3292
3298 private void OutOfBoundsCall(Vector3 pos) 3293 private void OutOfBoundsCall(Vector3 pos)