From 6e01769bcff35be9cace62a0342cf2d275608891 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 12 Feb 2008 04:27:20 +0000 Subject: * A bunch of updates to make things more smooth. ** Sending the actual TimeDilation to the client now instead of the 62455 constant. The client is *supposed* to use that value to sync with the simulator. (actually sending ushort.maxvalue * TimeDilation) ** Disabling prim that inter-penetrate instead of just not attaching a joint ** Reduced prim spin a 'little' bit, but not *enough* ** Tweaked the TimeDilation algorithm to be closer to 1.0 by default and various changes to the sim stats reporter ** Created a .SetValues method to PhysicsVector so we can simply call the setvalues function instead of .x, .y, .z sets. ** Experimented with a .GetBytes Method on PhysicsActor to be able to use the LLVector3.FromBytes() method. ** Upped the Inter-penetration depth to 0.25 instead of .08. --- OpenSim/Region/Environment/Scenes/Scene.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 6b4f377..b797cc3 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -69,7 +69,7 @@ namespace OpenSim.Region.Environment.Scenes public InnerScene m_innerScene; private Random Rand = new Random(); - private uint _primCount = 702000; + private uint _primCount = 720000; private readonly Mutex _primAllocateMutex = new Mutex(false); private int m_timePhase = 24; @@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Scenes protected int m_fps = 10; protected int m_frame = 0; - protected float m_timespan = 0.1f; + protected float m_timespan = 0.089f; protected DateTime m_lastupdate = DateTime.Now; protected float m_timedilation = 1.0f; @@ -750,8 +750,17 @@ namespace OpenSim.Region.Environment.Scenes finally { updateLock.ReleaseMutex(); + // Get actual time dilation + float tmpval = (m_timespan / (float)SinceLastFrame.TotalSeconds); - m_timedilation = m_timespan / (float)SinceLastFrame.TotalSeconds; + // If actual time dilation is greater then one, we're catching up, so subtract + // the amount that's greater then 1 from the time dilation + if (tmpval > 1.0) + { + tmpval = tmpval - (tmpval - 1.0f); + } + m_timedilation = tmpval; + m_lastupdate = DateTime.Now; } } -- cgit v1.1