diff options
author | John Hurliman | 2009-10-28 15:11:01 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-28 15:11:01 -0700 |
commit | 1c9696a9d2665b72ecde45fdcc43c1cde2abad79 (patch) | |
tree | 70985451e564e25ddf58ea109fd9d239c9345c13 /OpenSim/Region | |
parent | Limit physics time dilation to 1.0 (diff) | |
download | opensim-SC-1c9696a9d2665b72ecde45fdcc43c1cde2abad79.zip opensim-SC-1c9696a9d2665b72ecde45fdcc43c1cde2abad79.tar.gz opensim-SC-1c9696a9d2665b72ecde45fdcc43c1cde2abad79.tar.bz2 opensim-SC-1c9696a9d2665b72ecde45fdcc43c1cde2abad79.tar.xz |
Always send a time dilation of 1.0 while we debug rubberbanding issues
Diffstat (limited to 'OpenSim/Region')
4 files changed, 6 insertions, 107 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 97caf52..1ff18d4 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3168,107 +3168,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3168 | 3168 | ||
3169 | #endregion | 3169 | #endregion |
3170 | 3170 | ||
3171 | #region Prim/Avatar Updates | ||
3172 | |||
3173 | /*void SendObjectUpdate(SceneObjectPart obj, PrimFlags creatorFlags, PrimUpdateFlags updateFlags) | ||
3174 | { | ||
3175 | bool canUseCompressed, canUseImproved; | ||
3176 | UpdateFlagsToPacketType(creatorFlags, updateFlags, out canUseCompressed, out canUseImproved); | ||
3177 | |||
3178 | if (!canUseImproved && !canUseCompressed) | ||
3179 | SendFullObjectUpdate(obj, creatorFlags, updateFlags); | ||
3180 | else if (!canUseImproved) | ||
3181 | SendObjectUpdateCompressed(obj, creatorFlags, updateFlags); | ||
3182 | else | ||
3183 | SendImprovedTerseObjectUpdate(obj, creatorFlags, updateFlags); | ||
3184 | } | ||
3185 | |||
3186 | void SendFullObjectUpdate(SceneObjectPart obj, PrimFlags creatorFlags, PrimUpdateFlags updateFlags) | ||
3187 | { | ||
3188 | IClientAPI owner; | ||
3189 | if (m_scene.ClientManager.TryGetValue(obj.OwnerID, out owner) && owner is LLClientView) | ||
3190 | { | ||
3191 | LLClientView llOwner = (LLClientView)owner; | ||
3192 | |||
3193 | // Send an update out to the owner | ||
3194 | ObjectUpdatePacket updateToOwner = new ObjectUpdatePacket(); | ||
3195 | updateToOwner.RegionData.RegionHandle = obj.RegionHandle; | ||
3196 | //updateToOwner.RegionData.TimeDilation = (ushort)(timeDilation * (float)UInt16.MaxValue); | ||
3197 | updateToOwner.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; | ||
3198 | updateToOwner.ObjectData[0] = BuildUpdateBlock(obj, obj.Flags | creatorFlags | PrimFlags.ObjectYouOwner, 0); | ||
3199 | |||
3200 | m_udpServer.SendPacket(llOwner.UDPClient, updateToOwner, ThrottleOutPacketType.State, true); | ||
3201 | } | ||
3202 | |||
3203 | // Send an update out to everyone else | ||
3204 | ObjectUpdatePacket updateToOthers = new ObjectUpdatePacket(); | ||
3205 | updateToOthers.RegionData.RegionHandle = obj.RegionHandle; | ||
3206 | //updateToOthers.RegionData.TimeDilation = (ushort)(timeDilation * (float)UInt16.MaxValue); | ||
3207 | updateToOthers.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; | ||
3208 | updateToOthers.ObjectData[0] = BuildUpdateBlock(obj, obj.Flags, 0); | ||
3209 | |||
3210 | m_scene.ClientManager.ForEach( | ||
3211 | delegate(IClientAPI client) | ||
3212 | { | ||
3213 | if (client.AgentId != obj.OwnerID && client is LLClientView) | ||
3214 | { | ||
3215 | LLClientView llClient = (LLClientView)client; | ||
3216 | m_udpServer.SendPacket(llClient.UDPClient, updateToOthers, ThrottleOutPacketType.State, true); | ||
3217 | } | ||
3218 | } | ||
3219 | ); | ||
3220 | } | ||
3221 | |||
3222 | void SendObjectUpdateCompressed(SceneObjectPart obj, PrimFlags creatorFlags, PrimUpdateFlags updateFlags) | ||
3223 | { | ||
3224 | } | ||
3225 | |||
3226 | void SendImprovedTerseObjectUpdate(SceneObjectPart obj, PrimFlags creatorFlags, PrimUpdateFlags updateFlags) | ||
3227 | { | ||
3228 | } | ||
3229 | |||
3230 | void UpdateFlagsToPacketType(PrimFlags creatorFlags, PrimUpdateFlags updateFlags, out bool canUseCompressed, out bool canUseImproved) | ||
3231 | { | ||
3232 | canUseCompressed = true; | ||
3233 | canUseImproved = true; | ||
3234 | |||
3235 | if ((updateFlags & PrimUpdateFlags.FullUpdate) == PrimUpdateFlags.FullUpdate || creatorFlags != PrimFlags.None) | ||
3236 | { | ||
3237 | canUseCompressed = false; | ||
3238 | canUseImproved = false; | ||
3239 | } | ||
3240 | else | ||
3241 | { | ||
3242 | if ((updateFlags & PrimUpdateFlags.Velocity) != 0 || | ||
3243 | (updateFlags & PrimUpdateFlags.Acceleration) != 0 || | ||
3244 | (updateFlags & PrimUpdateFlags.CollisionPlane) != 0 || | ||
3245 | (updateFlags & PrimUpdateFlags.Joint) != 0) | ||
3246 | { | ||
3247 | canUseCompressed = false; | ||
3248 | } | ||
3249 | |||
3250 | if ((updateFlags & PrimUpdateFlags.PrimFlags) != 0 || | ||
3251 | (updateFlags & PrimUpdateFlags.ParentID) != 0 || | ||
3252 | (updateFlags & PrimUpdateFlags.Scale) != 0 || | ||
3253 | (updateFlags & PrimUpdateFlags.PrimData) != 0 || | ||
3254 | (updateFlags & PrimUpdateFlags.Text) != 0 || | ||
3255 | (updateFlags & PrimUpdateFlags.NameValue) != 0 || | ||
3256 | (updateFlags & PrimUpdateFlags.ExtraData) != 0 || | ||
3257 | (updateFlags & PrimUpdateFlags.TextureAnim) != 0 || | ||
3258 | (updateFlags & PrimUpdateFlags.Sound) != 0 || | ||
3259 | (updateFlags & PrimUpdateFlags.Particles) != 0 || | ||
3260 | (updateFlags & PrimUpdateFlags.Material) != 0 || | ||
3261 | (updateFlags & PrimUpdateFlags.ClickAction) != 0 || | ||
3262 | (updateFlags & PrimUpdateFlags.MediaURL) != 0 || | ||
3263 | (updateFlags & PrimUpdateFlags.Joint) != 0) | ||
3264 | { | ||
3265 | canUseImproved = false; | ||
3266 | } | ||
3267 | } | ||
3268 | }*/ | ||
3269 | |||
3270 | #endregion Prim/Avatar Updates | ||
3271 | |||
3272 | #region Avatar Packet/Data Sending Methods | 3171 | #region Avatar Packet/Data Sending Methods |
3273 | 3172 | ||
3274 | /// <summary> | 3173 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 38a0cff..dbb06f8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1015,9 +1015,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1015 | } | 1015 | } |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | public float GetTimeDilation() | 1018 | public ushort GetTimeDilation() |
1019 | { | 1019 | { |
1020 | return m_scene.TimeDilation; | 1020 | return Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f); |
1021 | } | 1021 | } |
1022 | 1022 | ||
1023 | /// <summary> | 1023 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index c16c4fe..cf1c394 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2383,7 +2383,7 @@ if (m_shape != null) { | |||
2383 | //isattachment = ParentGroup.RootPart.IsAttachment; | 2383 | //isattachment = ParentGroup.RootPart.IsAttachment; |
2384 | 2384 | ||
2385 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; | 2385 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; |
2386 | remoteClient.SendPrimitiveToClient(new SendPrimitiveData(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape, | 2386 | remoteClient.SendPrimitiveToClient(new SendPrimitiveData(m_regionHandle, m_parentGroup.GetTimeDilation(), LocalId, m_shape, |
2387 | lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid, _ownerID, | 2387 | lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid, _ownerID, |
2388 | m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment, | 2388 | m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment, |
2389 | AttachmentPoint,FromItemID, Sound, SoundGain, SoundFlags, SoundRadius, ParentGroup.GetUpdatePriority(remoteClient))); | 2389 | AttachmentPoint,FromItemID, Sound, SoundGain, SoundFlags, SoundRadius, ParentGroup.GetUpdatePriority(remoteClient))); |
@@ -3785,8 +3785,7 @@ if (m_shape != null) { | |||
3785 | // Causes this thread to dig into the Client Thread Data. | 3785 | // Causes this thread to dig into the Client Thread Data. |
3786 | // Remember your locking here! | 3786 | // Remember your locking here! |
3787 | remoteClient.SendPrimTerseUpdate(new SendPrimitiveTerseData(m_regionHandle, | 3787 | remoteClient.SendPrimTerseUpdate(new SendPrimitiveTerseData(m_regionHandle, |
3788 | (ushort)(m_parentGroup.GetTimeDilation() * | 3788 | m_parentGroup.GetTimeDilation(), LocalId, lPos, |
3789 | (float)ushort.MaxValue), LocalId, lPos, | ||
3790 | RotationOffset, Velocity, Acceleration, | 3789 | RotationOffset, Velocity, Acceleration, |
3791 | RotationalVelocity, state, FromItemID, | 3790 | RotationalVelocity, state, FromItemID, |
3792 | OwnerID, (int)AttachmentPoint, null, ParentGroup.GetUpdatePriority(remoteClient))); | 3791 | OwnerID, (int)AttachmentPoint, null, ParentGroup.GetUpdatePriority(remoteClient))); |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 3fdf9ea..7caaa14 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -2672,7 +2672,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2672 | //(step_time == 0.004f, there's 250 of those per second. Times the step time/step size | 2672 | //(step_time == 0.004f, there's 250 of those per second. Times the step time/step size |
2673 | 2673 | ||
2674 | fps = (step_time / ODE_STEPSIZE) * 1000; | 2674 | fps = (step_time / ODE_STEPSIZE) * 1000; |
2675 | m_timeDilation = Math.Min((step_time / ODE_STEPSIZE) / (0.09375f / ODE_STEPSIZE), 1.0f); | 2675 | // HACK: Using a time dilation of 1.0 to debug rubberbanding issues |
2676 | //m_timeDilation = Math.Min((step_time / ODE_STEPSIZE) / (0.09375f / ODE_STEPSIZE), 1.0f); | ||
2676 | 2677 | ||
2677 | step_time = 0.09375f; | 2678 | step_time = 0.09375f; |
2678 | 2679 | ||