aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs33
1 files changed, 10 insertions, 23 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 0cfb5ff..a8ee20d 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Physics.OdePlugin
44 /// </summary> 44 /// </summary>
45 public class OdePlugin : IPhysicsPlugin 45 public class OdePlugin : IPhysicsPlugin
46 { 46 {
47 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 47 //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private CollisionLocker ode; 49 private CollisionLocker ode;
50 private OdeScene _mScene; 50 private OdeScene _mScene;
@@ -75,8 +75,6 @@ namespace OpenSim.Region.Physics.OdePlugin
75 75
76 public void Dispose() 76 public void Dispose()
77 { 77 {
78
79
80 } 78 }
81 } 79 }
82 80
@@ -324,7 +322,7 @@ namespace OpenSim.Region.Physics.OdePlugin
324 322
325 //if (id == d.GeomClassId.TriMeshClass) 323 //if (id == d.GeomClassId.TriMeshClass)
326 //{ 324 //{
327 // m_log.Info("near: A collision was detected between {1} and {2}", 0, name1, name2); 325 // m_log.InfoFormat("near: A collision was detected between {1} and {2}", 0, name1, name2);
328 //System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2); 326 //System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2);
329 //} 327 //}
330 328
@@ -357,7 +355,6 @@ namespace OpenSim.Region.Physics.OdePlugin
357 IntPtr joint; 355 IntPtr joint;
358 // If we're colliding with terrain, use 'TerrainContact' instead of contact. 356 // If we're colliding with terrain, use 'TerrainContact' instead of contact.
359 // allows us to have different settings 357 // allows us to have different settings
360
361 358
362 if (!actor_name_map.TryGetValue(g1, out p1)) 359 if (!actor_name_map.TryGetValue(g1, out p1))
363 { 360 {
@@ -371,7 +368,6 @@ namespace OpenSim.Region.Physics.OdePlugin
371 // We only need to test p2 for 'jump crouch purposes' 368 // We only need to test p2 for 'jump crouch purposes'
372 p2.IsColliding = true; 369 p2.IsColliding = true;
373 370
374
375 switch (p1.PhysicsActorType) 371 switch (p1.PhysicsActorType)
376 { 372 {
377 case (int)ActorTypes.Agent: 373 case (int)ActorTypes.Agent:
@@ -395,12 +391,12 @@ namespace OpenSim.Region.Physics.OdePlugin
395 391
396 if (contacts[i].depth >= 0.08f) 392 if (contacts[i].depth >= 0.08f)
397 { 393 {
398 //This is disabled at the moment only because it needs more tweaking 394 //This is disabled at the moment only because it needs more tweaking
399 //It will eventually be uncommented 395 //It will eventually be uncommented
400 396
401 if (contacts[i].depth >= 1.00f) 397 if (contacts[i].depth >= 1.00f)
402 { 398 {
403 //m_log.Debug("[PHYSICS]: " +contacts[i].depth.ToString()); 399 //m_log.Debug("[PHYSICS]: " + contacts[i].depth.ToString());
404 } 400 }
405 401
406 //If you interpenetrate a prim with an agent 402 //If you interpenetrate a prim with an agent
@@ -769,7 +765,6 @@ namespace OpenSim.Region.Physics.OdePlugin
769 // If the geometry is in the targetspace, remove it from the target space 765 // If the geometry is in the targetspace, remove it from the target space
770 //m_log.Warn(prim.m_targetSpace); 766 //m_log.Warn(prim.m_targetSpace);
771 767
772
773 //if (prim.m_targetSpace != (IntPtr)0) 768 //if (prim.m_targetSpace != (IntPtr)0)
774 //{ 769 //{
775 if (d.SpaceQuery(prim.m_targetSpace, prim.prim_geom)) 770 if (d.SpaceQuery(prim.m_targetSpace, prim.prim_geom))
@@ -832,12 +827,10 @@ namespace OpenSim.Region.Physics.OdePlugin
832 //} 827 //}
833 } 828 }
834 829
835
836
837 ode.dunlock(world); 830 ode.dunlock(world);
838
839 } 831 }
840 } 832 }
833
841 /// <summary> 834 /// <summary>
842 /// Takes a space pointer and zeros out the array we're using to hold the spaces 835 /// Takes a space pointer and zeros out the array we're using to hold the spaces
843 /// </summary> 836 /// </summary>
@@ -914,7 +907,6 @@ namespace OpenSim.Region.Physics.OdePlugin
914 } 907 }
915 } 908 }
916 909
917
918 //If there are no more geometries in the sub-space, we don't need it in the main space anymore 910 //If there are no more geometries in the sub-space, we don't need it in the main space anymore
919 if (d.SpaceGetNumGeoms(currentspace) == 0) 911 if (d.SpaceGetNumGeoms(currentspace) == 0)
920 { 912 {
@@ -980,7 +972,6 @@ namespace OpenSim.Region.Physics.OdePlugin
980 } 972 }
981 } 973 }
982 974
983
984 // The routines in the Position and Size sections do the 'inserting' into the space, 975 // The routines in the Position and Size sections do the 'inserting' into the space,
985 // so all we have to do is make sure that the space that we're putting the prim into 976 // so all we have to do is make sure that the space that we're putting the prim into
986 // is in the 'main' space. 977 // is in the 'main' space.
@@ -1111,7 +1102,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1111 name2 = "null"; 1102 name2 = "null";
1112 } 1103 }
1113 1104
1114 m_log.Info("TriArrayCallback: A collision was detected between {1} and {2}", 0, name1, name2); 1105 m_log.InfoFormat("TriArrayCallback: A collision was detected between {1} and {2}", 0, name1, name2);
1115*/ 1106*/
1116 return 1; 1107 return 1;
1117 } 1108 }
@@ -1131,14 +1122,14 @@ namespace OpenSim.Region.Physics.OdePlugin
1131 name2 = "null"; 1122 name2 = "null";
1132 } 1123 }
1133 1124
1134// m_log.Info("TriCallback: A collision was detected between {1} and {2}. Index was {3}", 0, name1, name2, triangleIndex); 1125// m_log.InfoFormat("TriCallback: A collision was detected between {1} and {2}. Index was {3}", 0, name1, name2, triangleIndex);
1135 1126
1136 d.Vector3 v0 = new d.Vector3(); 1127 d.Vector3 v0 = new d.Vector3();
1137 d.Vector3 v1 = new d.Vector3(); 1128 d.Vector3 v1 = new d.Vector3();
1138 d.Vector3 v2 = new d.Vector3(); 1129 d.Vector3 v2 = new d.Vector3();
1139 1130
1140 d.GeomTriMeshGetTriangle(trimesh, 0, ref v0, ref v1, ref v2); 1131 d.GeomTriMeshGetTriangle(trimesh, 0, ref v0, ref v1, ref v2);
1141// m_log.Debug("Triangle {0} is <{1},{2},{3}>, <{4},{5},{6}>, <{7},{8},{9}>", triangleIndex, v0.X, v0.Y, v0.Z, v1.X, v1.Y, v1.Z, v2.X, v2.Y, v2.Z); 1132// m_log.DebugFormat("Triangle {0} is <{1},{2},{3}>, <{4},{5},{6}>, <{7},{8},{9}>", triangleIndex, v0.X, v0.Y, v0.Z, v1.X, v1.Y, v1.Z, v2.X, v2.Y, v2.Z);
1142 1133
1143 return 1; 1134 return 1;
1144 } 1135 }
@@ -1282,10 +1273,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1282 foreach (OdeCharacter actor in _characters) 1273 foreach (OdeCharacter actor in _characters)
1283 { 1274 {
1284 actor.Move(timeStep); 1275 actor.Move(timeStep);
1285
1286 } 1276 }
1287 1277
1288
1289 collision_optimized(timeStep); 1278 collision_optimized(timeStep);
1290 1279
1291 d.WorldQuickStep(world, ODE_STEPSIZE); 1280 d.WorldQuickStep(world, ODE_STEPSIZE);
@@ -1299,9 +1288,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1299 ode.dunlock(world); 1288 ode.dunlock(world);
1300 } 1289 }
1301 1290
1302
1303
1304
1305 step_time -= ODE_STEPSIZE; 1291 step_time -= ODE_STEPSIZE;
1306 i++; 1292 i++;
1307 } 1293 }
@@ -1691,6 +1677,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1691 public override void DeleteTerrain() 1677 public override void DeleteTerrain()
1692 { 1678 {
1693 } 1679 }
1680
1694 public override void Dispose() 1681 public override void Dispose()
1695 { 1682 {
1696 lock (OdeLock) 1683 lock (OdeLock)