aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-21 19:06:53 +0000
committerJustin Clark-Casey (justincc)2011-11-21 19:06:53 +0000
commit4faac1f090b668274e9a07356b8a093d1b662b7e (patch)
treee7206f399c93ddf8a7e6b9d2974256e351870a14 /OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
parentWhen an ODECharacter is removed (e.g. when an avatar leaves a scene), remove ... (diff)
downloadopensim-SC_OLD-4faac1f090b668274e9a07356b8a093d1b662b7e.zip
opensim-SC_OLD-4faac1f090b668274e9a07356b8a093d1b662b7e.tar.gz
opensim-SC_OLD-4faac1f090b668274e9a07356b8a093d1b662b7e.tar.bz2
opensim-SC_OLD-4faac1f090b668274e9a07356b8a093d1b662b7e.tar.xz
When changing avatar size in ODE, remove the old actor from the name and actor maps
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODECharacter.cs')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs18
1 files changed, 11 insertions, 7 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 3e7fadf..efe3b7e 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -526,7 +526,6 @@ namespace OpenSim.Region.Physics.OdePlugin
526 } 526 }
527 } 527 }
528 528
529
530 // movementVector.Z is zero 529 // movementVector.Z is zero
531 530
532 // calculate tilt components based on desired amount of tilt and current (snapped) heading. 531 // calculate tilt components based on desired amount of tilt and current (snapped) heading.
@@ -1291,16 +1290,21 @@ namespace OpenSim.Region.Physics.OdePlugin
1291 { 1290 {
1292 if (Shell != IntPtr.Zero && Body != IntPtr.Zero && Amotor != IntPtr.Zero) 1291 if (Shell != IntPtr.Zero && Body != IntPtr.Zero && Amotor != IntPtr.Zero)
1293 { 1292 {
1294// m_log.DebugFormat("[PHYSICS]: Changing capsule size"); 1293// m_log.DebugFormat(
1294// "[ODE CHARACTER]: Changing capsule size from {0} to {1} for {2}",
1295// CAPSULE_LENGTH, m_tainted_CAPSULE_LENGTH, Name);
1295 1296
1296 m_pidControllerActive = true; 1297 m_pidControllerActive = true;
1298
1299 _parent_scene.geom_name_map.Remove(Shell);
1300 _parent_scene.actor_name_map.Remove(Shell);
1301
1297 // no lock needed on _parent_scene.OdeLock because we are called from within the thread lock in OdePlugin's simulate() 1302 // no lock needed on _parent_scene.OdeLock because we are called from within the thread lock in OdePlugin's simulate()
1298 d.JointDestroy(Amotor); 1303 DestroyOdeStructures();
1304
1299 float prevCapsule = CAPSULE_LENGTH; 1305 float prevCapsule = CAPSULE_LENGTH;
1300 CAPSULE_LENGTH = m_tainted_CAPSULE_LENGTH; 1306 CAPSULE_LENGTH = m_tainted_CAPSULE_LENGTH;
1301 //m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString()); 1307
1302 d.BodyDestroy(Body);
1303 d.GeomDestroy(Shell);
1304 AvatarGeomAndBodyCreation( 1308 AvatarGeomAndBodyCreation(
1305 _position.X, 1309 _position.X,
1306 _position.Y, 1310 _position.Y,
@@ -1315,7 +1319,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1315 } 1319 }
1316 else 1320 else
1317 { 1321 {
1318 m_log.Warn("[PHYSICS]: trying to change capsule size, but the following ODE data is missing - " 1322 m_log.Warn("[ODE CHARACTER]: trying to change capsule size, but the following ODE data is missing - "
1319 + (Shell==IntPtr.Zero ? "Shell ":"") 1323 + (Shell==IntPtr.Zero ? "Shell ":"")
1320 + (Body==IntPtr.Zero ? "Body ":"") 1324 + (Body==IntPtr.Zero ? "Body ":"")
1321 + (Amotor==IntPtr.Zero ? "Amotor ":"")); 1325 + (Amotor==IntPtr.Zero ? "Amotor ":""));