aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
diff options
context:
space:
mode:
authorUbitUmarov2019-01-29 13:49:29 +0000
committerUbitUmarov2019-01-29 13:49:29 +0000
commit6bc8e2413f2780fe4ce071a589a9d16efeaf2265 (patch)
treebf3d1cf99b49391cf869854f57a0cba384a45565 /OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
parentmantis 8457: ok ok shutup the warning (diff)
downloadopensim-SC-6bc8e2413f2780fe4ce071a589a9d16efeaf2265.zip
opensim-SC-6bc8e2413f2780fe4ce071a589a9d16efeaf2265.tar.gz
opensim-SC-6bc8e2413f2780fe4ce071a589a9d16efeaf2265.tar.bz2
opensim-SC-6bc8e2413f2780fe4ce071a589a9d16efeaf2265.tar.xz
ubode replace a locklessqueue by .net concurrentqueue
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs60
1 files changed, 30 insertions, 30 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
index 5242399..5320912 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
@@ -1143,7 +1143,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1143 /// This is the avatar's movement control + PID Controller 1143 /// This is the avatar's movement control + PID Controller
1144 /// </summary> 1144 /// </summary>
1145 /// <param name="timeStep"></param> 1145 /// <param name="timeStep"></param>
1146 public void Move(List<OdeCharacter> defects) 1146 public void Move()
1147 { 1147 {
1148 if(Body == IntPtr.Zero) 1148 if(Body == IntPtr.Zero)
1149 return; 1149 return;
@@ -1180,40 +1180,50 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1180 _zeroPosition = localpos; 1180 _zeroPosition = localpos;
1181 } 1181 }
1182 1182
1183 if(!localpos.IsFinite())
1184 {
1185 m_log.Warn("[PHYSICS]: Avatar Position is non-finite!");
1186 defects.Add(this);
1187 // _parent_scene.RemoveCharacter(this);
1188
1189 // destroy avatar capsule and related ODE data
1190 AvatarGeomAndBodyDestroy();
1191 return;
1192 }
1193
1194 // check outbounds forcing to be in world 1183 // check outbounds forcing to be in world
1195 bool fixbody = false; 1184 bool fixbody = false;
1196 if(localpos.X < 0.0f) 1185 float tmp = localpos.X;
1186 if ((Single.IsNaN(tmp) || Single.IsInfinity(tmp)))
1187 {
1188 fixbody = true;
1189 localpos.X = 128f;
1190 }
1191 else if (tmp < 0.0f)
1197 { 1192 {
1198 fixbody = true; 1193 fixbody = true;
1199 localpos.X = 0.1f; 1194 localpos.X = 0.1f;
1200 } 1195 }
1201 else if(localpos.X > m_parent_scene.WorldExtents.X - 0.1f) 1196 else if (tmp > m_parent_scene.WorldExtents.X - 0.1f)
1202 { 1197 {
1203 fixbody = true; 1198 fixbody = true;
1204 localpos.X = m_parent_scene.WorldExtents.X - 0.1f; 1199 localpos.X = m_parent_scene.WorldExtents.X - 0.1f;
1205 } 1200 }
1206 if(localpos.Y < 0.0f) 1201
1202 tmp = localpos.Y;
1203 if ((Single.IsNaN(tmp) || Single.IsInfinity(tmp)))
1204 {
1205 fixbody = true;
1206 localpos.X = 128f;
1207 }
1208 else if (tmp < 0.0f)
1207 { 1209 {
1208 fixbody = true; 1210 fixbody = true;
1209 localpos.Y = 0.1f; 1211 localpos.Y = 0.1f;
1210 } 1212 }
1211 else if(localpos.Y > m_parent_scene.WorldExtents.Y - 0.1) 1213 else if(tmp > m_parent_scene.WorldExtents.Y - 0.1)
1212 { 1214 {
1213 fixbody = true; 1215 fixbody = true;
1214 localpos.Y = m_parent_scene.WorldExtents.Y - 0.1f; 1216 localpos.Y = m_parent_scene.WorldExtents.Y - 0.1f;
1215 } 1217 }
1216 if(fixbody) 1218
1219 tmp = localpos.Z;
1220 if ((Single.IsNaN(tmp) || Single.IsInfinity(tmp)))
1221 {
1222 fixbody = true;
1223 localpos.Z = 128f;
1224 }
1225
1226 if (fixbody)
1217 { 1227 {
1218 m_freemove = false; 1228 m_freemove = false;
1219 SafeNativeMethods.BodySetPosition(Body,localpos.X,localpos.Y,localpos.Z); 1229 SafeNativeMethods.BodySetPosition(Body,localpos.X,localpos.Y,localpos.Z);
@@ -1387,7 +1397,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1387 _zeroFlag = false; 1397 _zeroFlag = false;
1388 fz /= m_PIDHoverTau; 1398 fz /= m_PIDHoverTau;
1389 1399
1390 float tmp = Math.Abs(fz); 1400 tmp = Math.Abs(fz);
1391 if(tmp > 50) 1401 if(tmp > 50)
1392 fz = 50 * Math.Sign(fz); 1402 fz = 50 * Math.Sign(fz);
1393 else if(tmp < 0.1) 1403 else if(tmp < 0.1)
@@ -1573,20 +1583,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1573 1583
1574 if(vec.IsFinite()) 1584 if(vec.IsFinite())
1575 { 1585 {
1576 if(vec.X != 0 || vec.Y !=0 || vec.Z !=0) 1586 if((vec.X != 0 || vec.Y !=0 || vec.Z !=0))
1577 SafeNativeMethods.BodyAddForce(Body,vec.X,vec.Y,vec.Z); 1587 SafeNativeMethods.BodyAddForce(Body,vec.X,vec.Y,vec.Z);
1578 } 1588 }
1579 else 1589
1580 {
1581 m_log.Warn("[PHYSICS]: Got a NaN force vector in Move()");
1582 m_log.Warn("[PHYSICS]: Avatar Position is non-finite!");
1583 defects.Add(this);
1584 // _parent_scene.RemoveCharacter(this);
1585 // destroy avatar capsule and related ODE data
1586 AvatarGeomAndBodyDestroy();
1587 return;
1588 }
1589
1590 // update our local ideia of position velocity and aceleration 1590 // update our local ideia of position velocity and aceleration
1591 // _position = localpos; 1591 // _position = localpos;
1592 _position = localpos; 1592 _position = localpos;