diff options
author | Justin Clark-Casey (justincc) | 2011-11-21 20:17:36 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-21 20:17:36 +0000 |
commit | 25d9001de1225a7d1c938f440b43c37bcca0e69e (patch) | |
tree | ce2568beac7f84cc9102b25b979a3e280cd3cae5 /OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |
parent | don't lock OdeScene.contacts since only ever accessed by a single thread (diff) | |
download | opensim-SC_OLD-25d9001de1225a7d1c938f440b43c37bcca0e69e.zip opensim-SC_OLD-25d9001de1225a7d1c938f440b43c37bcca0e69e.tar.gz opensim-SC_OLD-25d9001de1225a7d1c938f440b43c37bcca0e69e.tar.bz2 opensim-SC_OLD-25d9001de1225a7d1c938f440b43c37bcca0e69e.tar.xz |
don't bother locking OdeScene._perloopContact in single threaded code
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/OdeScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 89 |
1 files changed, 42 insertions, 47 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 92dd2dd..897ab82 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |||
@@ -1247,69 +1247,64 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1247 | 1247 | ||
1248 | private bool checkDupe(d.ContactGeom contactGeom, int atype) | 1248 | private bool checkDupe(d.ContactGeom contactGeom, int atype) |
1249 | { | 1249 | { |
1250 | bool result = false; | ||
1251 | //return result; | ||
1252 | if (!m_filterCollisions) | 1250 | if (!m_filterCollisions) |
1253 | return false; | 1251 | return false; |
1252 | |||
1253 | bool result = false; | ||
1254 | 1254 | ||
1255 | ActorTypes at = (ActorTypes)atype; | 1255 | ActorTypes at = (ActorTypes)atype; |
1256 | lock (_perloopContact) | 1256 | |
1257 | foreach (d.ContactGeom contact in _perloopContact) | ||
1257 | { | 1258 | { |
1258 | foreach (d.ContactGeom contact in _perloopContact) | 1259 | //if ((contact.g1 == contactGeom.g1 && contact.g2 == contactGeom.g2)) |
1260 | //{ | ||
1261 | // || (contact.g2 == contactGeom.g1 && contact.g1 == contactGeom.g2) | ||
1262 | if (at == ActorTypes.Agent) | ||
1259 | { | 1263 | { |
1260 | //if ((contact.g1 == contactGeom.g1 && contact.g2 == contactGeom.g2)) | 1264 | if (((Math.Abs(contactGeom.normal.X - contact.normal.X) < 1.026f) && (Math.Abs(contactGeom.normal.Y - contact.normal.Y) < 0.303f) && (Math.Abs(contactGeom.normal.Z - contact.normal.Z) < 0.065f)) && contactGeom.g1 != LandGeom && contactGeom.g2 != LandGeom) |
1261 | //{ | 1265 | { |
1262 | // || (contact.g2 == contactGeom.g1 && contact.g1 == contactGeom.g2) | 1266 | |
1263 | if (at == ActorTypes.Agent) | 1267 | if (Math.Abs(contact.depth - contactGeom.depth) < 0.052f) |
1264 | { | ||
1265 | if (((Math.Abs(contactGeom.normal.X - contact.normal.X) < 1.026f) && (Math.Abs(contactGeom.normal.Y - contact.normal.Y) < 0.303f) && (Math.Abs(contactGeom.normal.Z - contact.normal.Z) < 0.065f)) && contactGeom.g1 != LandGeom && contactGeom.g2 != LandGeom) | ||
1266 | { | 1268 | { |
1267 | 1269 | //contactGeom.depth *= .00005f; | |
1268 | if (Math.Abs(contact.depth - contactGeom.depth) < 0.052f) | 1270 | //m_log.DebugFormat("[Collsion]: Depth {0}", Math.Abs(contact.depth - contactGeom.depth)); |
1269 | { | 1271 | // m_log.DebugFormat("[Collision]: <{0},{1},{2}>", Math.Abs(contactGeom.normal.X - contact.normal.X), Math.Abs(contactGeom.normal.Y - contact.normal.Y), Math.Abs(contactGeom.normal.Z - contact.normal.Z)); |
1270 | //contactGeom.depth *= .00005f; | 1272 | result = true; |
1271 | //m_log.DebugFormat("[Collsion]: Depth {0}", Math.Abs(contact.depth - contactGeom.depth)); | 1273 | break; |
1272 | // m_log.DebugFormat("[Collision]: <{0},{1},{2}>", Math.Abs(contactGeom.normal.X - contact.normal.X), Math.Abs(contactGeom.normal.Y - contact.normal.Y), Math.Abs(contactGeom.normal.Z - contact.normal.Z)); | ||
1273 | result = true; | ||
1274 | break; | ||
1275 | } | ||
1276 | else | ||
1277 | { | ||
1278 | //m_log.DebugFormat("[Collsion]: Depth {0}", Math.Abs(contact.depth - contactGeom.depth)); | ||
1279 | } | ||
1280 | } | 1274 | } |
1281 | else | 1275 | else |
1282 | { | 1276 | { |
1283 | //m_log.DebugFormat("[Collision]: <{0},{1},{2}>", Math.Abs(contactGeom.normal.X - contact.normal.X), Math.Abs(contactGeom.normal.Y - contact.normal.Y), Math.Abs(contactGeom.normal.Z - contact.normal.Z)); | 1277 | //m_log.DebugFormat("[Collsion]: Depth {0}", Math.Abs(contact.depth - contactGeom.depth)); |
1284 | //int i = 0; | ||
1285 | } | 1278 | } |
1286 | } | 1279 | } |
1287 | else if (at == ActorTypes.Prim) | 1280 | else |
1288 | { | 1281 | { |
1289 | //d.AABB aabb1 = new d.AABB(); | 1282 | //m_log.DebugFormat("[Collision]: <{0},{1},{2}>", Math.Abs(contactGeom.normal.X - contact.normal.X), Math.Abs(contactGeom.normal.Y - contact.normal.Y), Math.Abs(contactGeom.normal.Z - contact.normal.Z)); |
1290 | //d.AABB aabb2 = new d.AABB(); | 1283 | //int i = 0; |
1284 | } | ||
1285 | } | ||
1286 | else if (at == ActorTypes.Prim) | ||
1287 | { | ||
1288 | //d.AABB aabb1 = new d.AABB(); | ||
1289 | //d.AABB aabb2 = new d.AABB(); | ||
1291 | 1290 | ||
1292 | //d.GeomGetAABB(contactGeom.g2, out aabb2); | 1291 | //d.GeomGetAABB(contactGeom.g2, out aabb2); |
1293 | //d.GeomGetAABB(contactGeom.g1, out aabb1); | 1292 | //d.GeomGetAABB(contactGeom.g1, out aabb1); |
1294 | //aabb1. | 1293 | //aabb1. |
1295 | if (((Math.Abs(contactGeom.normal.X - contact.normal.X) < 1.026f) && (Math.Abs(contactGeom.normal.Y - contact.normal.Y) < 0.303f) && (Math.Abs(contactGeom.normal.Z - contact.normal.Z) < 0.065f)) && contactGeom.g1 != LandGeom && contactGeom.g2 != LandGeom) | 1294 | if (((Math.Abs(contactGeom.normal.X - contact.normal.X) < 1.026f) && (Math.Abs(contactGeom.normal.Y - contact.normal.Y) < 0.303f) && (Math.Abs(contactGeom.normal.Z - contact.normal.Z) < 0.065f)) && contactGeom.g1 != LandGeom && contactGeom.g2 != LandGeom) |
1295 | { | ||
1296 | if (contactGeom.normal.X == contact.normal.X && contactGeom.normal.Y == contact.normal.Y && contactGeom.normal.Z == contact.normal.Z) | ||
1296 | { | 1297 | { |
1297 | if (contactGeom.normal.X == contact.normal.X && contactGeom.normal.Y == contact.normal.Y && contactGeom.normal.Z == contact.normal.Z) | 1298 | if (Math.Abs(contact.depth - contactGeom.depth) < 0.272f) |
1298 | { | 1299 | { |
1299 | if (Math.Abs(contact.depth - contactGeom.depth) < 0.272f) | 1300 | result = true; |
1300 | { | 1301 | break; |
1301 | result = true; | ||
1302 | break; | ||
1303 | } | ||
1304 | } | 1302 | } |
1305 | //m_log.DebugFormat("[Collsion]: Depth {0}", Math.Abs(contact.depth - contactGeom.depth)); | ||
1306 | //m_log.DebugFormat("[Collision]: <{0},{1},{2}>", Math.Abs(contactGeom.normal.X - contact.normal.X), Math.Abs(contactGeom.normal.Y - contact.normal.Y), Math.Abs(contactGeom.normal.Z - contact.normal.Z)); | ||
1307 | } | 1303 | } |
1308 | 1304 | //m_log.DebugFormat("[Collsion]: Depth {0}", Math.Abs(contact.depth - contactGeom.depth)); | |
1309 | } | 1305 | //m_log.DebugFormat("[Collision]: <{0},{1},{2}>", Math.Abs(contactGeom.normal.X - contact.normal.X), Math.Abs(contactGeom.normal.Y - contact.normal.Y), Math.Abs(contactGeom.normal.Z - contact.normal.Z)); |
1310 | 1306 | } | |
1311 | //} | 1307 | |
1312 | |||
1313 | } | 1308 | } |
1314 | } | 1309 | } |
1315 | 1310 | ||