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 | |
parent | minor: I was wrong about OffsetPosition - sometimes it genuinely does return ... (diff) | |
download | opensim-SC-6f542f73d4aacc0b92c2ebcff84b4ce2c8d9433b.zip opensim-SC-6f542f73d4aacc0b92c2ebcff84b4ce2c8d9433b.tar.gz opensim-SC-6f542f73d4aacc0b92c2ebcff84b4ce2c8d9433b.tar.bz2 opensim-SC-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 '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 19 |
2 files changed, 23 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 81475b8..0fc85b9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -469,6 +469,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
469 | if (actor != null) | 469 | if (actor != null) |
470 | { | 470 | { |
471 | m_pos = actor.Position; | 471 | m_pos = actor.Position; |
472 | |||
473 | // m_log.DebugFormat( | ||
474 | // "[SCENE PRESENCE]: Set position {0} for {1} in {2} via getting AbsolutePosition!", | ||
475 | // m_pos, Name, Scene.RegionInfo.RegionName); | ||
472 | } | 476 | } |
473 | else | 477 | else |
474 | { | 478 | { |
@@ -544,8 +548,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
544 | { | 548 | { |
545 | PhysicsActor actor = m_physicsActor; | 549 | PhysicsActor actor = m_physicsActor; |
546 | if (actor != null) | 550 | if (actor != null) |
551 | { | ||
547 | m_velocity = actor.Velocity; | 552 | m_velocity = actor.Velocity; |
548 | 553 | ||
554 | // m_log.DebugFormat( | ||
555 | // "[SCENE PRESENCE]: Set velocity {0} for {1} in {2} via getting Velocity!", | ||
556 | // m_velocity, Name, Scene.RegionInfo.RegionName); | ||
557 | } | ||
558 | |||
549 | return m_velocity; | 559 | return m_velocity; |
550 | } | 560 | } |
551 | set | 561 | set |
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) |