aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs22
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs43
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs25
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs4
5 files changed, 72 insertions, 24 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 2230fba..30a95ce 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
39 /// Handle all animation duties for a scene presence 39 /// Handle all animation duties for a scene presence
40 /// </summary> 40 /// </summary>
41 public class ScenePresenceAnimator 41 public class ScenePresenceAnimator
42 { 42 {
43 public AnimationSet Animations 43 public AnimationSet Animations
44 { 44 {
45 get { return m_animations; } 45 get { return m_animations; }
@@ -53,19 +53,19 @@ namespace OpenSim.Region.Framework.Scenes.Animation
53 { 53 {
54 get { return m_movementAnimation; } 54 get { return m_movementAnimation; }
55 } 55 }
56 protected string m_movementAnimation = "DEFAULT"; 56 protected string m_movementAnimation = "DEFAULT";
57 57
58 private int m_animTickFall; 58 private int m_animTickFall;
59 private int m_animTickJump; 59 private int m_animTickJump;
60 60
61 /// <value> 61 /// <value>
62 /// The scene presence that this animator applies to 62 /// The scene presence that this animator applies to
63 /// </value> 63 /// </value>
64 protected ScenePresence m_scenePresence; 64 protected ScenePresence m_scenePresence;
65 65
66 public ScenePresenceAnimator(ScenePresence sp) 66 public ScenePresenceAnimator(ScenePresence sp)
67 { 67 {
68 m_scenePresence = sp; 68 m_scenePresence = sp;
69 } 69 }
70 70
71 public void AddAnimation(UUID animID, UUID objectID) 71 public void AddAnimation(UUID animID, UUID objectID)
@@ -110,11 +110,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
110 return; 110 return;
111 111
112 RemoveAnimation(animID); 112 RemoveAnimation(animID);
113 } 113 }
114 114
115 public void ResetAnimations() 115 public void ResetAnimations()
116 { 116 {
117 m_animations.Clear(); 117 m_animations.Clear();
118 } 118 }
119 119
120 /// <summary> 120 /// <summary>
@@ -131,7 +131,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
131 anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero)) 131 anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero))
132 { 132 {
133 // 16384 is CHANGED_ANIMATION 133 // 16384 is CHANGED_ANIMATION
134 m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { 16384 }); 134 m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { 16384 });
135 SendAnimPack(); 135 SendAnimPack();
136 } 136 }
137 } 137 }
@@ -305,7 +305,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
305 #endregion Ground Movement 305 #endregion Ground Movement
306 306
307 return m_movementAnimation; 307 return m_movementAnimation;
308 } 308 }
309 309
310 /// <summary> 310 /// <summary>
311 /// Update the movement animation of this avatar according to its current state 311 /// Update the movement animation of this avatar according to its current state
@@ -391,7 +391,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
391 m_scenePresence.Scene.AssetService.Store(Animasset); 391 m_scenePresence.Scene.AssetService.Store(Animasset);
392 AddAnimation(Animasset.FullID, m_scenePresence.UUID); 392 AddAnimation(Animasset.FullID, m_scenePresence.UUID);
393 return anim; 393 return anim;
394 } 394 }
395 395
396 /// <summary> 396 /// <summary>
397 /// 397 ///
@@ -443,6 +443,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation
443 m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs); 443 m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs);
444 444
445 SendAnimPack(animIDs, sequenceNums, objectIDs); 445 SendAnimPack(animIDs, sequenceNums, objectIDs);
446 } 446 }
447 } 447 }
448} \ No newline at end of file 448} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 5058457..4ffa1a2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3470,6 +3470,49 @@ namespace OpenSim.Region.Framework.Scenes
3470 agent.startpos.Y = crossedBorder.BorderLine.Z - 1; 3470 agent.startpos.Y = crossedBorder.BorderLine.Z - 1;
3471 } 3471 }
3472 3472
3473 //Mitigate http://opensimulator.org/mantis/view.php?id=3522
3474 // Check if start position is outside of region
3475 // If it is, check the Z start position also.. if not, leave it alone.
3476 if (BordersLocked)
3477 {
3478 lock (EastBorders)
3479 {
3480 if (agent.startpos.X > EastBorders[0].BorderLine.Z)
3481 {
3482 m_log.Warn("FIX AGENT POSITION");
3483 agent.startpos.X = EastBorders[0].BorderLine.Z * 0.5f;
3484 if (agent.startpos.Z > 720)
3485 agent.startpos.Z = 720;
3486 }
3487 }
3488 lock (NorthBorders)
3489 {
3490 if (agent.startpos.Y > NorthBorders[0].BorderLine.Z)
3491 {
3492 m_log.Warn("FIX Agent POSITION");
3493 agent.startpos.Y = NorthBorders[0].BorderLine.Z * 0.5f;
3494 if (agent.startpos.Z > 720)
3495 agent.startpos.Z = 720;
3496 }
3497 }
3498 }
3499 else
3500 {
3501 if (agent.startpos.X > EastBorders[0].BorderLine.Z)
3502 {
3503 m_log.Warn("FIX AGENT POSITION");
3504 agent.startpos.X = EastBorders[0].BorderLine.Z * 0.5f;
3505 if (agent.startpos.Z > 720)
3506 agent.startpos.Z = 720;
3507 }
3508 if (agent.startpos.Y > NorthBorders[0].BorderLine.Z)
3509 {
3510 m_log.Warn("FIX Agent POSITION");
3511 agent.startpos.Y = NorthBorders[0].BorderLine.Z * 0.5f;
3512 if (agent.startpos.Z > 720)
3513 agent.startpos.Z = 720;
3514 }
3515 }
3473 // Honor parcel landing type and position. 3516 // Honor parcel landing type and position.
3474 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); 3517 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
3475 if (land != null) 3518 if (land != null)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 10b7d94..cdec135 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2430,7 +2430,7 @@ namespace OpenSim.Region.Framework.Scenes
2430 m_updateFlag = 0; //Same here 2430 m_updateFlag = 0; //Same here
2431 } 2431 }
2432 } 2432 }
2433 ClearUpdateSchedule(); 2433 m_updateFlag = 0;
2434 } 2434 }
2435 2435
2436 /// <summary> 2436 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 0437a6d..ce6110a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -151,6 +151,8 @@ namespace OpenSim.Region.Framework.Scenes
151 151
152 private Quaternion m_bodyRot= Quaternion.Identity; 152 private Quaternion m_bodyRot= Quaternion.Identity;
153 153
154 private const int LAND_VELOCITYMAG_MAX = 12;
155
154 public bool IsRestrictedToRegion; 156 public bool IsRestrictedToRegion;
155 157
156 public string JID = String.Empty; 158 public string JID = String.Empty;
@@ -247,7 +249,7 @@ namespace OpenSim.Region.Framework.Scenes
247 /// <value> 249 /// <value>
248 /// Script engines present in the scene 250 /// Script engines present in the scene
249 /// </value> 251 /// </value>
250 private IScriptModule[] m_scriptEngines; 252 private IScriptModule[] m_scriptEngines;
251 253
252 #region Properties 254 #region Properties
253 255
@@ -674,7 +676,7 @@ namespace OpenSim.Region.Framework.Scenes
674 AvatarWearable[] wearables) 676 AvatarWearable[] wearables)
675 : this(client, world, reginfo) 677 : this(client, world, reginfo)
676 { 678 {
677 m_appearance = new AvatarAppearance(m_uuid, wearables, visualParams); 679 m_appearance = new AvatarAppearance(m_uuid, wearables, visualParams);
678 } 680 }
679 681
680 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance) 682 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance)
@@ -1000,8 +1002,8 @@ namespace OpenSim.Region.Framework.Scenes
1000 public void StopFlying() 1002 public void StopFlying()
1001 { 1003 {
1002 // It turns out to get the agent to stop flying, you have to feed it stop flying velocities 1004 // It turns out to get the agent to stop flying, you have to feed it stop flying velocities
1003 // and send a full object update. 1005 // There's no explicit message to send the client to tell it to stop flying.. it relies on the
1004 // There's no message to send the client to tell it to stop flying 1006 // velocity, collision plane and avatar height
1005 1007
1006 // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air 1008 // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air
1007 // when the avatar stands up 1009 // when the avatar stands up
@@ -1015,8 +1017,6 @@ namespace OpenSim.Region.Framework.Scenes
1015 AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f)); 1017 AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f));
1016 } 1018 }
1017 1019
1018 Animator.TrySetMovementAnimation("LAND");
1019 //SendFullUpdateToAllClients();
1020 ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, 1020 ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
1021 AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); 1021 AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient)));
1022 } 1022 }
@@ -1468,6 +1468,8 @@ namespace OpenSim.Region.Framework.Scenes
1468 // Only do this if we're flying 1468 // Only do this if we're flying
1469 if (m_physicsActor != null && m_physicsActor.Flying && !m_forceFly) 1469 if (m_physicsActor != null && m_physicsActor.Flying && !m_forceFly)
1470 { 1470 {
1471 // Landing detection code
1472
1471 // Are the landing controls requirements filled? 1473 // Are the landing controls requirements filled?
1472 bool controlland = (((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || 1474 bool controlland = (((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) ||
1473 ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0)); 1475 ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0));
@@ -1477,7 +1479,10 @@ namespace OpenSim.Region.Framework.Scenes
1477 1479
1478 if (m_physicsActor.Flying && colliding && controlland) 1480 if (m_physicsActor.Flying && colliding && controlland)
1479 { 1481 {
1480 StopFlying(); 1482 // nesting this check because LengthSquared() is expensive and we don't
1483 // want to do it every step when flying.
1484 if ((Velocity.LengthSquared() <= LAND_VELOCITYMAG_MAX))
1485 StopFlying();
1481 } 1486 }
1482 } 1487 }
1483 1488
@@ -3097,7 +3102,7 @@ namespace OpenSim.Region.Framework.Scenes
3097 3102
3098 public ScenePresence() 3103 public ScenePresence()
3099 { 3104 {
3100 m_sendCourseLocationsMethod = SendCoarseLocationsDefault; 3105 m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
3101 CreateSceneViewer(); 3106 CreateSceneViewer();
3102 m_animator = new ScenePresenceAnimator(this); 3107 m_animator = new ScenePresenceAnimator(this);
3103 } 3108 }
@@ -3185,8 +3190,8 @@ namespace OpenSim.Region.Framework.Scenes
3185 } 3190 }
3186 } 3191 }
3187 } 3192 }
3188 } 3193 }
3189 } 3194 }
3190 3195
3191 public bool CrossAttachmentsIntoNewRegion(ulong regionHandle, bool silent) 3196 public bool CrossAttachmentsIntoNewRegion(ulong regionHandle, bool silent)
3192 { 3197 {
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
index b68a044..a36c4db 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
65 m_uuidGatherer.GatherAssetUuids(corruptAssetUuid, AssetType.Object, foundAssetUuids); 65 m_uuidGatherer.GatherAssetUuids(corruptAssetUuid, AssetType.Object, foundAssetUuids);
66 66
67 // We count the uuid as gathered even if the asset itself is corrupt. 67 // We count the uuid as gathered even if the asset itself is corrupt.
68 Assert.That(foundAssetUuids.Count, Is.EqualTo(1)); 68 Assert.That(foundAssetUuids.Count, Is.EqualTo(1));
69 } 69 }
70 70
71 /// <summary> 71 /// <summary>
@@ -76,7 +76,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
76 { 76 {
77 TestHelper.InMethod(); 77 TestHelper.InMethod();
78 78
79 UUID missingAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); 79 UUID missingAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
80 IDictionary<UUID, int> foundAssetUuids = new Dictionary<UUID, int>(); 80 IDictionary<UUID, int> foundAssetUuids = new Dictionary<UUID, int>();
81 81
82 m_uuidGatherer.GatherAssetUuids(missingAssetUuid, AssetType.Object, foundAssetUuids); 82 m_uuidGatherer.GatherAssetUuids(missingAssetUuid, AssetType.Object, foundAssetUuids);