aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-11-22 19:26:00 -0500
committerTeravus Ovares (Dan Olivares)2009-11-22 19:26:00 -0500
commitc155099faf9db4a8dd438be2ddd8a2272b85477a (patch)
tree283cc83f04aed73202972b1c5904c1a52839d64b /OpenSim
parent* Switched over 15 more packet types from the 5000 line switch to the Packet ... (diff)
downloadopensim-SC-c155099faf9db4a8dd438be2ddd8a2272b85477a.zip
opensim-SC-c155099faf9db4a8dd438be2ddd8a2272b85477a.tar.gz
opensim-SC-c155099faf9db4a8dd438be2ddd8a2272b85477a.tar.bz2
opensim-SC-c155099faf9db4a8dd438be2ddd8a2272b85477a.tar.xz
* The client prevents the avatar from landing if the avatar is going above an unknown certain speed, so, add a speed check on the server.
* This addresses the 'hump the prim' animation playing while you're moving forward full speed and pressing page down over a prim to land.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 0d1133f..d23d303 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -152,6 +152,8 @@ namespace OpenSim.Region.Framework.Scenes
152 152
153 private Quaternion m_bodyRot= Quaternion.Identity; 153 private Quaternion m_bodyRot= Quaternion.Identity;
154 154
155 private const int LAND_VELOCITYMAG_MAX = 12;
156
155 public bool IsRestrictedToRegion; 157 public bool IsRestrictedToRegion;
156 158
157 public string JID = String.Empty; 159 public string JID = String.Empty;
@@ -978,8 +980,8 @@ namespace OpenSim.Region.Framework.Scenes
978 public void StopFlying() 980 public void StopFlying()
979 { 981 {
980 // It turns out to get the agent to stop flying, you have to feed it stop flying velocities 982 // It turns out to get the agent to stop flying, you have to feed it stop flying velocities
981 // and send a full object update. 983 // There's no explicit message to send the client to tell it to stop flying.. it relies on the
982 // There's no message to send the client to tell it to stop flying 984 // velocity, collision plane and avatar height
983 985
984 // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air 986 // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air
985 // when the avatar stands up 987 // when the avatar stands up
@@ -993,8 +995,6 @@ namespace OpenSim.Region.Framework.Scenes
993 AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f)); 995 AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f));
994 } 996 }
995 997
996 Animator.TrySetMovementAnimation("LAND");
997 //SendFullUpdateToAllClients();
998 ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, 998 ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
999 AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); 999 AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient)));
1000 } 1000 }
@@ -1431,6 +1431,8 @@ namespace OpenSim.Region.Framework.Scenes
1431 // Only do this if we're flying 1431 // Only do this if we're flying
1432 if (m_physicsActor != null && m_physicsActor.Flying && !m_forceFly) 1432 if (m_physicsActor != null && m_physicsActor.Flying && !m_forceFly)
1433 { 1433 {
1434 // Landing detection code
1435
1434 // Are the landing controls requirements filled? 1436 // Are the landing controls requirements filled?
1435 bool controlland = (((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || 1437 bool controlland = (((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) ||
1436 ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0)); 1438 ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0));
@@ -1440,7 +1442,10 @@ namespace OpenSim.Region.Framework.Scenes
1440 1442
1441 if (m_physicsActor.Flying && colliding && controlland) 1443 if (m_physicsActor.Flying && colliding && controlland)
1442 { 1444 {
1443 StopFlying(); 1445 // nesting this check because LengthSquared() is expensive and we don't
1446 // want to do it every step when flying.
1447 if ((Velocity.LengthSquared() <= LAND_VELOCITYMAG_MAX))
1448 StopFlying();
1444 } 1449 }
1445 } 1450 }
1446 1451