Always send a time dilation of 1.0 while we debug rubberbanding issues

0.6.8-post-fixes
John Hurliman 2009-10-28 15:11:01 -07:00
parent a069a1ee68
commit 1c9696a9d2
4 changed files with 6 additions and 107 deletions

View File

@ -3168,107 +3168,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion
#region Prim/Avatar Updates
/*void SendObjectUpdate(SceneObjectPart obj, PrimFlags creatorFlags, PrimUpdateFlags updateFlags)
{
bool canUseCompressed, canUseImproved;
UpdateFlagsToPacketType(creatorFlags, updateFlags, out canUseCompressed, out canUseImproved);
if (!canUseImproved && !canUseCompressed)
SendFullObjectUpdate(obj, creatorFlags, updateFlags);
else if (!canUseImproved)
SendObjectUpdateCompressed(obj, creatorFlags, updateFlags);
else
SendImprovedTerseObjectUpdate(obj, creatorFlags, updateFlags);
}
void SendFullObjectUpdate(SceneObjectPart obj, PrimFlags creatorFlags, PrimUpdateFlags updateFlags)
{
IClientAPI owner;
if (m_scene.ClientManager.TryGetValue(obj.OwnerID, out owner) && owner is LLClientView)
{
LLClientView llOwner = (LLClientView)owner;
// Send an update out to the owner
ObjectUpdatePacket updateToOwner = new ObjectUpdatePacket();
updateToOwner.RegionData.RegionHandle = obj.RegionHandle;
//updateToOwner.RegionData.TimeDilation = (ushort)(timeDilation * (float)UInt16.MaxValue);
updateToOwner.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
updateToOwner.ObjectData[0] = BuildUpdateBlock(obj, obj.Flags | creatorFlags | PrimFlags.ObjectYouOwner, 0);
m_udpServer.SendPacket(llOwner.UDPClient, updateToOwner, ThrottleOutPacketType.State, true);
}
// Send an update out to everyone else
ObjectUpdatePacket updateToOthers = new ObjectUpdatePacket();
updateToOthers.RegionData.RegionHandle = obj.RegionHandle;
//updateToOthers.RegionData.TimeDilation = (ushort)(timeDilation * (float)UInt16.MaxValue);
updateToOthers.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
updateToOthers.ObjectData[0] = BuildUpdateBlock(obj, obj.Flags, 0);
m_scene.ClientManager.ForEach(
delegate(IClientAPI client)
{
if (client.AgentId != obj.OwnerID && client is LLClientView)
{
LLClientView llClient = (LLClientView)client;
m_udpServer.SendPacket(llClient.UDPClient, updateToOthers, ThrottleOutPacketType.State, true);
}
}
);
}
void SendObjectUpdateCompressed(SceneObjectPart obj, PrimFlags creatorFlags, PrimUpdateFlags updateFlags)
{
}
void SendImprovedTerseObjectUpdate(SceneObjectPart obj, PrimFlags creatorFlags, PrimUpdateFlags updateFlags)
{
}
void UpdateFlagsToPacketType(PrimFlags creatorFlags, PrimUpdateFlags updateFlags, out bool canUseCompressed, out bool canUseImproved)
{
canUseCompressed = true;
canUseImproved = true;
if ((updateFlags & PrimUpdateFlags.FullUpdate) == PrimUpdateFlags.FullUpdate || creatorFlags != PrimFlags.None)
{
canUseCompressed = false;
canUseImproved = false;
}
else
{
if ((updateFlags & PrimUpdateFlags.Velocity) != 0 ||
(updateFlags & PrimUpdateFlags.Acceleration) != 0 ||
(updateFlags & PrimUpdateFlags.CollisionPlane) != 0 ||
(updateFlags & PrimUpdateFlags.Joint) != 0)
{
canUseCompressed = false;
}
if ((updateFlags & PrimUpdateFlags.PrimFlags) != 0 ||
(updateFlags & PrimUpdateFlags.ParentID) != 0 ||
(updateFlags & PrimUpdateFlags.Scale) != 0 ||
(updateFlags & PrimUpdateFlags.PrimData) != 0 ||
(updateFlags & PrimUpdateFlags.Text) != 0 ||
(updateFlags & PrimUpdateFlags.NameValue) != 0 ||
(updateFlags & PrimUpdateFlags.ExtraData) != 0 ||
(updateFlags & PrimUpdateFlags.TextureAnim) != 0 ||
(updateFlags & PrimUpdateFlags.Sound) != 0 ||
(updateFlags & PrimUpdateFlags.Particles) != 0 ||
(updateFlags & PrimUpdateFlags.Material) != 0 ||
(updateFlags & PrimUpdateFlags.ClickAction) != 0 ||
(updateFlags & PrimUpdateFlags.MediaURL) != 0 ||
(updateFlags & PrimUpdateFlags.Joint) != 0)
{
canUseImproved = false;
}
}
}*/
#endregion Prim/Avatar Updates
#region Avatar Packet/Data Sending Methods
/// <summary>

View File

@ -1015,9 +1015,9 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public float GetTimeDilation()
public ushort GetTimeDilation()
{
return m_scene.TimeDilation;
return Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);
}
/// <summary>

View File

@ -2383,7 +2383,7 @@ if (m_shape != null) {
//isattachment = ParentGroup.RootPart.IsAttachment;
byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A};
remoteClient.SendPrimitiveToClient(new SendPrimitiveData(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape,
remoteClient.SendPrimitiveToClient(new SendPrimitiveData(m_regionHandle, m_parentGroup.GetTimeDilation(), LocalId, m_shape,
lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid, _ownerID,
m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment,
AttachmentPoint,FromItemID, Sound, SoundGain, SoundFlags, SoundRadius, ParentGroup.GetUpdatePriority(remoteClient)));
@ -3785,8 +3785,7 @@ if (m_shape != null) {
// Causes this thread to dig into the Client Thread Data.
// Remember your locking here!
remoteClient.SendPrimTerseUpdate(new SendPrimitiveTerseData(m_regionHandle,
(ushort)(m_parentGroup.GetTimeDilation() *
(float)ushort.MaxValue), LocalId, lPos,
m_parentGroup.GetTimeDilation(), LocalId, lPos,
RotationOffset, Velocity, Acceleration,
RotationalVelocity, state, FromItemID,
OwnerID, (int)AttachmentPoint, null, ParentGroup.GetUpdatePriority(remoteClient)));

View File

@ -2672,7 +2672,8 @@ namespace OpenSim.Region.Physics.OdePlugin
//(step_time == 0.004f, there's 250 of those per second. Times the step time/step size
fps = (step_time / ODE_STEPSIZE) * 1000;
m_timeDilation = Math.Min((step_time / ODE_STEPSIZE) / (0.09375f / ODE_STEPSIZE), 1.0f);
// HACK: Using a time dilation of 1.0 to debug rubberbanding issues
//m_timeDilation = Math.Min((step_time / ODE_STEPSIZE) / (0.09375f / ODE_STEPSIZE), 1.0f);
step_time = 0.09375f;