aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorMelanie2009-11-23 04:24:58 +0000
committerMelanie2009-11-23 04:24:58 +0000
commitdf121a7cd065cc067818f6a39a44ddaaab647fec (patch)
tree5cc0e157ff3aefad066c07a1ebea2ae4b1ebdbe4 /OpenSim/Region/Framework/Scenes/ScenePresence.cs
parentMerge branch 'master' into careminster (diff)
parent* Adds a modicum of additional checking to the Inventory Service (MySQL only) (diff)
downloadopensim-SC-df121a7cd065cc067818f6a39a44ddaaab647fec.zip
opensim-SC-df121a7cd065cc067818f6a39a44ddaaab647fec.tar.gz
opensim-SC-df121a7cd065cc067818f6a39a44ddaaab647fec.tar.bz2
opensim-SC-df121a7cd065cc067818f6a39a44ddaaab647fec.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs25
1 files changed, 15 insertions, 10 deletions
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 {