diff options
Diffstat (limited to 'OpenSim/Region')
5 files changed, 53 insertions, 21 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 | } |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index a84a3c8..8ec5bb5 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -1164,5 +1164,9 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
1164 | public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) | 1164 | public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) |
1165 | { | 1165 | { |
1166 | } | 1166 | } |
1167 | |||
1168 | public void StopFlying(ISceneEntity presence) | ||
1169 | { | ||
1170 | } | ||
1167 | } | 1171 | } |
1168 | } | 1172 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 8cd3ac6..b6f67f7 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1098,27 +1098,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1098 | 1098 | ||
1099 | public void StopFlying() | 1099 | public void StopFlying() |
1100 | { | 1100 | { |
1101 | // It turns out to get the agent to stop flying, you have to feed it stop flying velocities | 1101 | ControllingClient.StopFlying(this); |
1102 | // There's no explicit message to send the client to tell it to stop flying.. it relies on the | ||
1103 | // velocity, collision plane and avatar height | ||
1104 | |||
1105 | // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air | ||
1106 | // when the avatar stands up | ||
1107 | |||
1108 | if (m_avHeight != 127.0f) | ||
1109 | { | ||
1110 | AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (m_avHeight / 6f)); | ||
1111 | } | ||
1112 | else | ||
1113 | { | ||
1114 | AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f)); | ||
1115 | } | ||
1116 | |||
1117 | m_updateCount = UPDATE_COUNT; //KF: Trigger Anim updates to catch falling anim. | ||
1118 | |||
1119 | ControllingClient.SendPrimUpdate(this, PrimUpdateFlags.Position); | ||
1120 | //ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, | ||
1121 | // AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); | ||
1122 | } | 1102 | } |
1123 | 1103 | ||
1124 | public void AddNeighbourRegion(ulong regionHandle, string cap) | 1104 | public void AddNeighbourRegion(ulong regionHandle, string cap) |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 2ed8fbf..d72ee6f 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -1689,5 +1689,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1689 | public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) | 1689 | public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) |
1690 | { | 1690 | { |
1691 | } | 1691 | } |
1692 | |||
1693 | public void StopFlying(ISceneEntity presence) | ||
1694 | { | ||
1695 | } | ||
1692 | } | 1696 | } |
1693 | } | 1697 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index e43ef78..c3edba2 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -1171,5 +1171,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
1171 | public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) | 1171 | public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) |
1172 | { | 1172 | { |
1173 | } | 1173 | } |
1174 | |||
1175 | public void StopFlying(ISceneEntity presence) | ||
1176 | { | ||
1177 | } | ||
1174 | } | 1178 | } |
1175 | } | 1179 | } |