diff options
author | John Hurliman | 2009-10-16 10:09:19 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-16 10:09:19 -0700 |
commit | 06354a093d926e87236c5840e84f5ef9d518c1e0 (patch) | |
tree | ea9f00b5a4e979eb284cf941d0dfa3ceff648b4f /OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |
parent | Object update prioritization by Jim Greensky of Intel Labs, part one. This im... (diff) | |
parent | Merge branch 'master' of ssh://melanie@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-06354a093d926e87236c5840e84f5ef9d518c1e0.zip opensim-SC_OLD-06354a093d926e87236c5840e84f5ef9d518c1e0.tar.gz opensim-SC_OLD-06354a093d926e87236c5840e84f5ef9d518c1e0.tar.bz2 opensim-SC_OLD-06354a093d926e87236c5840e84f5ef9d518c1e0.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim into prioritization
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODECharacter.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index bd81d50..e5458d4 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -1105,7 +1105,19 @@ 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 | |||
1113 | } | ||
1114 | catch (NullReferenceException) | ||
1115 | { | ||
1116 | vec = new d.Vector3(_position.X, _position.Y, _position.Z); | ||
1117 | base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! | ||
1118 | m_log.WarnFormat("[ODEPLUGIN]: Avatar Null reference for Avatar: {0}", m_name); | ||
1119 | } | ||
1120 | |||
1109 | 1121 | ||
1110 | // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) | 1122 | // 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; | 1123 | if (vec.X < 0.0f) vec.X = 0.0f; |
@@ -1137,7 +1149,16 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1137 | else | 1149 | else |
1138 | { | 1150 | { |
1139 | m_lastUpdateSent = false; | 1151 | m_lastUpdateSent = false; |
1140 | vec = d.BodyGetLinearVel(Body); | 1152 | try |
1153 | { | ||
1154 | vec = d.BodyGetLinearVel(Body); | ||
1155 | } | ||
1156 | catch (NullReferenceException) | ||
1157 | { | ||
1158 | vec.X = _velocity.X; | ||
1159 | vec.Y = _velocity.Y; | ||
1160 | vec.Z = _velocity.Z; | ||
1161 | } | ||
1141 | _velocity.X = (vec.X); | 1162 | _velocity.X = (vec.X); |
1142 | _velocity.Y = (vec.Y); | 1163 | _velocity.Y = (vec.Y); |
1143 | 1164 | ||