aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-10-16 03:32:30 -0400
committerTeravus Ovares (Dan Olivares)2009-10-16 03:32:30 -0400
commitac2f98b846eba85ab3d9acb5bd0f355a404de86c (patch)
tree30cd43aeb953adaff3f9d833d4c1b05cbb61a135 /OpenSim/Region/Physics/OdePlugin
parentminor: Change commented out authentication service realm setting to "users" t... (diff)
downloadopensim-SC-ac2f98b846eba85ab3d9acb5bd0f355a404de86c.zip
opensim-SC-ac2f98b846eba85ab3d9acb5bd0f355a404de86c.tar.gz
opensim-SC-ac2f98b846eba85ab3d9acb5bd0f355a404de86c.tar.bz2
opensim-SC-ac2f98b846eba85ab3d9acb5bd0f355a404de86c.tar.xz
* A hacky attempt at resolving mantis #4260. I think ODE was unable to allocate memory, and therefore the unmanaged wrapper call fails or worse.. there's some unmanaged resource accounting in the ODEPlugin for ODECharacter that isn't being done properly now.
* The broken avatar may not be able to move, but it won't stop simulate from pressing on now. And, the simulator will try to destroy the avatar's physics proxy and recreate it again... but if this is what I think it is, it may not help.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs24
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index bd81d50..bd05c92 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -1105,7 +1105,18 @@ namespace OpenSim.Region.Physics.OdePlugin
1105 public void UpdatePositionAndVelocity() 1105 public void UpdatePositionAndVelocity()
1106 { 1106 {
1107 // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! 1107 // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit!
1108 d.Vector3 vec = d.BodyGetPosition(Body); 1108 d.Vector3 vec;
1109 try
1110 {
1111 vec = d.BodyGetPosition(Body);
1112 //throw new NullReferenceException("foo!");
1113 }
1114 catch (NullReferenceException)
1115 {
1116 vec = new d.Vector3(Position.X, Position.Y, Position.Z);
1117 base.RaiseOutOfBounds(_position);
1118 }
1119
1109 1120
1110 // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) 1121 // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!)
1111 if (vec.X < 0.0f) vec.X = 0.0f; 1122 if (vec.X < 0.0f) vec.X = 0.0f;
@@ -1137,7 +1148,16 @@ namespace OpenSim.Region.Physics.OdePlugin
1137 else 1148 else
1138 { 1149 {
1139 m_lastUpdateSent = false; 1150 m_lastUpdateSent = false;
1140 vec = d.BodyGetLinearVel(Body); 1151 try
1152 {
1153 vec = d.BodyGetLinearVel(Body);
1154 }
1155 catch (NullReferenceException)
1156 {
1157 vec.X = _velocity.X;
1158 vec.Y = _velocity.Y;
1159 vec.Z = _velocity.Z;
1160 }
1141 _velocity.X = (vec.X); 1161 _velocity.X = (vec.X);
1142 _velocity.Y = (vec.Y); 1162 _velocity.Y = (vec.Y);
1143 1163