diff options
author | Justin Clark-Casey (justincc) | 2011-09-16 23:57:16 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-09-16 23:57:16 +0100 |
commit | 6f542f73d4aacc0b92c2ebcff84b4ce2c8d9433b (patch) | |
tree | a7656d5ec25d54ba2a5d50efda269de8e3129cb1 /OpenSim/Region/Physics | |
parent | minor: I was wrong about OffsetPosition - sometimes it genuinely does return ... (diff) | |
download | opensim-SC_OLD-6f542f73d4aacc0b92c2ebcff84b4ce2c8d9433b.zip opensim-SC_OLD-6f542f73d4aacc0b92c2ebcff84b4ce2c8d9433b.tar.gz opensim-SC_OLD-6f542f73d4aacc0b92c2ebcff84b4ce2c8d9433b.tar.bz2 opensim-SC_OLD-6f542f73d4aacc0b92c2ebcff84b4ce2c8d9433b.tar.xz |
Stop the avatar stalling on its first boarder cross when using the ODE plugin
When upgrading the previously child agent to a root, the code was setting the Size parameter on the ODECharacter PhysicsActor.
This in turn reset Velocity, which cause the border stall.
I'm fixing this by commenting out the Velocity = Vector3.Zero lines since they don't appear to play a useful purpose
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 0a0d13f..4cc8c59 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -464,10 +464,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
464 | m_pidControllerActive = true; | 464 | m_pidControllerActive = true; |
465 | 465 | ||
466 | Vector3 SetSize = value; | 466 | Vector3 SetSize = value; |
467 | m_tainted_CAPSULE_LENGTH = (SetSize.Z*1.15f) - CAPSULE_RADIUS*2.0f; | 467 | m_tainted_CAPSULE_LENGTH = (SetSize.Z * 1.15f) - CAPSULE_RADIUS * 2.0f; |
468 | //m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString()); | 468 | // m_log.Info("[SIZE]: " + CAPSULE_LENGTH); |
469 | 469 | ||
470 | Velocity = Vector3.Zero; | 470 | // If we reset velocity here, then an avatar stalls when it crosses a border for the first time |
471 | // (as the height of the new root agent is set). | ||
472 | // Velocity = Vector3.Zero; | ||
471 | 473 | ||
472 | _parent_scene.AddPhysicsActorTaint(this); | 474 | _parent_scene.AddPhysicsActorTaint(this); |
473 | } | 475 | } |
@@ -785,6 +787,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
785 | { | 787 | { |
786 | m_log.Warn("[PHYSICS]: Got a NaN velocity from Scene in a Character"); | 788 | m_log.Warn("[PHYSICS]: Got a NaN velocity from Scene in a Character"); |
787 | } | 789 | } |
790 | |||
791 | // m_log.DebugFormat("[PHYSICS]: Set target velocity of {0}", _target_velocity); | ||
788 | } | 792 | } |
789 | } | 793 | } |
790 | 794 | ||
@@ -1325,7 +1329,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1325 | { | 1329 | { |
1326 | if (Shell != IntPtr.Zero && Body != IntPtr.Zero && Amotor != IntPtr.Zero) | 1330 | if (Shell != IntPtr.Zero && Body != IntPtr.Zero && Amotor != IntPtr.Zero) |
1327 | { | 1331 | { |
1328 | 1332 | // m_log.DebugFormat("[PHYSICS]: Changing capsule size"); | |
1333 | |||
1329 | m_pidControllerActive = true; | 1334 | m_pidControllerActive = true; |
1330 | // no lock needed on _parent_scene.OdeLock because we are called from within the thread lock in OdePlugin's simulate() | 1335 | // no lock needed on _parent_scene.OdeLock because we are called from within the thread lock in OdePlugin's simulate() |
1331 | d.JointDestroy(Amotor); | 1336 | d.JointDestroy(Amotor); |
@@ -1336,7 +1341,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1336 | d.GeomDestroy(Shell); | 1341 | d.GeomDestroy(Shell); |
1337 | AvatarGeomAndBodyCreation(_position.X, _position.Y, | 1342 | AvatarGeomAndBodyCreation(_position.X, _position.Y, |
1338 | _position.Z + (Math.Abs(CAPSULE_LENGTH - prevCapsule) * 2), m_tensor); | 1343 | _position.Z + (Math.Abs(CAPSULE_LENGTH - prevCapsule) * 2), m_tensor); |
1339 | Velocity = Vector3.Zero; | 1344 | |
1345 | // As with Size, we reset velocity. However, this isn't strictly necessary since it doesn't | ||
1346 | // appear to stall initial region crossings when done here. Being done for consistency. | ||
1347 | // Velocity = Vector3.Zero; | ||
1340 | 1348 | ||
1341 | _parent_scene.geom_name_map[Shell] = m_name; | 1349 | _parent_scene.geom_name_map[Shell] = m_name; |
1342 | _parent_scene.actor_name_map[Shell] = (PhysicsActor)this; | 1350 | _parent_scene.actor_name_map[Shell] = (PhysicsActor)this; |
@@ -1361,7 +1369,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1361 | _position.Z = m_taintPosition.Z; | 1369 | _position.Z = m_taintPosition.Z; |
1362 | } | 1370 | } |
1363 | } | 1371 | } |
1364 | |||
1365 | } | 1372 | } |
1366 | 1373 | ||
1367 | internal void AddCollisionFrameTime(int p) | 1374 | internal void AddCollisionFrameTime(int p) |