diff options
author | Justin Clark-Casey (justincc) | 2011-11-21 19:06:53 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-21 19:06:53 +0000 |
commit | 4faac1f090b668274e9a07356b8a093d1b662b7e (patch) | |
tree | e7206f399c93ddf8a7e6b9d2974256e351870a14 | |
parent | When an ODECharacter is removed (e.g. when an avatar leaves a scene), remove ... (diff) | |
download | opensim-SC-4faac1f090b668274e9a07356b8a093d1b662b7e.zip opensim-SC-4faac1f090b668274e9a07356b8a093d1b662b7e.tar.gz opensim-SC-4faac1f090b668274e9a07356b8a093d1b662b7e.tar.bz2 opensim-SC-4faac1f090b668274e9a07356b8a093d1b662b7e.tar.xz |
When changing avatar size in ODE, remove the old actor from the name and actor maps
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 4 |
2 files changed, 14 insertions, 8 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 ":"")); |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 9dee07b..d5c3250 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |||
@@ -243,7 +243,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
243 | /// Maps a unique geometry id (a memory location) to a physics actor name. | 243 | /// Maps a unique geometry id (a memory location) to a physics actor name. |
244 | /// </summary> | 244 | /// </summary> |
245 | /// <remarks> | 245 | /// <remarks> |
246 | /// Only actors participating in collisions have geometries. | 246 | /// Only actors participating in collisions have geometries. This has to be maintained separately from |
247 | /// actor_name_map because terrain and water currently don't conceptually have a physics actor of their own | ||
248 | /// apart from the singleton PANull | ||
247 | /// </remarks> | 249 | /// </remarks> |
248 | public Dictionary<IntPtr, String> geom_name_map = new Dictionary<IntPtr, String>(); | 250 | public Dictionary<IntPtr, String> geom_name_map = new Dictionary<IntPtr, String>(); |
249 | 251 | ||