aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-07-29 03:13:10 +0100
committerJustin Clark-Casey (justincc)2014-07-29 03:13:10 +0100
commitf54fccba1e436c12e55da9dfa5ca089440783e16 (patch)
treed49119dd8465109126c2f6add0642fc3e036c58d /OpenSim
parentAllow the "debug scene set physics false|true" command to work when bulletsim... (diff)
downloadopensim-SC-f54fccba1e436c12e55da9dfa5ca089440783e16.zip
opensim-SC-f54fccba1e436c12e55da9dfa5ca089440783e16.tar.gz
opensim-SC-f54fccba1e436c12e55da9dfa5ca089440783e16.tar.bz2
opensim-SC-f54fccba1e436c12e55da9dfa5ca089440783e16.tar.xz
Make it possible to change avatar position update, rotation and velocity tolerances on the fly.
This is done via "debug scene set client-pos-upd, client-rot-upd, client-vel-upd". For testing purposes.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs20
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs10
-rw-r--r--OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs78
3 files changed, 79 insertions, 29 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1639ee4..482e803 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -230,7 +230,22 @@ namespace OpenSim.Region.Framework.Scenes
230 /// <summary> 230 /// <summary>
231 /// Temporarily setting to trigger appearance resends at 60 second intervals. 231 /// Temporarily setting to trigger appearance resends at 60 second intervals.
232 /// </summary> 232 /// </summary>
233 public bool SendPeriodicAppearanceUpdates { get; set; } 233 public bool SendPeriodicAppearanceUpdates { get; set; }
234
235 /// <summary>
236 /// How much a client has to change position before updates are sent to viewers.
237 /// </summary>
238 public float ClientPositionUpdateTolerance { get; set; }
239
240 /// <summary>
241 /// How much a client has to rotate before updates are sent to viewers.
242 /// </summary>
243 public float ClientRotationUpdateTolerance { get; set; }
244
245 /// <summary>
246 /// How much a client has to change velocity before updates are sent to viewers.
247 /// </summary>
248 public float ClientVelocityUpdateTolerance { get; set; }
234 249
235 protected float m_defaultDrawDistance = 255.0f; 250 protected float m_defaultDrawDistance = 255.0f;
236 public float DefaultDrawDistance 251 public float DefaultDrawDistance
@@ -1046,6 +1061,9 @@ namespace OpenSim.Region.Framework.Scenes
1046 PeriodicBackup = true; 1061 PeriodicBackup = true;
1047 UseBackup = true; 1062 UseBackup = true;
1048 1063
1064 ClientRotationUpdateTolerance = 0.01f;
1065 ClientVelocityUpdateTolerance = 0.001f;
1066 ClientPositionUpdateTolerance = 0.05f;
1049 ChildReprioritizationDistance = 20.0; 1067 ChildReprioritizationDistance = 20.0;
1050 1068
1051 m_eventManager = new EventManager(); 1069 m_eventManager = new EventManager();
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 34c6f7c..18a0491 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3182,10 +3182,6 @@ namespace OpenSim.Region.Framework.Scenes
3182 3182
3183 public override void Update() 3183 public override void Update()
3184 { 3184 {
3185 const float ROTATION_TOLERANCE = 0.01f;
3186 const float VELOCITY_TOLERANCE = 0.001f;
3187 const float POSITION_TOLERANCE = 0.05f;
3188
3189 if (IsChildAgent == false) 3185 if (IsChildAgent == false)
3190 { 3186 {
3191 // NOTE: Velocity is not the same as m_velocity. Velocity will attempt to 3187 // NOTE: Velocity is not the same as m_velocity. Velocity will attempt to
@@ -3202,9 +3198,9 @@ namespace OpenSim.Region.Framework.Scenes
3202 3198
3203 if (!updateClients) 3199 if (!updateClients)
3204 updateClients 3200 updateClients
3205 = !Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) 3201 = !Rotation.ApproxEquals(m_lastRotation, Scene.ClientRotationUpdateTolerance)
3206 || !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) 3202 || !Velocity.ApproxEquals(m_lastVelocity, Scene.ClientVelocityUpdateTolerance)
3207 || !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE); 3203 || !m_pos.ApproxEquals(m_lastPosition, Scene.ClientPositionUpdateTolerance);
3208 3204
3209 if (updateClients) 3205 if (updateClients)
3210 { 3206 {
diff --git a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
index 51aad6f..90f8cb4 100644
--- a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
+++ b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
@@ -93,30 +93,36 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
93 "Debug", this, "debug scene get", 93 "Debug", this, "debug scene get",
94 "debug scene get", 94 "debug scene get",
95 "List current scene options.", 95 "List current scene options.",
96 "active - if false then main scene update and maintenance loops are suspended.\n" 96 "active - if false then main scene update and maintenance loops are suspended.\n"
97 + "animations - if true then extra animations debug information is logged.\n" 97 + "animations - if true then extra animations debug information is logged.\n"
98 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n" 98 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n"
99 + "collisions - if false then collisions with other objects are turned off.\n" 99 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
100 + "pbackup - if false then periodic scene backup is turned off.\n" 100 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
101 + "physics - if false then all physics objects are non-physical.\n" 101 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
102 + "scripting - if false then no scripting operations happen.\n" 102 + "collisions - if false then collisions with other objects are turned off.\n"
103 + "teleport - if true then some extra teleport debug information is logged.\n" 103 + "pbackup - if false then periodic scene backup is turned off.\n"
104 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.", 104 + "physics - if false then all physics objects are non-physical.\n"
105 + "scripting - if false then no scripting operations happen.\n"
106 + "teleport - if true then some extra teleport debug information is logged.\n"
107 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.",
105 HandleDebugSceneGetCommand); 108 HandleDebugSceneGetCommand);
106 109
107 scene.AddCommand( 110 scene.AddCommand(
108 "Debug", this, "debug scene set", 111 "Debug", this, "debug scene set",
109 "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false", 112 "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false",
110 "Turn on scene debugging options.", 113 "Turn on scene debugging options.",
111 "active - if false then main scene update and maintenance loops are suspended.\n" 114 "active - if false then main scene update and maintenance loops are suspended.\n"
112 + "animations - if true then extra animations debug information is logged.\n" 115 + "animations - if true then extra animations debug information is logged.\n"
113 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n" 116 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n"
114 + "collisions - if false then collisions with other objects are turned off.\n" 117 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
115 + "pbackup - if false then periodic scene backup is turned off.\n" 118 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
116 + "physics - if false then all physics objects are non-physical.\n" 119 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
117 + "scripting - if false then no scripting operations happen.\n" 120 + "collisions - if false then collisions with other objects are turned off.\n"
118 + "teleport - if true then some extra teleport debug information is logged.\n" 121 + "pbackup - if false then periodic scene backup is turned off.\n"
119 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.", 122 + "physics - if false then all physics objects are non-physical.\n"
123 + "scripting - if false then no scripting operations happen.\n"
124 + "teleport - if true then some extra teleport debug information is logged.\n"
125 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.",
120 HandleDebugSceneSetCommand); 126 HandleDebugSceneSetCommand);
121 } 127 }
122 128
@@ -141,6 +147,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
141 cdl.AddRow("active", m_scene.Active); 147 cdl.AddRow("active", m_scene.Active);
142 cdl.AddRow("animations", m_scene.DebugAnimations); 148 cdl.AddRow("animations", m_scene.DebugAnimations);
143 cdl.AddRow("child-repri", m_scene.ChildReprioritizationDistance); 149 cdl.AddRow("child-repri", m_scene.ChildReprioritizationDistance);
150 cdl.AddRow("client-pos-upd", m_scene.ClientPositionUpdateTolerance);
151 cdl.AddRow("client-rot-upd", m_scene.ClientRotationUpdateTolerance);
152 cdl.AddRow("client-vel-upd", m_scene.ClientVelocityUpdateTolerance);
144 cdl.AddRow("pbackup", m_scene.PeriodicBackup); 153 cdl.AddRow("pbackup", m_scene.PeriodicBackup);
145 cdl.AddRow("physics", m_scene.PhysicsEnabled); 154 cdl.AddRow("physics", m_scene.PhysicsEnabled);
146 cdl.AddRow("scripting", m_scene.ScriptsEnabled); 155 cdl.AddRow("scripting", m_scene.ScriptsEnabled);
@@ -190,11 +199,38 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
190 199
191 if (options.ContainsKey("child-repri")) 200 if (options.ContainsKey("child-repri"))
192 { 201 {
193 double childRepriDistance; 202 double newValue;
194 203
195 // FIXME: This can only come from the console at the moment but might not always be true. 204 // FIXME: This can only come from the console at the moment but might not always be true.
196 if (ConsoleUtil.TryParseConsoleDouble(MainConsole.Instance, options["child-repri"], out childRepriDistance)) 205 if (ConsoleUtil.TryParseConsoleDouble(MainConsole.Instance, options["child-repri"], out newValue))
197 m_scene.ChildReprioritizationDistance = childRepriDistance; 206 m_scene.ChildReprioritizationDistance = newValue;
207 }
208
209 if (options.ContainsKey("client-pos-upd"))
210 {
211 float newValue;
212
213 // FIXME: This can only come from the console at the moment but might not always be true.
214 if (ConsoleUtil.TryParseConsoleFloat(MainConsole.Instance, options["client-pos-upd"], out newValue))
215 m_scene.ClientPositionUpdateTolerance = newValue;
216 }
217
218 if (options.ContainsKey("client-rot-upd"))
219 {
220 float newValue;
221
222 // FIXME: This can only come from the console at the moment but might not always be true.
223 if (ConsoleUtil.TryParseConsoleFloat(MainConsole.Instance, options["client-rot-upd"], out newValue))
224 m_scene.ClientRotationUpdateTolerance = newValue;
225 }
226
227 if (options.ContainsKey("client-vel-upd"))
228 {
229 float newValue;
230
231 // FIXME: This can only come from the console at the moment but might not always be true.
232 if (ConsoleUtil.TryParseConsoleFloat(MainConsole.Instance, options["client-vel-upd"], out newValue))
233 m_scene.ClientVelocityUpdateTolerance = newValue;
198 } 234 }
199 235
200 if (options.ContainsKey("pbackup")) 236 if (options.ContainsKey("pbackup"))