diff options
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 57 |
1 files changed, 36 insertions, 21 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 0f9368c..f071841 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -11876,38 +11876,53 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11876 | 11876 | ||
11877 | public void StopFlying(ISceneEntity p) | 11877 | public void StopFlying(ISceneEntity p) |
11878 | { | 11878 | { |
11879 | ScenePresence presence = p as ScenePresence; | 11879 | if (p is ScenePresence) |
11880 | // It turns out to get the agent to stop flying, you have to feed it stop flying velocities | 11880 | { |
11881 | // There's no explicit message to send the client to tell it to stop flying.. it relies on the | 11881 | ScenePresence presence = p as ScenePresence; |
11882 | // velocity, collision plane and avatar height | 11882 | // It turns out to get the agent to stop flying, you have to feed it stop flying velocities |
11883 | // There's no explicit message to send the client to tell it to stop flying.. it relies on the | ||
11884 | // velocity, collision plane and avatar height | ||
11883 | 11885 | ||
11884 | // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air | 11886 | // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air |
11885 | // when the avatar stands up | 11887 | // when the avatar stands up |
11886 | 11888 | ||
11887 | Vector3 pos = presence.AbsolutePosition; | 11889 | Vector3 pos = presence.AbsolutePosition; |
11888 | 11890 | ||
11889 | if (presence.Appearance.AvatarHeight != 127.0f) | 11891 | if (presence.Appearance.AvatarHeight != 127.0f) |
11890 | pos += new Vector3(0f, 0f, (presence.Appearance.AvatarHeight / 6f)); | 11892 | pos += new Vector3(0f, 0f, (presence.Appearance.AvatarHeight/6f)); |
11891 | else | 11893 | else |
11892 | pos += new Vector3(0f, 0f, (1.56f / 6f)); | 11894 | pos += new Vector3(0f, 0f, (1.56f/6f)); |
11895 | |||
11896 | presence.AbsolutePosition = pos; | ||
11897 | |||
11898 | // attach a suitable collision plane regardless of the actual situation to force the LLClient to land. | ||
11899 | // Collision plane below the avatar's position a 6th of the avatar's height is suitable. | ||
11900 | // Mind you, that this method doesn't get called if the avatar's velocity magnitude is greater then a | ||
11901 | // certain amount.. because the LLClient wouldn't land in that situation anyway. | ||
11902 | |||
11903 | // why are we still testing for this really old height value default??? | ||
11904 | if (presence.Appearance.AvatarHeight != 127.0f) | ||
11905 | presence.CollisionPlane = new Vector4(0, 0, 0, pos.Z - presence.Appearance.AvatarHeight/6f); | ||
11906 | else | ||
11907 | presence.CollisionPlane = new Vector4(0, 0, 0, pos.Z - (1.56f/6f)); | ||
11893 | 11908 | ||
11894 | presence.AbsolutePosition = pos; | ||
11895 | 11909 | ||
11896 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock block = | 11910 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock block = |
11897 | CreateImprovedTerseBlock(p, false); | 11911 | CreateImprovedTerseBlock(p, false); |
11898 | 11912 | ||
11899 | const float TIME_DILATION = 1.0f; | 11913 | const float TIME_DILATION = 1.0f; |
11900 | ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); | 11914 | ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); |
11901 | 11915 | ||
11902 | 11916 | ||
11903 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | 11917 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); |
11904 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 11918 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
11905 | packet.RegionData.TimeDilation = timeDilation; | 11919 | packet.RegionData.TimeDilation = timeDilation; |
11906 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | 11920 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; |
11907 | 11921 | ||
11908 | packet.ObjectData[0] = block; | 11922 | packet.ObjectData[0] = block; |
11909 | 11923 | ||
11910 | OutPacket(packet, ThrottleOutPacketType.Task, true); | 11924 | OutPacket(packet, ThrottleOutPacketType.Task, true); |
11925 | } | ||
11911 | 11926 | ||
11912 | //ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, | 11927 | //ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, |
11913 | // AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); | 11928 | // AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); |