diff options
author | Justin Clark-Casey (justincc) | 2011-11-21 19:30:21 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-21 19:31:29 +0000 |
commit | 3becda919e0cb82e29742c50923f1b72c1a02241 (patch) | |
tree | 22ff3bd37b114da1b8f80a7f4c4e836ca9a4d7c7 /OpenSim/Region/Physics | |
parent | When changing avatar size in ODE, remove the old actor from the name and acto... (diff) | |
download | opensim-SC_OLD-3becda919e0cb82e29742c50923f1b72c1a02241.zip opensim-SC_OLD-3becda919e0cb82e29742c50923f1b72c1a02241.tar.gz opensim-SC_OLD-3becda919e0cb82e29742c50923f1b72c1a02241.tar.bz2 opensim-SC_OLD-3becda919e0cb82e29742c50923f1b72c1a02241.tar.xz |
move geom/actor map maintenance into DestroyODEStructures()/AvatarGeomAndBodyCreation().
This saves us having to do it separately when a character capsule size is changed
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 17 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 2 |
2 files changed, 9 insertions, 10 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index efe3b7e..0f1a897 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -655,6 +655,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
655 | // | 655 | // |
656 | //m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22); | 656 | //m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22); |
657 | //standupStraight(); | 657 | //standupStraight(); |
658 | |||
659 | _parent_scene.geom_name_map[Shell] = Name; | ||
660 | _parent_scene.actor_name_map[Shell] = this; | ||
658 | } | 661 | } |
659 | 662 | ||
660 | /// <summary> | 663 | /// <summary> |
@@ -896,7 +899,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
896 | 899 | ||
897 | if (!localPos.IsFinite()) | 900 | if (!localPos.IsFinite()) |
898 | { | 901 | { |
899 | m_log.Warn("[PHYSICS]: Avatar Position is non-finite!"); | 902 | m_log.WarnFormat("[PHYSICS]: Avatar Position of {0} is non-finite!", Name); |
900 | 903 | ||
901 | defects.Add(this); | 904 | defects.Add(this); |
902 | // _parent_scene.RemoveCharacter(this); | 905 | // _parent_scene.RemoveCharacter(this); |
@@ -1059,9 +1062,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1059 | { | 1062 | { |
1060 | bad = true; | 1063 | bad = true; |
1061 | _parent_scene.BadCharacter(this); | 1064 | _parent_scene.BadCharacter(this); |
1065 | DestroyOdeStructures(); | ||
1062 | newPos = new d.Vector3(_position.X, _position.Y, _position.Z); | 1066 | newPos = new d.Vector3(_position.X, _position.Y, _position.Z); |
1063 | base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! | 1067 | base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! |
1064 | m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar {0}, physical actor {1}", Name, m_uuid); | 1068 | m_log.WarnFormat("[ODE CHARACTER]: Avatar Null reference for Avatar {0}, physical actor {1}", Name, m_uuid); |
1065 | } | 1069 | } |
1066 | 1070 | ||
1067 | // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) | 1071 | // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) |
@@ -1164,6 +1168,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1164 | if (Shell != IntPtr.Zero) | 1168 | if (Shell != IntPtr.Zero) |
1165 | { | 1169 | { |
1166 | d.GeomDestroy(Shell); | 1170 | d.GeomDestroy(Shell); |
1171 | _parent_scene.geom_name_map.Remove(Shell); | ||
1172 | _parent_scene.actor_name_map.Remove(Shell); | ||
1173 | |||
1167 | Shell = IntPtr.Zero; | 1174 | Shell = IntPtr.Zero; |
1168 | } | 1175 | } |
1169 | } | 1176 | } |
@@ -1296,9 +1303,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1296 | 1303 | ||
1297 | m_pidControllerActive = true; | 1304 | m_pidControllerActive = true; |
1298 | 1305 | ||
1299 | _parent_scene.geom_name_map.Remove(Shell); | ||
1300 | _parent_scene.actor_name_map.Remove(Shell); | ||
1301 | |||
1302 | // no lock needed on _parent_scene.OdeLock because we are called from within the thread lock in OdePlugin's simulate() | 1306 | // no lock needed on _parent_scene.OdeLock because we are called from within the thread lock in OdePlugin's simulate() |
1303 | DestroyOdeStructures(); | 1307 | DestroyOdeStructures(); |
1304 | 1308 | ||
@@ -1313,9 +1317,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1313 | // As with Size, we reset velocity. However, this isn't strictly necessary since it doesn't | 1317 | // As with Size, we reset velocity. However, this isn't strictly necessary since it doesn't |
1314 | // appear to stall initial region crossings when done here. Being done for consistency. | 1318 | // appear to stall initial region crossings when done here. Being done for consistency. |
1315 | // Velocity = Vector3.Zero; | 1319 | // Velocity = Vector3.Zero; |
1316 | |||
1317 | _parent_scene.geom_name_map[Shell] = Name; | ||
1318 | _parent_scene.actor_name_map[Shell] = this; | ||
1319 | } | 1320 | } |
1320 | else | 1321 | else |
1321 | { | 1322 | { |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index d5c3250..05455dc 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |||
@@ -1716,8 +1716,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1716 | if (!_characters.Contains(chr)) | 1716 | if (!_characters.Contains(chr)) |
1717 | { | 1717 | { |
1718 | _characters.Add(chr); | 1718 | _characters.Add(chr); |
1719 | geom_name_map[chr.Shell] = Name; | ||
1720 | actor_name_map[chr.Shell] = chr; | ||
1721 | 1719 | ||
1722 | if (chr.bad) | 1720 | if (chr.bad) |
1723 | m_log.ErrorFormat("[PHYSICS] Added BAD actor {0} to characters list", chr.m_uuid); | 1721 | m_log.ErrorFormat("[PHYSICS] Added BAD actor {0} to characters list", chr.m_uuid); |