aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2010-06-11 21:46:01 -0400
committerTeravus Ovares (Dan Olivares)2010-06-11 21:46:01 -0400
commit99f2a1c347f2c97007a467e76c1455c9a54b3c26 (patch)
treebd00b63b1586bd85b79d705594336ff921f1805d /OpenSim
parentMove "StopFlying()" into LLSpace. Try to reinstate the carefully crafted packet (diff)
downloadopensim-SC-99f2a1c347f2c97007a467e76c1455c9a54b3c26.zip
opensim-SC-99f2a1c347f2c97007a467e76c1455c9a54b3c26.tar.gz
opensim-SC-99f2a1c347f2c97007a467e76c1455c9a54b3c26.tar.bz2
opensim-SC-99f2a1c347f2c97007a467e76c1455c9a54b3c26.tar.xz
* Tweak the StopFlying() method in LLClientView to fabricate a suitable landing collision plane regardless of the actual physics situation. position.Z - AvatarHeight / 6f
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs57
1 files changed, 36 insertions, 21 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 85a3133..cdd22de 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -11846,38 +11846,53 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11846 11846
11847 public void StopFlying(ISceneEntity p) 11847 public void StopFlying(ISceneEntity p)
11848 { 11848 {
11849 ScenePresence presence = p as ScenePresence; 11849 if (p is ScenePresence)
11850 // It turns out to get the agent to stop flying, you have to feed it stop flying velocities 11850 {
11851 // There's no explicit message to send the client to tell it to stop flying.. it relies on the 11851 ScenePresence presence = p as ScenePresence;
11852 // velocity, collision plane and avatar height 11852 // It turns out to get the agent to stop flying, you have to feed it stop flying velocities
11853 // There's no explicit message to send the client to tell it to stop flying.. it relies on the
11854 // velocity, collision plane and avatar height
11853 11855
11854 // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air 11856 // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air
11855 // when the avatar stands up 11857 // when the avatar stands up
11856 11858
11857 Vector3 pos = presence.AbsolutePosition; 11859 Vector3 pos = presence.AbsolutePosition;
11858 11860
11859 if (presence.Appearance.AvatarHeight != 127.0f) 11861 if (presence.Appearance.AvatarHeight != 127.0f)
11860 pos += new Vector3(0f, 0f, (presence.Appearance.AvatarHeight / 6f)); 11862 pos += new Vector3(0f, 0f, (presence.Appearance.AvatarHeight/6f));
11861 else 11863 else
11862 pos += new Vector3(0f, 0f, (1.56f / 6f)); 11864 pos += new Vector3(0f, 0f, (1.56f/6f));
11865
11866 presence.AbsolutePosition = pos;
11867
11868 // attach a suitable collision plane regardless of the actual situation to force the LLClient to land.
11869 // Collision plane below the avatar's position a 6th of the avatar's height is suitable.
11870 // Mind you, that this method doesn't get called if the avatar's velocity magnitude is greater then a
11871 // certain amount.. because the LLClient wouldn't land in that situation anyway.
11872
11873 // why are we still testing for this really old height value default???
11874 if (presence.Appearance.AvatarHeight != 127.0f)
11875 presence.CollisionPlane = new Vector4(0, 0, 0, pos.Z - presence.Appearance.AvatarHeight/6f);
11876 else
11877 presence.CollisionPlane = new Vector4(0, 0, 0, pos.Z - (1.56f/6f));
11863 11878
11864 presence.AbsolutePosition = pos;
11865 11879
11866 ImprovedTerseObjectUpdatePacket.ObjectDataBlock block = 11880 ImprovedTerseObjectUpdatePacket.ObjectDataBlock block =
11867 CreateImprovedTerseBlock(p, false); 11881 CreateImprovedTerseBlock(p, false);
11868 11882
11869 const float TIME_DILATION = 1.0f; 11883 const float TIME_DILATION = 1.0f;
11870 ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); 11884 ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f);
11871 11885
11872 11886
11873 ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); 11887 ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
11874 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; 11888 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
11875 packet.RegionData.TimeDilation = timeDilation; 11889 packet.RegionData.TimeDilation = timeDilation;
11876 packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 11890 packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
11877 11891
11878 packet.ObjectData[0] = block; 11892 packet.ObjectData[0] = block;
11879 11893
11880 OutPacket(packet, ThrottleOutPacketType.Task, true); 11894 OutPacket(packet, ThrottleOutPacketType.Task, true);
11895 }
11881 11896
11882 //ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, 11897 //ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
11883 // AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); 11898 // AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient)));