diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 981b15c..d87a7e2 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -142,7 +142,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
142 | protected ulong crossingFromRegion = 0; | 142 | protected ulong crossingFromRegion = 0; |
143 | 143 | ||
144 | private readonly Vector3[] Dir_Vectors = new Vector3[6]; | 144 | private readonly Vector3[] Dir_Vectors = new Vector3[6]; |
145 | |||
146 | /// <value> | ||
147 | /// The avatar position last sent to clients | ||
148 | /// </value> | ||
145 | private Vector3 lastPhysPos = Vector3.Zero; | 149 | private Vector3 lastPhysPos = Vector3.Zero; |
150 | |||
151 | /// <value> | ||
152 | /// The avatar body rotation last sent to clients | ||
153 | /// </value> | ||
154 | private Quaternion lastPhysRot = Quaternion.Identity; | ||
146 | 155 | ||
147 | // Position of agent's camera in world (region cordinates) | 156 | // Position of agent's camera in world (region cordinates) |
148 | protected Vector3 m_CameraCenter = Vector3.Zero; | 157 | protected Vector3 m_CameraCenter = Vector3.Zero; |
@@ -1581,7 +1590,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1581 | m_updateCount = 0; | 1590 | m_updateCount = 0; |
1582 | } | 1591 | } |
1583 | } | 1592 | } |
1584 | else if ((Util.GetDistanceTo(lastPhysPos, AbsolutePosition) > 0.02) || (Util.GetDistanceTo(m_lastVelocity, m_velocity) > 0.02)) // physics-related movement | 1593 | else if ((Util.GetDistanceTo(lastPhysPos, AbsolutePosition) > 0.02) |
1594 | || (Util.GetDistanceTo(m_lastVelocity, m_velocity) > 0.02) | ||
1595 | || lastPhysRot != m_bodyRot) | ||
1585 | { | 1596 | { |
1586 | // Send Terse Update to all clients updates lastPhysPos and m_lastVelocity | 1597 | // Send Terse Update to all clients updates lastPhysPos and m_lastVelocity |
1587 | // doing the above assures us that we know what we sent the clients last | 1598 | // doing the above assures us that we know what we sent the clients last |
@@ -1628,6 +1639,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1628 | 1639 | ||
1629 | m_lastVelocity = m_velocity; | 1640 | m_lastVelocity = m_velocity; |
1630 | lastPhysPos = AbsolutePosition; | 1641 | lastPhysPos = AbsolutePosition; |
1642 | lastPhysRot = m_bodyRot; | ||
1631 | 1643 | ||
1632 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 1644 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); |
1633 | 1645 | ||
@@ -2540,7 +2552,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2540 | (float)info.GetValue("lastPhysPos.X", typeof(float)), | 2552 | (float)info.GetValue("lastPhysPos.X", typeof(float)), |
2541 | (float)info.GetValue("lastPhysPos.Y", typeof(float)), | 2553 | (float)info.GetValue("lastPhysPos.Y", typeof(float)), |
2542 | (float)info.GetValue("lastPhysPos.Z", typeof(float))); | 2554 | (float)info.GetValue("lastPhysPos.Z", typeof(float))); |
2543 | 2555 | ||
2556 | // Possibly we should store lastPhysRot. But there may well be not much point since rotation changes | ||
2557 | // wouldn't carry us across borders anyway | ||
2558 | |||
2544 | m_CameraCenter | 2559 | m_CameraCenter |
2545 | = new Vector3( | 2560 | = new Vector3( |
2546 | (float)info.GetValue("m_CameraCenter.X", typeof(float)), | 2561 | (float)info.GetValue("m_CameraCenter.X", typeof(float)), |
@@ -2686,7 +2701,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2686 | // Vector3 | 2701 | // Vector3 |
2687 | info.AddValue("lastPhysPos.X", lastPhysPos.X); | 2702 | info.AddValue("lastPhysPos.X", lastPhysPos.X); |
2688 | info.AddValue("lastPhysPos.Y", lastPhysPos.Y); | 2703 | info.AddValue("lastPhysPos.Y", lastPhysPos.Y); |
2689 | info.AddValue("lastPhysPos.Z", lastPhysPos.Z); | 2704 | info.AddValue("lastPhysPos.Z", lastPhysPos.Z); |
2705 | |||
2706 | // Possibly we should retrieve lastPhysRot. But there may well be not much point since rotation changes | ||
2707 | // wouldn't carry us across borders anyway | ||
2690 | 2708 | ||
2691 | // Vector3 | 2709 | // Vector3 |
2692 | info.AddValue("m_CameraCenter.X", m_CameraCenter.X); | 2710 | info.AddValue("m_CameraCenter.X", m_CameraCenter.X); |