diff options
author | Melanie | 2011-10-11 22:12:25 +0100 |
---|---|---|
committer | Melanie | 2011-10-11 22:12:25 +0100 |
commit | 341efb09420ff917e84e5342dd044611f22e8535 (patch) | |
tree | 45aaa42d946dcc671c9749aa6376ee8b59435e44 /OpenSim/Region/Physics | |
parent | Merge commit 'adfe713b4340771eee15371dd1216527b5662545' into bigmerge (diff) | |
parent | Stop the avatar stalling on its first boarder cross when using the ODE plugin (diff) | |
download | opensim-SC-341efb09420ff917e84e5342dd044611f22e8535.zip opensim-SC-341efb09420ff917e84e5342dd044611f22e8535.tar.gz opensim-SC-341efb09420ff917e84e5342dd044611f22e8535.tar.bz2 opensim-SC-341efb09420ff917e84e5342dd044611f22e8535.tar.xz |
Merge commit '6f542f73d4aacc0b92c2ebcff84b4ce2c8d9433b' into bigmerge
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 c165a41..c26595c 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 | ||
@@ -1324,7 +1328,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1324 | { | 1328 | { |
1325 | if (Shell != IntPtr.Zero && Body != IntPtr.Zero && Amotor != IntPtr.Zero) | 1329 | if (Shell != IntPtr.Zero && Body != IntPtr.Zero && Amotor != IntPtr.Zero) |
1326 | { | 1330 | { |
1327 | 1331 | // m_log.DebugFormat("[PHYSICS]: Changing capsule size"); | |
1332 | |||
1328 | m_pidControllerActive = true; | 1333 | m_pidControllerActive = true; |
1329 | // no lock needed on _parent_scene.OdeLock because we are called from within the thread lock in OdePlugin's simulate() | 1334 | // no lock needed on _parent_scene.OdeLock because we are called from within the thread lock in OdePlugin's simulate() |
1330 | d.JointDestroy(Amotor); | 1335 | d.JointDestroy(Amotor); |
@@ -1335,7 +1340,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1335 | d.GeomDestroy(Shell); | 1340 | d.GeomDestroy(Shell); |
1336 | AvatarGeomAndBodyCreation(_position.X, _position.Y, | 1341 | AvatarGeomAndBodyCreation(_position.X, _position.Y, |
1337 | _position.Z + (Math.Abs(CAPSULE_LENGTH - prevCapsule) * 2), m_tensor); | 1342 | _position.Z + (Math.Abs(CAPSULE_LENGTH - prevCapsule) * 2), m_tensor); |
1338 | Velocity = Vector3.Zero; | 1343 | |
1344 | // As with Size, we reset velocity. However, this isn't strictly necessary since it doesn't | ||
1345 | // appear to stall initial region crossings when done here. Being done for consistency. | ||
1346 | // Velocity = Vector3.Zero; | ||
1339 | 1347 | ||
1340 | _parent_scene.geom_name_map[Shell] = m_name; | 1348 | _parent_scene.geom_name_map[Shell] = m_name; |
1341 | _parent_scene.actor_name_map[Shell] = (PhysicsActor)this; | 1349 | _parent_scene.actor_name_map[Shell] = (PhysicsActor)this; |
@@ -1360,7 +1368,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1360 | _position.Z = m_taintPosition.Z; | 1368 | _position.Z = m_taintPosition.Z; |
1361 | } | 1369 | } |
1362 | } | 1370 | } |
1363 | |||
1364 | } | 1371 | } |
1365 | 1372 | ||
1366 | internal void AddCollisionFrameTime(int p) | 1373 | internal void AddCollisionFrameTime(int p) |