diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index b2df0bd..f071841 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -11873,5 +11873,60 @@ 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 | if (p is ScenePresence) | ||
11880 | { | ||
11881 | ScenePresence presence = p as ScenePresence; | ||
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 | ||
11885 | |||
11886 | // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air | ||
11887 | // when the avatar stands up | ||
11888 | |||
11889 | Vector3 pos = presence.AbsolutePosition; | ||
11890 | |||
11891 | if (presence.Appearance.AvatarHeight != 127.0f) | ||
11892 | pos += new Vector3(0f, 0f, (presence.Appearance.AvatarHeight/6f)); | ||
11893 | else | ||
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)); | ||
11908 | |||
11909 | |||
11910 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock block = | ||
11911 | CreateImprovedTerseBlock(p, false); | ||
11912 | |||
11913 | const float TIME_DILATION = 1.0f; | ||
11914 | ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); | ||
11915 | |||
11916 | |||
11917 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | ||
11918 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | ||
11919 | packet.RegionData.TimeDilation = timeDilation; | ||
11920 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | ||
11921 | |||
11922 | packet.ObjectData[0] = block; | ||
11923 | |||
11924 | OutPacket(packet, ThrottleOutPacketType.Task, true); | ||
11925 | } | ||
11926 | |||
11927 | //ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, | ||
11928 | // AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); | ||
11929 | |||
11930 | } | ||
11876 | } | 11931 | } |
11877 | } | 11932 | } |