diff options
author | Melanie | 2013-01-09 00:21:43 +0000 |
---|---|---|
committer | Melanie | 2013-01-09 00:21:43 +0000 |
commit | e4fad4a09d6b215337ad677887a3e345d5a2c99b (patch) | |
tree | 79f32e4bd1faba3b07b3f5cc848984e2d88c6eab | |
parent | Revert "Prevent empty Anim Packs" (diff) | |
parent | BulletSim: Fix hover height (boats float at the correct level). (diff) | |
download | opensim-SC_OLD-e4fad4a09d6b215337ad677887a3e345d5a2c99b.zip opensim-SC_OLD-e4fad4a09d6b215337ad677887a3e345d5a2c99b.tar.gz opensim-SC_OLD-e4fad4a09d6b215337ad677887a3e345d5a2c99b.tar.bz2 opensim-SC_OLD-e4fad4a09d6b215337ad677887a3e345d5a2c99b.tar.xz |
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 16 | ||||
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt | 4 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 64 |
3 files changed, 45 insertions, 39 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index eb695d9..c34c05a 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -856,6 +856,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
856 | // The movement computed in the linear motor is relative to the vehicle | 856 | // The movement computed in the linear motor is relative to the vehicle |
857 | // coordinates. Rotate the movement to world coordinates. | 857 | // coordinates. Rotate the movement to world coordinates. |
858 | linearMotorContribution *= VehicleOrientation; | 858 | linearMotorContribution *= VehicleOrientation; |
859 | // All the contributions after this are world relative (mostly Z modifications) | ||
859 | 860 | ||
860 | // ================================================================== | 861 | // ================================================================== |
861 | // Buoyancy: force to overcome gravity. | 862 | // Buoyancy: force to overcome gravity. |
@@ -982,14 +983,11 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
982 | float verticalCorrectionVelocity = verticalError / m_VhoverTimescale; | 983 | float verticalCorrectionVelocity = verticalError / m_VhoverTimescale; |
983 | 984 | ||
984 | // TODO: implement m_VhoverEfficiency correctly | 985 | // TODO: implement m_VhoverEfficiency correctly |
985 | if (Math.Abs(verticalError) > m_VhoverEfficiency) | 986 | ret = new Vector3(0f, 0f, verticalCorrectionVelocity); |
986 | { | ||
987 | ret = new Vector3(0f, 0f, verticalCorrectionVelocity); | ||
988 | } | ||
989 | } | 987 | } |
990 | 988 | ||
991 | VDetailLog("{0}, MoveLinear,hover,pos={1},ret={2},hoverTS={3},height={4},target={5}", | 989 | VDetailLog("{0}, MoveLinear,hover,pos={1},eff={2},hoverTS={3},height={4},target={5},ret={6}", |
992 | Prim.LocalID, VehiclePosition, ret, m_VhoverTimescale, m_VhoverHeight, m_VhoverTargetHeight); | 990 | Prim.LocalID, VehiclePosition, m_VhoverEfficiency, m_VhoverTimescale, m_VhoverHeight, m_VhoverTargetHeight, ret); |
993 | } | 991 | } |
994 | 992 | ||
995 | return ret; | 993 | return ret; |
@@ -1238,6 +1236,9 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1238 | Vector3 movingDirection = VehicleVelocity; | 1236 | Vector3 movingDirection = VehicleVelocity; |
1239 | movingDirection.Normalize(); | 1237 | movingDirection.Normalize(); |
1240 | 1238 | ||
1239 | // If the vehicle is going backward, it is still pointing forward | ||
1240 | movingDirection *= Math.Sign(VehicleForwardSpeed); | ||
1241 | |||
1241 | // The direction the vehicle is pointing | 1242 | // The direction the vehicle is pointing |
1242 | Vector3 pointingDirection = Vector3.UnitX * VehicleOrientation; | 1243 | Vector3 pointingDirection = Vector3.UnitX * VehicleOrientation; |
1243 | pointingDirection.Normalize(); | 1244 | pointingDirection.Normalize(); |
@@ -1246,6 +1247,9 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1246 | Vector3 deflectionError = movingDirection - pointingDirection; | 1247 | Vector3 deflectionError = movingDirection - pointingDirection; |
1247 | 1248 | ||
1248 | // Don't try to correct very large errors (not our job) | 1249 | // Don't try to correct very large errors (not our job) |
1250 | // if (Math.Abs(deflectionError.X) > PIOverFour) deflectionError.X = PIOverTwo * Math.Sign(deflectionError.X); | ||
1251 | // if (Math.Abs(deflectionError.Y) > PIOverFour) deflectionError.Y = PIOverTwo * Math.Sign(deflectionError.Y); | ||
1252 | // if (Math.Abs(deflectionError.Z) > PIOverFour) deflectionError.Z = PIOverTwo * Math.Sign(deflectionError.Z); | ||
1249 | if (Math.Abs(deflectionError.X) > PIOverFour) deflectionError.X = 0f; | 1253 | if (Math.Abs(deflectionError.X) > PIOverFour) deflectionError.X = 0f; |
1250 | if (Math.Abs(deflectionError.Y) > PIOverFour) deflectionError.Y = 0f; | 1254 | if (Math.Abs(deflectionError.Y) > PIOverFour) deflectionError.Y = 0f; |
1251 | if (Math.Abs(deflectionError.Z) > PIOverFour) deflectionError.Z = 0f; | 1255 | if (Math.Abs(deflectionError.Z) > PIOverFour) deflectionError.Z = 0f; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt index 794a6af..29bd4e4 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt | |||
@@ -1,9 +1,9 @@ | |||
1 | CURRENT PRIORITIES | 1 | CURRENT PRIORITIES |
2 | ================================================= | 2 | ================================================= |
3 | Avatars walking up stairs | 3 | Avatars walking up stairs (HALF DONE) |
4 | Vehicle movement on terrain smoothness | 4 | Vehicle movement on terrain smoothness |
5 | limitMotorUp calibration (more down?) | 5 | limitMotorUp calibration (more down?) |
6 | Preferred orientatino angular correction fix | 6 | Preferred orientation angular correction fix |
7 | Surfboard go wonky when turning | 7 | Surfboard go wonky when turning |
8 | Angular motor direction is global coordinates rather than local coordinates? | 8 | Angular motor direction is global coordinates rather than local coordinates? |
9 | Boats float low in the water | 9 | Boats float low in the water |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 79cec04..4bbcb7c 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -324,44 +324,44 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
324 | HandleShowStatus); | 324 | HandleShowStatus); |
325 | 325 | ||
326 | MainConsole.Instance.Commands.AddCommand( | 326 | MainConsole.Instance.Commands.AddCommand( |
327 | "Scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information", | 327 | "Scripts", false, "scripts show", "scripts show [<script-item-uuid>+]", "Show script information", |
328 | "Show information on all scripts known to the script engine.\n" | 328 | "Show information on all scripts known to the script engine.\n" |
329 | + "If a <script-item-uuid> is given then only information on that script will be shown.", | 329 | + "If one or more <script-item-uuid>s are given then only information on that script will be shown.", |
330 | HandleShowScripts); | 330 | HandleShowScripts); |
331 | 331 | ||
332 | MainConsole.Instance.Commands.AddCommand( | 332 | MainConsole.Instance.Commands.AddCommand( |
333 | "Scripts", false, "show scripts", "show scripts [<script-item-uuid>]", "Show script information", | 333 | "Scripts", false, "show scripts", "show scripts [<script-item-uuid>+]", "Show script information", |
334 | "Synonym for scripts show command", HandleShowScripts); | 334 | "Synonym for scripts show command", HandleShowScripts); |
335 | 335 | ||
336 | MainConsole.Instance.Commands.AddCommand( | 336 | MainConsole.Instance.Commands.AddCommand( |
337 | "Scripts", false, "scripts suspend", "scripts suspend [<script-item-uuid>]", "Suspends all running scripts", | 337 | "Scripts", false, "scripts suspend", "scripts suspend [<script-item-uuid>+]", "Suspends all running scripts", |
338 | "Suspends all currently running scripts. This only suspends event delivery, it will not suspend a" | 338 | "Suspends all currently running scripts. This only suspends event delivery, it will not suspend a" |
339 | + " script that is currently processing an event.\n" | 339 | + " script that is currently processing an event.\n" |
340 | + "Suspended scripts will continue to accumulate events but won't process them.\n" | 340 | + "Suspended scripts will continue to accumulate events but won't process them.\n" |
341 | + "If a <script-item-uuid> is given then only that script will be suspended. Otherwise, all suitable scripts are suspended.", | 341 | + "If one or more <script-item-uuid>s are given then only that script will be suspended. Otherwise, all suitable scripts are suspended.", |
342 | (module, cmdparams) => HandleScriptsAction(cmdparams, HandleSuspendScript)); | 342 | (module, cmdparams) => HandleScriptsAction(cmdparams, HandleSuspendScript)); |
343 | 343 | ||
344 | MainConsole.Instance.Commands.AddCommand( | 344 | MainConsole.Instance.Commands.AddCommand( |
345 | "Scripts", false, "scripts resume", "scripts resume [<script-item-uuid>]", "Resumes all suspended scripts", | 345 | "Scripts", false, "scripts resume", "scripts resume [<script-item-uuid>+]", "Resumes all suspended scripts", |
346 | "Resumes all currently suspended scripts.\n" | 346 | "Resumes all currently suspended scripts.\n" |
347 | + "Resumed scripts will process all events accumulated whilst suspended.\n" | 347 | + "Resumed scripts will process all events accumulated whilst suspended.\n" |
348 | + "If a <script-item-uuid> is given then only that script will be resumed. Otherwise, all suitable scripts are resumed.", | 348 | + "If one or more <script-item-uuid>s are given then only that script will be resumed. Otherwise, all suitable scripts are resumed.", |
349 | (module, cmdparams) => HandleScriptsAction(cmdparams, HandleResumeScript)); | 349 | (module, cmdparams) => HandleScriptsAction(cmdparams, HandleResumeScript)); |
350 | 350 | ||
351 | MainConsole.Instance.Commands.AddCommand( | 351 | MainConsole.Instance.Commands.AddCommand( |
352 | "Scripts", false, "scripts stop", "scripts stop [<script-item-uuid>]", "Stops all running scripts", | 352 | "Scripts", false, "scripts stop", "scripts stop [<script-item-uuid>+]", "Stops all running scripts", |
353 | "Stops all running scripts.\n" | 353 | "Stops all running scripts.\n" |
354 | + "If a <script-item-uuid> is given then only that script will be stopped. Otherwise, all suitable scripts are stopped.", | 354 | + "If one or more <script-item-uuid>s are given then only that script will be stopped. Otherwise, all suitable scripts are stopped.", |
355 | (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStopScript)); | 355 | (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStopScript)); |
356 | 356 | ||
357 | MainConsole.Instance.Commands.AddCommand( | 357 | MainConsole.Instance.Commands.AddCommand( |
358 | "Scripts", false, "scripts start", "scripts start [<script-item-uuid>]", "Starts all stopped scripts", | 358 | "Scripts", false, "scripts start", "scripts start [<script-item-uuid>+]", "Starts all stopped scripts", |
359 | "Starts all stopped scripts.\n" | 359 | "Starts all stopped scripts.\n" |
360 | + "If a <script-item-uuid> is given then only that script will be started. Otherwise, all suitable scripts are started.", | 360 | + "If one or more <script-item-uuid>s are given then only that script will be started. Otherwise, all suitable scripts are started.", |
361 | (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStartScript)); | 361 | (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStartScript)); |
362 | 362 | ||
363 | MainConsole.Instance.Commands.AddCommand( | 363 | MainConsole.Instance.Commands.AddCommand( |
364 | "Scripts", false, "debug script log", "debug scripts log <item-id> <log-level>", "Extra debug logging for a script", | 364 | "Scripts", false, "debug scripts log", "debug scripts log <item-id> <log-level>", "Extra debug logging for a script", |
365 | "Activates or deactivates extra debug logging for the given script.\n" | 365 | "Activates or deactivates extra debug logging for the given script.\n" |
366 | + "Level == 0, deactivate extra debug logging.\n" | 366 | + "Level == 0, deactivate extra debug logging.\n" |
367 | + "Level >= 1, log state changes.\n" | 367 | + "Level >= 1, log state changes.\n" |
@@ -478,29 +478,31 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
478 | return; | 478 | return; |
479 | } | 479 | } |
480 | 480 | ||
481 | rawItemId = cmdparams[2]; | 481 | for (int i = 2; i < cmdparams.Length; i++) |
482 | |||
483 | if (!UUID.TryParse(rawItemId, out itemId)) | ||
484 | { | 482 | { |
485 | MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid UUID", rawItemId); | 483 | rawItemId = cmdparams[i]; |
486 | return; | 484 | |
487 | } | 485 | if (!UUID.TryParse(rawItemId, out itemId)) |
488 | |||
489 | if (itemId != UUID.Zero) | ||
490 | { | ||
491 | IScriptInstance instance = GetInstance(itemId); | ||
492 | if (instance == null) | ||
493 | { | 486 | { |
494 | // Commented out for now since this will cause false reports on simulators with more than | 487 | MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid UUID", rawItemId); |
495 | // one scene where the current command line set region is 'root' (which causes commands to | 488 | continue; |
496 | // go to both regions... (sigh) | ||
497 | // MainConsole.Instance.OutputFormat("Error - No item found with id {0}", itemId); | ||
498 | return; | ||
499 | } | 489 | } |
500 | else | 490 | |
491 | if (itemId != UUID.Zero) | ||
501 | { | 492 | { |
502 | action(instance); | 493 | IScriptInstance instance = GetInstance(itemId); |
503 | return; | 494 | if (instance == null) |
495 | { | ||
496 | // Commented out for now since this will cause false reports on simulators with more than | ||
497 | // one scene where the current command line set region is 'root' (which causes commands to | ||
498 | // go to both regions... (sigh) | ||
499 | // MainConsole.Instance.OutputFormat("Error - No item found with id {0}", itemId); | ||
500 | continue; | ||
501 | } | ||
502 | else | ||
503 | { | ||
504 | action(instance); | ||
505 | } | ||
504 | } | 506 | } |
505 | } | 507 | } |
506 | } | 508 | } |