diff options
author | Teravus Ovares | 2008-02-12 04:27:20 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-02-12 04:27:20 +0000 |
commit | 6e01769bcff35be9cace62a0342cf2d275608891 (patch) | |
tree | 124df7910fc0f1d31a13e297ced2dd73ce91a292 /OpenSim/Region/Environment/Scenes | |
parent | default to appending for log files per Mantis 530, and per (diff) | |
download | opensim-SC-6e01769bcff35be9cace62a0342cf2d275608891.zip opensim-SC-6e01769bcff35be9cace62a0342cf2d275608891.tar.gz opensim-SC-6e01769bcff35be9cace62a0342cf2d275608891.tar.bz2 opensim-SC-6e01769bcff35be9cace62a0342cf2d275608891.tar.xz |
* 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.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
6 files changed, 35 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 219db63..7831858 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
240 | if (TryGetAvatar(remoteClient.AgentId, out av)) { | 240 | if (TryGetAvatar(remoteClient.AgentId, out av)) { |
241 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); | 241 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); |
242 | objupdate.RegionData.RegionHandle = m_regInfo.RegionHandle; | 242 | objupdate.RegionData.RegionHandle = m_regInfo.RegionHandle; |
243 | objupdate.RegionData.TimeDilation = 64096; | 243 | objupdate.RegionData.TimeDilation = ushort.MaxValue; |
244 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[2]; | 244 | objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[2]; |
245 | // avatar stuff - horrible group copypaste | 245 | // avatar stuff - horrible group copypaste |
246 | 246 | ||
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 | |||
69 | public InnerScene m_innerScene; | 69 | public InnerScene m_innerScene; |
70 | 70 | ||
71 | private Random Rand = new Random(); | 71 | private Random Rand = new Random(); |
72 | private uint _primCount = 702000; | 72 | private uint _primCount = 720000; |
73 | private readonly Mutex _primAllocateMutex = new Mutex(false); | 73 | private readonly Mutex _primAllocateMutex = new Mutex(false); |
74 | 74 | ||
75 | private int m_timePhase = 24; | 75 | private int m_timePhase = 24; |
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
113 | 113 | ||
114 | protected int m_fps = 10; | 114 | protected int m_fps = 10; |
115 | protected int m_frame = 0; | 115 | protected int m_frame = 0; |
116 | protected float m_timespan = 0.1f; | 116 | protected float m_timespan = 0.089f; |
117 | protected DateTime m_lastupdate = DateTime.Now; | 117 | protected DateTime m_lastupdate = DateTime.Now; |
118 | 118 | ||
119 | protected float m_timedilation = 1.0f; | 119 | protected float m_timedilation = 1.0f; |
@@ -750,8 +750,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
750 | finally | 750 | finally |
751 | { | 751 | { |
752 | updateLock.ReleaseMutex(); | 752 | updateLock.ReleaseMutex(); |
753 | // Get actual time dilation | ||
754 | float tmpval = (m_timespan / (float)SinceLastFrame.TotalSeconds); | ||
753 | 755 | ||
754 | m_timedilation = m_timespan / (float)SinceLastFrame.TotalSeconds; | 756 | // If actual time dilation is greater then one, we're catching up, so subtract |
757 | // the amount that's greater then 1 from the time dilation | ||
758 | if (tmpval > 1.0) | ||
759 | { | ||
760 | tmpval = tmpval - (tmpval - 1.0f); | ||
761 | } | ||
762 | m_timedilation = tmpval; | ||
763 | |||
755 | m_lastupdate = DateTime.Now; | 764 | m_lastupdate = DateTime.Now; |
756 | } | 765 | } |
757 | } | 766 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index a745d9c..3b146ea 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -1593,7 +1593,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1593 | part.UpdateMovement(); | 1593 | part.UpdateMovement(); |
1594 | } | 1594 | } |
1595 | } | 1595 | } |
1596 | 1596 | public float GetTimeDilation() | |
1597 | { | ||
1598 | return m_scene.TimeDilation; | ||
1599 | } | ||
1597 | /// <summary> | 1600 | /// <summary> |
1598 | /// Added as a way for the storage provider to reset the scene, | 1601 | /// Added as a way for the storage provider to reset the scene, |
1599 | /// most likely a better way to do this sort of thing but for now... | 1602 | /// most likely a better way to do this sort of thing but for now... |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 180ed51..7900900 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -94,10 +94,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
94 | public byte ObjectSaleType; | 94 | public byte ObjectSaleType; |
95 | public int SalePrice; | 95 | public int SalePrice; |
96 | public uint Category; | 96 | public uint Category; |
97 | |||
97 | 98 | ||
98 | public Int32 CreationDate; | 99 | public Int32 CreationDate; |
99 | public uint ParentID = 0; | 100 | public uint ParentID = 0; |
100 | 101 | ||
102 | private PhysicsVector m_lastRotationalVelocity = PhysicsVector.Zero; | ||
101 | private Vector3 m_sitTargetPosition = new Vector3(0, 0, 0); | 103 | private Vector3 m_sitTargetPosition = new Vector3(0, 0, 0); |
102 | private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1); | 104 | private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1); |
103 | private LLUUID m_sitTargetAvatar = LLUUID.Zero; | 105 | private LLUUID m_sitTargetAvatar = LLUUID.Zero; |
@@ -417,9 +419,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
417 | { | 419 | { |
418 | if (PhysActor.IsPhysical) | 420 | if (PhysActor.IsPhysical) |
419 | { | 421 | { |
420 | m_rotationalvelocity.X = PhysActor.RotationalVelocity.X; | 422 | m_rotationalvelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(),0); |
421 | m_rotationalvelocity.Y = PhysActor.RotationalVelocity.Y; | ||
422 | m_rotationalvelocity.Z = PhysActor.RotationalVelocity.Z; | ||
423 | } | 423 | } |
424 | } | 424 | } |
425 | 425 | ||
@@ -1693,7 +1693,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1693 | 1693 | ||
1694 | 1694 | ||
1695 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; | 1695 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; |
1696 | remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalID, m_shape, lPos, clientFlags, m_uuid, | 1696 | remoteClient.SendPrimitiveToClient(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalID, m_shape, lPos, clientFlags, m_uuid, |
1697 | OwnerID, | 1697 | OwnerID, |
1698 | m_text, color, ParentID, m_particleSystem, lRot, m_clickAction, m_TextureAnimation); | 1698 | m_text, color, ParentID, m_particleSystem, lRot, m_clickAction, m_TextureAnimation); |
1699 | } | 1699 | } |
@@ -1741,12 +1741,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1741 | LLQuaternion mRot = RotationOffset; | 1741 | LLQuaternion mRot = RotationOffset; |
1742 | if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0) | 1742 | if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0) |
1743 | { | 1743 | { |
1744 | remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot); | 1744 | remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalID, lPos, mRot); |
1745 | } | 1745 | } |
1746 | else | 1746 | else |
1747 | { | 1747 | { |
1748 | remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot, Velocity, | 1748 | remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalID, lPos, mRot, Velocity, |
1749 | RotationalVelocity); | 1749 | RotationalVelocity); |
1750 | //System.Console.WriteLine("LID: " + LocalID + " RVel:" + RotationalVelocity.ToString() + " TD: " + ((ushort)(m_parentGroup.Scene.TimeDilation * 500000f)).ToString() + ":" + m_parentGroup.Scene.TimeDilation.ToString()); | ||
1750 | } | 1751 | } |
1751 | } | 1752 | } |
1752 | 1753 | ||
@@ -1755,13 +1756,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1755 | LLQuaternion mRot = RotationOffset; | 1756 | LLQuaternion mRot = RotationOffset; |
1756 | if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0) | 1757 | if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0) |
1757 | { | 1758 | { |
1758 | remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot); | 1759 | remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalID, lPos, mRot); |
1759 | } | 1760 | } |
1760 | else | 1761 | else |
1761 | { | 1762 | { |
1762 | remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot, Velocity, | 1763 | remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalID, lPos, mRot, Velocity, |
1763 | RotationalVelocity); | 1764 | RotationalVelocity); |
1764 | //System.Console.WriteLine("RVel:" + RotationalVelocity); | 1765 | //System.Console.WriteLine("LID: " + LocalID + "RVel:" + RotationalVelocity.ToString() + " TD: " + ((ushort)(m_parentGroup.Scene.TimeDilation * 500000f)).ToString() + ":" + m_parentGroup.Scene.TimeDilation.ToString()); |
1765 | } | 1766 | } |
1766 | } | 1767 | } |
1767 | 1768 | ||
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 8155b10..5403fc7 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -1289,7 +1289,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1289 | LLVector3 pos = m_pos; | 1289 | LLVector3 pos = m_pos; |
1290 | LLVector3 vel = Velocity; | 1290 | LLVector3 vel = Velocity; |
1291 | LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); | 1291 | LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); |
1292 | remoteClient.SendAvatarTerseUpdate(m_regionHandle, 64096, LocalId, new LLVector3(pos.X, pos.Y, pos.Z), | 1292 | remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new LLVector3(pos.X, pos.Y, pos.Z), |
1293 | new LLVector3(vel.X, vel.Y, vel.Z), rot); | 1293 | new LLVector3(vel.X, vel.Y, vel.Z), rot); |
1294 | 1294 | ||
1295 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 1295 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); |
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index 3e1fec2..a0539f0 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | |||
@@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
181 | // Then we divide the whole amount by the amount of seconds pass in between stats updates. | 181 | // Then we divide the whole amount by the amount of seconds pass in between stats updates. |
182 | 182 | ||
183 | sb[0].StatID = (uint) Stats.TimeDilation; | 183 | sb[0].StatID = (uint) Stats.TimeDilation; |
184 | sb[0].StatValue = ((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor)); | 184 | sb[0].StatValue = m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor)); |
185 | 185 | ||
186 | sb[1].StatID = (uint) Stats.SimFPS; | 186 | sb[1].StatID = (uint) Stats.SimFPS; |
187 | sb[1].StatValue = simfps/statsUpdateFactor; | 187 | sb[1].StatValue = simfps/statsUpdateFactor; |
@@ -280,13 +280,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
280 | 280 | ||
281 | public void AddTimeDilation(float td) | 281 | public void AddTimeDilation(float td) |
282 | { | 282 | { |
283 | float tdsetting = td; | 283 | //float tdsetting = td; |
284 | if (tdsetting > 1.0f) | 284 | //if (tdsetting > 1.0f) |
285 | tdsetting = (tdsetting - (tdsetting - 0.91f)); | 285 | //tdsetting = (tdsetting - (tdsetting - 0.91f)); |
286 | 286 | ||
287 | if (tdsetting < 0) | 287 | //if (tdsetting < 0) |
288 | tdsetting = 0.0f; | 288 | //tdsetting = 0.0f; |
289 | m_timeDilation += tdsetting; | 289 | m_timeDilation = td; |
290 | } | 290 | } |
291 | 291 | ||
292 | public void SetRootAgents(int rootAgents) | 292 | public void SetRootAgents(int rootAgents) |