aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs15
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs21
3 files changed, 25 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs
index 4199c98..46ee3c0 100644
--- a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs
+++ b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs
@@ -193,6 +193,10 @@ namespace OpenSim.Region.CoreModules.Hypergrid
193 { 193 {
194 return scene.RegionInfo; 194 return scene.RegionInfo;
195 } 195 }
196 else if (m_scenes.Count > 0)
197 {
198 return m_scenes[0].RegionInfo;
199 }
196 return null; 200 return null;
197 } 201 }
198 202
@@ -248,7 +252,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid
248 { 252 {
249 foreach (Scene nextScene in m_scenes) 253 foreach (Scene nextScene in m_scenes)
250 { 254 {
251 if (nextScene.RegionInfo.RegionName == regionName) 255 if (nextScene.RegionInfo.RegionName.Equals(regionName, StringComparison.InvariantCultureIgnoreCase))
252 { 256 {
253 scene = nextScene; 257 scene = nextScene;
254 return true; 258 return true;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index a99a802..c16c4fe 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2394,18 +2394,19 @@ if (m_shape != null) {
2394 /// </summary> 2394 /// </summary>
2395 public void SendScheduledUpdates() 2395 public void SendScheduledUpdates()
2396 { 2396 {
2397 const float VELOCITY_TOLERANCE = 0.0001f; 2397 const float ROTATION_TOLERANCE = 0.01f;
2398 const float POSITION_TOLERANCE = 0.1f; 2398 const float VELOCITY_TOLERANCE = 0.001f;
2399 const float POSITION_TOLERANCE = 0.05f;
2399 const int TIME_MS_TOLERANCE = 3000; 2400 const int TIME_MS_TOLERANCE = 3000;
2400 2401
2401 if (m_updateFlag == 1) 2402 if (m_updateFlag == 1)
2402 { 2403 {
2403 // Throw away duplicate or insignificant updates 2404 // Throw away duplicate or insignificant updates
2404 if (RotationOffset != m_lastRotation || 2405 if (!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) ||
2405 Acceleration != m_lastAcceleration || 2406 !Acceleration.Equals(m_lastAcceleration) ||
2406 (Velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE || 2407 !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||
2407 (RotationalVelocity - m_lastAngularVelocity).Length() > VELOCITY_TOLERANCE || 2408 !RotationalVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) ||
2408 (OffsetPosition - m_lastPosition).Length() > POSITION_TOLERANCE || 2409 !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
2409 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) 2410 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
2410 { 2411 {
2411 AddTerseUpdateToAllAvatars(); 2412 AddTerseUpdateToAllAvatars();
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9ba19d3..63c979f 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2362,8 +2362,9 @@ namespace OpenSim.Region.Framework.Scenes
2362 2362
2363 public override void Update() 2363 public override void Update()
2364 { 2364 {
2365 const float VELOCITY_TOLERANCE = 0.0001f; 2365 const float ROTATION_TOLERANCE = 0.01f;
2366 const float POSITION_TOLERANCE = 10.0f; 2366 const float VELOCITY_TOLERANCE = 0.001f;
2367 const float POSITION_TOLERANCE = 0.05f;
2367 const int TIME_MS_TOLERANCE = 3000; 2368 const int TIME_MS_TOLERANCE = 3000;
2368 2369
2369 SendPrimUpdates(); 2370 SendPrimUpdates();
@@ -2377,9 +2378,9 @@ namespace OpenSim.Region.Framework.Scenes
2377 if (m_isChildAgent == false) 2378 if (m_isChildAgent == false)
2378 { 2379 {
2379 // Throw away duplicate or insignificant updates 2380 // Throw away duplicate or insignificant updates
2380 if (m_bodyRot != m_lastRotation || 2381 if (!m_bodyRot.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) ||
2381 (m_velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE || 2382 !m_velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||
2382 (m_pos - m_lastPosition).Length() > POSITION_TOLERANCE || 2383 !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
2383 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) 2384 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
2384 { 2385 {
2385 SendTerseUpdateToAllClients(); 2386 SendTerseUpdateToAllClients();
@@ -2415,7 +2416,9 @@ namespace OpenSim.Region.Framework.Scenes
2415 m_perfMonMS = Environment.TickCount; 2416 m_perfMonMS = Environment.TickCount;
2416 2417
2417 Vector3 pos = m_pos; 2418 Vector3 pos = m_pos;
2418 pos.Z -= m_appearance.HipOffset; 2419 pos.Z += m_appearance.HipOffset;
2420
2421 //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity);
2419 2422
2420 remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, 2423 remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
2421 pos, m_velocity, Vector3.Zero, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(remoteClient))); 2424 pos, m_velocity, Vector3.Zero, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(remoteClient)));
@@ -2514,7 +2517,7 @@ namespace OpenSim.Region.Framework.Scenes
2514 return; 2517 return;
2515 2518
2516 Vector3 pos = m_pos; 2519 Vector3 pos = m_pos;
2517 pos.Z -= m_appearance.HipOffset; 2520 pos.Z += m_appearance.HipOffset;
2518 2521
2519 remoteAvatar.m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, 2522 remoteAvatar.m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid,
2520 LocalId, pos, m_appearance.Texture.GetBytes(), 2523 LocalId, pos, m_appearance.Texture.GetBytes(),
@@ -2585,7 +2588,7 @@ namespace OpenSim.Region.Framework.Scenes
2585 // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); 2588 // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
2586 2589
2587 Vector3 pos = m_pos; 2590 Vector3 pos = m_pos;
2588 pos.Z -= m_appearance.HipOffset; 2591 pos.Z += m_appearance.HipOffset;
2589 2592
2590 m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, 2593 m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId,
2591 pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot)); 2594 pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot));
@@ -2694,7 +2697,7 @@ namespace OpenSim.Region.Framework.Scenes
2694 } 2697 }
2695 2698
2696 Vector3 pos = m_pos; 2699 Vector3 pos = m_pos;
2697 pos.Z -= m_appearance.HipOffset; 2700 pos.Z += m_appearance.HipOffset;
2698 2701
2699 m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, 2702 m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId,
2700 pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot)); 2703 pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot));