diff options
author | Justin Clark-Casey (justincc) | 2011-08-04 01:05:43 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-04 01:05:43 +0100 |
commit | fc64cc2439278f442839c69a7d98125f47019613 (patch) | |
tree | 4966752294836e9ec13f8c6ea50e785b230e12f7 | |
parent | When the NPC reaches within the SIGNIFICANT_CLIENT_MOVEMENT distance of the t... (diff) | |
download | opensim-SC_OLD-fc64cc2439278f442839c69a7d98125f47019613.zip opensim-SC_OLD-fc64cc2439278f442839c69a7d98125f47019613.tar.gz opensim-SC_OLD-fc64cc2439278f442839c69a7d98125f47019613.tar.bz2 opensim-SC_OLD-fc64cc2439278f442839c69a7d98125f47019613.tar.xz |
Make SIGNIFICANT_MOVEMENT SP constant a top-level property so that other classes can use it.
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ba10423..b7fa3b6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -89,6 +89,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
89 | /// </summary> | 89 | /// </summary> |
90 | private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.1f, 0.0f, 0.3f); | 90 | private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.1f, 0.0f, 0.3f); |
91 | 91 | ||
92 | /// <summary> | ||
93 | /// Movement updates for agents in neighboring regions are sent directly to clients. | ||
94 | /// This value only affects how often agent positions are sent to neighbor regions | ||
95 | /// for things such as distance-based update prioritization | ||
96 | /// </summary> | ||
97 | public static readonly float SIGNIFICANT_MOVEMENT = 2.0f; | ||
98 | |||
92 | public UUID currentParcelUUID = UUID.Zero; | 99 | public UUID currentParcelUUID = UUID.Zero; |
93 | 100 | ||
94 | private ISceneViewer m_sceneViewer; | 101 | private ISceneViewer m_sceneViewer; |
@@ -2718,11 +2725,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2718 | /// </summary> | 2725 | /// </summary> |
2719 | protected void CheckForSignificantMovement() | 2726 | protected void CheckForSignificantMovement() |
2720 | { | 2727 | { |
2721 | // Movement updates for agents in neighboring regions are sent directly to clients. | ||
2722 | // This value only affects how often agent positions are sent to neighbor regions | ||
2723 | // for things such as distance-based update prioritization | ||
2724 | const float SIGNIFICANT_MOVEMENT = 2.0f; | ||
2725 | |||
2726 | if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > SIGNIFICANT_MOVEMENT) | 2728 | if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > SIGNIFICANT_MOVEMENT) |
2727 | { | 2729 | { |
2728 | posLastSignificantMove = AbsolutePosition; | 2730 | posLastSignificantMove = AbsolutePosition; |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index fdc3485..a0a24f2 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
70 | // presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget, distanceToTarget); | 70 | // presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget, distanceToTarget); |
71 | 71 | ||
72 | // Check the error term of the current position in relation to the target position | 72 | // Check the error term of the current position in relation to the target position |
73 | if (distanceToTarget <= 2) | 73 | if (distanceToTarget <= ScenePresence.SIGNIFICANT_MOVEMENT) |
74 | { | 74 | { |
75 | // m_log.DebugFormat("[NPC MODULE]: Stopping movement of npc {0} {1}", presence.Name, presence.UUID); | 75 | // m_log.DebugFormat("[NPC MODULE]: Stopping movement of npc {0} {1}", presence.Name, presence.UUID); |
76 | // We are close enough to the target for now | 76 | // We are close enough to the target for now |