diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index b2df0bd..0f9368c 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -11873,5 +11873,45 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11873 | dialog.Buttons = buttons; | 11873 | dialog.Buttons = buttons; |
11874 | OutPacket(dialog, ThrottleOutPacketType.Task); | 11874 | OutPacket(dialog, ThrottleOutPacketType.Task); |
11875 | } | 11875 | } |
11876 | |||
11877 | public void StopFlying(ISceneEntity p) | ||
11878 | { | ||
11879 | ScenePresence presence = p as ScenePresence; | ||
11880 | // It turns out to get the agent to stop flying, you have to feed it stop flying velocities | ||
11881 | // There's no explicit message to send the client to tell it to stop flying.. it relies on the | ||
11882 | // velocity, collision plane and avatar height | ||
11883 | |||
11884 | // 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 | ||
11886 | |||
11887 | Vector3 pos = presence.AbsolutePosition; | ||
11888 | |||
11889 | if (presence.Appearance.AvatarHeight != 127.0f) | ||
11890 | pos += new Vector3(0f, 0f, (presence.Appearance.AvatarHeight / 6f)); | ||
11891 | else | ||
11892 | pos += new Vector3(0f, 0f, (1.56f / 6f)); | ||
11893 | |||
11894 | presence.AbsolutePosition = pos; | ||
11895 | |||
11896 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock block = | ||
11897 | CreateImprovedTerseBlock(p, false); | ||
11898 | |||
11899 | const float TIME_DILATION = 1.0f; | ||
11900 | ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); | ||
11901 | |||
11902 | |||
11903 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | ||
11904 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | ||
11905 | packet.RegionData.TimeDilation = timeDilation; | ||
11906 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | ||
11907 | |||
11908 | packet.ObjectData[0] = block; | ||
11909 | |||
11910 | OutPacket(packet, ThrottleOutPacketType.Task, true); | ||
11911 | |||
11912 | //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))); | ||
11914 | |||
11915 | } | ||
11876 | } | 11916 | } |
11877 | } | 11917 | } |