diff options
author | UbitUmarov | 2015-11-21 02:14:19 +0000 |
---|---|---|
committer | UbitUmarov | 2015-11-21 02:14:19 +0000 |
commit | 0b36d4ea2f5977c5e1e7f0e3fcf890a66ff89348 (patch) | |
tree | c2aaf4d741063f02bf20a80b8a7465ec8d84548d /OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | |
parent | remove a warning (diff) | |
download | opensim-SC_OLD-0b36d4ea2f5977c5e1e7f0e3fcf890a66ff89348.zip opensim-SC_OLD-0b36d4ea2f5977c5e1e7f0e3fcf890a66ff89348.tar.gz opensim-SC_OLD-0b36d4ea2f5977c5e1e7f0e3fcf890a66ff89348.tar.bz2 opensim-SC_OLD-0b36d4ea2f5977c5e1e7f0e3fcf890a66ff89348.tar.xz |
some cleanup, allow cast rays to collide with terrain within limited range (old ode)
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 300 |
1 files changed, 2 insertions, 298 deletions
diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 6f14121..8b369c8 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | |||
@@ -58,16 +58,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
58 | End = 2 | 58 | End = 2 |
59 | } | 59 | } |
60 | 60 | ||
61 | // public struct sCollisionData | ||
62 | // { | ||
63 | // public uint ColliderLocalId; | ||
64 | // public uint CollidedWithLocalId; | ||
65 | // public int NumberOfCollisions; | ||
66 | // public int CollisionType; | ||
67 | // public int StatusIndicator; | ||
68 | // public int lastframe; | ||
69 | // } | ||
70 | |||
71 | [Flags] | 61 | [Flags] |
72 | public enum CollisionCategories : int | 62 | public enum CollisionCategories : int |
73 | { | 63 | { |
@@ -323,7 +313,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
323 | public bool IsAvCapsuleTilted { get; private set; } | 313 | public bool IsAvCapsuleTilted { get; private set; } |
324 | 314 | ||
325 | private float avDensity = 80f; | 315 | private float avDensity = 80f; |
326 | // private float avHeightFudgeFactor = 0.52f; | ||
327 | private float avMovementDivisorWalk = 1.3f; | 316 | private float avMovementDivisorWalk = 1.3f; |
328 | private float avMovementDivisorRun = 0.8f; | 317 | private float avMovementDivisorRun = 0.8f; |
329 | private float minimumGroundFlightOffset = 3f; | 318 | private float minimumGroundFlightOffset = 3f; |
@@ -346,7 +335,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
346 | 335 | ||
347 | public int bodyFramesAutoDisable = 20; | 336 | public int bodyFramesAutoDisable = 20; |
348 | 337 | ||
349 | private float[] _watermap; | ||
350 | private bool m_filterCollisions = true; | 338 | private bool m_filterCollisions = true; |
351 | 339 | ||
352 | private d.NearCallback nearCallback; | 340 | private d.NearCallback nearCallback; |
@@ -457,31 +445,21 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
457 | private d.Contact WaterContact; | 445 | private d.Contact WaterContact; |
458 | private d.Contact[,] m_materialContacts; | 446 | private d.Contact[,] m_materialContacts; |
459 | 447 | ||
460 | //Ckrinke: Comment out until used. We declare it, initialize it, but do not use it | ||
461 | //Ckrinke private int m_randomizeWater = 200; | ||
462 | private int m_physicsiterations = 10; | 448 | private int m_physicsiterations = 10; |
463 | private const float m_SkipFramesAtms = 0.40f; // Drop frames gracefully at a 400 ms lag | 449 | private const float m_SkipFramesAtms = 0.40f; // Drop frames gracefully at a 400 ms lag |
464 | private readonly PhysicsActor PANull = new NullPhysicsActor(); | 450 | private readonly PhysicsActor PANull = new NullPhysicsActor(); |
465 | private float step_time = 0.0f; | 451 | private float step_time = 0.0f; |
466 | //Ckrinke: Comment out until used. We declare it, initialize it, but do not use it | ||
467 | //Ckrinke private int ms = 0; | ||
468 | public IntPtr world; | 452 | public IntPtr world; |
469 | //private bool returncollisions = false; | ||
470 | // private uint obj1LocalID = 0; | ||
471 | private uint obj2LocalID = 0; | 453 | private uint obj2LocalID = 0; |
472 | //private int ctype = 0; | ||
473 | private OdeCharacter cc1; | 454 | private OdeCharacter cc1; |
474 | private OdePrim cp1; | 455 | private OdePrim cp1; |
475 | private OdeCharacter cc2; | 456 | private OdeCharacter cc2; |
476 | private OdePrim cp2; | 457 | private OdePrim cp2; |
477 | private int p1ExpectedPoints = 0; | 458 | private int p1ExpectedPoints = 0; |
478 | private int p2ExpectedPoints = 0; | 459 | private int p2ExpectedPoints = 0; |
479 | //private int cStartStop = 0; | ||
480 | //private string cDictKey = ""; | ||
481 | 460 | ||
482 | public IntPtr space; | 461 | public IntPtr space; |
483 | 462 | ||
484 | //private IntPtr tmpSpace; | ||
485 | // split static geometry collision handling into spaces of 30 meters | 463 | // split static geometry collision handling into spaces of 30 meters |
486 | public IntPtr[,] staticPrimspace; | 464 | public IntPtr[,] staticPrimspace; |
487 | 465 | ||
@@ -565,8 +543,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
565 | m_suportCombine = false; | 543 | m_suportCombine = false; |
566 | 544 | ||
567 | nearCallback = near; | 545 | nearCallback = near; |
568 | // triCallback = TriCallback; | ||
569 | // triArrayCallback = TriArrayCallback; | ||
570 | m_rayCastManager = new ODERayCastRequestManager(this); | 546 | m_rayCastManager = new ODERayCastRequestManager(this); |
571 | 547 | ||
572 | // Create the world and the first space | 548 | // Create the world and the first space |
@@ -576,11 +552,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
576 | contactgroup = d.JointGroupCreate(0); | 552 | contactgroup = d.JointGroupCreate(0); |
577 | 553 | ||
578 | d.WorldSetAutoDisableFlag(world, false); | 554 | d.WorldSetAutoDisableFlag(world, false); |
579 | |||
580 | // _watermap = new float[258 * 258]; | ||
581 | |||
582 | // Zero out the prim spaces array (we split our space into smaller spaces so | ||
583 | // we can hit test less. | ||
584 | } | 555 | } |
585 | 556 | ||
586 | // Initialize from configs | 557 | // Initialize from configs |
@@ -708,8 +679,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
708 | spaceGridMaxX--; | 679 | spaceGridMaxX--; |
709 | spaceGridMaxY--; | 680 | spaceGridMaxY--; |
710 | 681 | ||
711 | |||
712 | |||
713 | // Centeral contact friction and bounce | 682 | // Centeral contact friction and bounce |
714 | // ckrinke 11/10/08 Enabling soft_erp but not soft_cfm until I figure out why | 683 | // ckrinke 11/10/08 Enabling soft_erp but not soft_cfm until I figure out why |
715 | // an avatar falls through in Z but not in X or Y when walking on a prim. | 684 | // an avatar falls through in Z but not in X or Y when walking on a prim. |
@@ -884,9 +853,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
884 | d.WorldSetLinearDampingThreshold(world, 256f); | 853 | d.WorldSetLinearDampingThreshold(world, 256f); |
885 | d.WorldSetMaxAngularSpeed(world, 256f); | 854 | d.WorldSetMaxAngularSpeed(world, 256f); |
886 | 855 | ||
887 | // Set how many steps we go without running collision testing | ||
888 | // This is in addition to the step size. | ||
889 | // Essentially Steps * m_physicsiterations | ||
890 | d.WorldSetQuickStepNumIterations(world, m_physicsiterations); | 856 | d.WorldSetQuickStepNumIterations(world, m_physicsiterations); |
891 | //d.WorldSetContactMaxCorrectingVel(world, 1000.0f); | 857 | //d.WorldSetContactMaxCorrectingVel(world, 1000.0f); |
892 | 858 | ||
@@ -901,22 +867,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
901 | _worldInitialized = true; | 867 | _worldInitialized = true; |
902 | } | 868 | } |
903 | 869 | ||
904 | // internal void waitForSpaceUnlock(IntPtr space) | ||
905 | // { | ||
906 | // //if (space != IntPtr.Zero) | ||
907 | // //while (d.SpaceLockQuery(space)) { } // Wait and do nothing | ||
908 | // } | ||
909 | |||
910 | // /// <summary> | ||
911 | // /// Debug space message for printing the space that a prim/avatar is in. | ||
912 | // /// </summary> | ||
913 | // /// <param name="pos"></param> | ||
914 | // /// <returns>Returns which split up space the given position is in.</returns> | ||
915 | // public string whichspaceamIin(Vector3 pos) | ||
916 | // { | ||
917 | // return calculateSpaceForGeom(pos).ToString(); | ||
918 | // } | ||
919 | |||
920 | #region Collision Detection | 870 | #region Collision Detection |
921 | 871 | ||
922 | /// <summary> | 872 | /// <summary> |
@@ -1042,12 +992,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1042 | name2 = "null"; | 992 | name2 = "null"; |
1043 | } | 993 | } |
1044 | 994 | ||
1045 | //if (id == d.GeomClassId.TriMeshClass) | ||
1046 | //{ | ||
1047 | // m_log.InfoFormat("near: A collision was detected between {1} and {2}", 0, name1, name2); | ||
1048 | //m_log.Debug("near: A collision was detected between {1} and {2}", 0, name1, name2); | ||
1049 | //} | ||
1050 | |||
1051 | // Figure out how many contact points we have | 995 | // Figure out how many contact points we have |
1052 | int count = 0; | 996 | int count = 0; |
1053 | 997 | ||
@@ -1166,110 +1110,9 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1166 | // we don't want prim or avatar to explode | 1110 | // we don't want prim or avatar to explode |
1167 | 1111 | ||
1168 | #region InterPenetration Handling - Unintended physics explosions | 1112 | #region InterPenetration Handling - Unintended physics explosions |
1169 | # region disabled code1 | ||
1170 | 1113 | ||
1171 | if (curContact.depth >= 0.08f) | 1114 | if (curContact.depth >= 0.08f) |
1172 | { | 1115 | { |
1173 | //This is disabled at the moment only because it needs more tweaking | ||
1174 | //It will eventually be uncommented | ||
1175 | /* | ||
1176 | if (contact.depth >= 1.00f) | ||
1177 | { | ||
1178 | //m_log.Debug("[PHYSICS]: " + contact.depth.ToString()); | ||
1179 | } | ||
1180 | |||
1181 | //If you interpenetrate a prim with an agent | ||
1182 | if ((p2.PhysicsActorType == (int) ActorTypes.Agent && | ||
1183 | p1.PhysicsActorType == (int) ActorTypes.Prim) || | ||
1184 | (p1.PhysicsActorType == (int) ActorTypes.Agent && | ||
1185 | p2.PhysicsActorType == (int) ActorTypes.Prim)) | ||
1186 | { | ||
1187 | |||
1188 | //contact.depth = contact.depth * 4.15f; | ||
1189 | /* | ||
1190 | if (p2.PhysicsActorType == (int) ActorTypes.Agent) | ||
1191 | { | ||
1192 | p2.CollidingObj = true; | ||
1193 | contact.depth = 0.003f; | ||
1194 | p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 2.5f); | ||
1195 | OdeCharacter character = (OdeCharacter) p2; | ||
1196 | character.SetPidStatus(true); | ||
1197 | contact.pos = new d.Vector3(contact.pos.X + (p1.Size.X / 2), contact.pos.Y + (p1.Size.Y / 2), contact.pos.Z + (p1.Size.Z / 2)); | ||
1198 | |||
1199 | } | ||
1200 | else | ||
1201 | { | ||
1202 | |||
1203 | //contact.depth = 0.0000000f; | ||
1204 | } | ||
1205 | if (p1.PhysicsActorType == (int) ActorTypes.Agent) | ||
1206 | { | ||
1207 | |||
1208 | p1.CollidingObj = true; | ||
1209 | contact.depth = 0.003f; | ||
1210 | p1.Velocity = p1.Velocity + new PhysicsVector(0, 0, 2.5f); | ||
1211 | contact.pos = new d.Vector3(contact.pos.X + (p2.Size.X / 2), contact.pos.Y + (p2.Size.Y / 2), contact.pos.Z + (p2.Size.Z / 2)); | ||
1212 | OdeCharacter character = (OdeCharacter)p1; | ||
1213 | character.SetPidStatus(true); | ||
1214 | } | ||
1215 | else | ||
1216 | { | ||
1217 | |||
1218 | //contact.depth = 0.0000000f; | ||
1219 | } | ||
1220 | |||
1221 | |||
1222 | |||
1223 | } | ||
1224 | */ | ||
1225 | // If you interpenetrate a prim with another prim | ||
1226 | /* | ||
1227 | if (p1.PhysicsActorType == (int) ActorTypes.Prim && p2.PhysicsActorType == (int) ActorTypes.Prim) | ||
1228 | { | ||
1229 | #region disabledcode2 | ||
1230 | //OdePrim op1 = (OdePrim)p1; | ||
1231 | //OdePrim op2 = (OdePrim)p2; | ||
1232 | //op1.m_collisionscore++; | ||
1233 | //op2.m_collisionscore++; | ||
1234 | |||
1235 | //if (op1.m_collisionscore > 8000 || op2.m_collisionscore > 8000) | ||
1236 | //{ | ||
1237 | //op1.m_taintdisable = true; | ||
1238 | //AddPhysicsActorTaint(p1); | ||
1239 | //op2.m_taintdisable = true; | ||
1240 | //AddPhysicsActorTaint(p2); | ||
1241 | //} | ||
1242 | |||
1243 | //if (contact.depth >= 0.25f) | ||
1244 | //{ | ||
1245 | // Don't collide, one or both prim will expld. | ||
1246 | |||
1247 | //op1.m_interpenetrationcount++; | ||
1248 | //op2.m_interpenetrationcount++; | ||
1249 | //interpenetrations_before_disable = 200; | ||
1250 | //if (op1.m_interpenetrationcount >= interpenetrations_before_disable) | ||
1251 | //{ | ||
1252 | //op1.m_taintdisable = true; | ||
1253 | //AddPhysicsActorTaint(p1); | ||
1254 | //} | ||
1255 | //if (op2.m_interpenetrationcount >= interpenetrations_before_disable) | ||
1256 | //{ | ||
1257 | // op2.m_taintdisable = true; | ||
1258 | //AddPhysicsActorTaint(p2); | ||
1259 | //} | ||
1260 | |||
1261 | //contact.depth = contact.depth / 8f; | ||
1262 | //contact.normal = new d.Vector3(0, 0, 1); | ||
1263 | //} | ||
1264 | //if (op1.m_disabled || op2.m_disabled) | ||
1265 | //{ | ||
1266 | //Manually disabled objects stay disabled | ||
1267 | //contact.depth = 0f; | ||
1268 | //} | ||
1269 | #endregion | ||
1270 | } | ||
1271 | */ | ||
1272 | #endregion | ||
1273 | if (curContact.depth >= 1.00f) | 1116 | if (curContact.depth >= 1.00f) |
1274 | { | 1117 | { |
1275 | //m_log.Info("[P]: " + contact.depth.ToString()); | 1118 | //m_log.Info("[P]: " + contact.depth.ToString()); |
@@ -1584,12 +1427,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1584 | } | 1427 | } |
1585 | else if (at == ActorTypes.Prim) | 1428 | else if (at == ActorTypes.Prim) |
1586 | { | 1429 | { |
1587 | //d.AABB aabb1 = new d.AABB(); | ||
1588 | //d.AABB aabb2 = new d.AABB(); | ||
1589 | |||
1590 | //d.GeomGetAABB(contactGeom.g2, out aabb2); | ||
1591 | //d.GeomGetAABB(contactGeom.g1, out aabb1); | ||
1592 | //aabb1. | ||
1593 | 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))) | 1430 | 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))) |
1594 | { | 1431 | { |
1595 | if (contactGeom.normal.X == contact.normal.X && contactGeom.normal.Y == contact.normal.Y && contactGeom.normal.Z == contact.normal.Z) | 1432 | if (contactGeom.normal.X == contact.normal.X && contactGeom.normal.Y == contact.normal.Y && contactGeom.normal.Z == contact.normal.Z) |
@@ -1631,14 +1468,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1631 | cc1 = (OdeCharacter)p1; | 1468 | cc1 = (OdeCharacter)p1; |
1632 | obj2LocalID = cc1.LocalID; | 1469 | obj2LocalID = cc1.LocalID; |
1633 | cc1.AddCollisionEvent(cc2.LocalID, contact); | 1470 | cc1.AddCollisionEvent(cc2.LocalID, contact); |
1634 | //ctype = (int)CollisionCategories.Character; | ||
1635 | |||
1636 | //if (cc1.CollidingObj) | ||
1637 | //cStartStop = (int)StatusIndicators.Generic; | ||
1638 | //else | ||
1639 | //cStartStop = (int)StatusIndicators.Start; | ||
1640 | |||
1641 | //returncollisions = true; | ||
1642 | break; | 1471 | break; |
1643 | 1472 | ||
1644 | case ActorTypes.Prim: | 1473 | case ActorTypes.Prim: |
@@ -1648,21 +1477,11 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1648 | obj2LocalID = cp1.LocalID; | 1477 | obj2LocalID = cp1.LocalID; |
1649 | cp1.AddCollisionEvent(cc2.LocalID, contact); | 1478 | cp1.AddCollisionEvent(cc2.LocalID, contact); |
1650 | } | 1479 | } |
1651 | //ctype = (int)CollisionCategories.Geom; | ||
1652 | |||
1653 | //if (cp1.CollidingObj) | ||
1654 | //cStartStop = (int)StatusIndicators.Generic; | ||
1655 | //else | ||
1656 | //cStartStop = (int)StatusIndicators.Start; | ||
1657 | |||
1658 | //returncollisions = true; | ||
1659 | break; | 1480 | break; |
1660 | 1481 | ||
1661 | case ActorTypes.Ground: | 1482 | case ActorTypes.Ground: |
1662 | case ActorTypes.Unknown: | 1483 | case ActorTypes.Unknown: |
1663 | obj2LocalID = 0; | 1484 | obj2LocalID = 0; |
1664 | //ctype = (int)CollisionCategories.Land; | ||
1665 | //returncollisions = true; | ||
1666 | break; | 1485 | break; |
1667 | } | 1486 | } |
1668 | 1487 | ||
@@ -1684,13 +1503,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1684 | cc1 = (OdeCharacter) p1; | 1503 | cc1 = (OdeCharacter) p1; |
1685 | obj2LocalID = cc1.LocalID; | 1504 | obj2LocalID = cc1.LocalID; |
1686 | cc1.AddCollisionEvent(cp2.LocalID, contact); | 1505 | cc1.AddCollisionEvent(cp2.LocalID, contact); |
1687 | //ctype = (int)CollisionCategories.Character; | ||
1688 | |||
1689 | //if (cc1.CollidingObj) | ||
1690 | //cStartStop = (int)StatusIndicators.Generic; | ||
1691 | //else | ||
1692 | //cStartStop = (int)StatusIndicators.Start; | ||
1693 | //returncollisions = true; | ||
1694 | } | 1506 | } |
1695 | break; | 1507 | break; |
1696 | case ActorTypes.Prim: | 1508 | case ActorTypes.Prim: |
@@ -1700,23 +1512,12 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1700 | cp1 = (OdePrim) p1; | 1512 | cp1 = (OdePrim) p1; |
1701 | obj2LocalID = cp1.LocalID; | 1513 | obj2LocalID = cp1.LocalID; |
1702 | cp1.AddCollisionEvent(cp2.LocalID, contact); | 1514 | cp1.AddCollisionEvent(cp2.LocalID, contact); |
1703 | //ctype = (int)CollisionCategories.Geom; | ||
1704 | |||
1705 | //if (cp1.CollidingObj) | ||
1706 | //cStartStop = (int)StatusIndicators.Generic; | ||
1707 | //else | ||
1708 | //cStartStop = (int)StatusIndicators.Start; | ||
1709 | |||
1710 | //returncollisions = true; | ||
1711 | } | 1515 | } |
1712 | break; | 1516 | break; |
1713 | 1517 | ||
1714 | case ActorTypes.Ground: | 1518 | case ActorTypes.Ground: |
1715 | case ActorTypes.Unknown: | 1519 | case ActorTypes.Unknown: |
1716 | obj2LocalID = 0; | 1520 | obj2LocalID = 0; |
1717 | //ctype = (int)CollisionCategories.Land; | ||
1718 | |||
1719 | //returncollisions = true; | ||
1720 | break; | 1521 | break; |
1721 | } | 1522 | } |
1722 | 1523 | ||
@@ -1724,80 +1525,7 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1724 | } | 1525 | } |
1725 | break; | 1526 | break; |
1726 | } | 1527 | } |
1727 | //if (returncollisions) | ||
1728 | //{ | ||
1729 | |||
1730 | //lock (m_storedCollisions) | ||
1731 | //{ | ||
1732 | //cDictKey = obj1LocalID.ToString() + obj2LocalID.ToString() + cStartStop.ToString() + ctype.ToString(); | ||
1733 | //if (m_storedCollisions.ContainsKey(cDictKey)) | ||
1734 | //{ | ||
1735 | //sCollisionData objd = m_storedCollisions[cDictKey]; | ||
1736 | //objd.NumberOfCollisions += 1; | ||
1737 | //objd.lastframe = framecount; | ||
1738 | //m_storedCollisions[cDictKey] = objd; | ||
1739 | //} | ||
1740 | //else | ||
1741 | //{ | ||
1742 | //sCollisionData objd = new sCollisionData(); | ||
1743 | //objd.ColliderLocalId = obj1LocalID; | ||
1744 | //objd.CollidedWithLocalId = obj2LocalID; | ||
1745 | //objd.CollisionType = ctype; | ||
1746 | //objd.NumberOfCollisions = 1; | ||
1747 | //objd.lastframe = framecount; | ||
1748 | //objd.StatusIndicator = cStartStop; | ||
1749 | //m_storedCollisions.Add(cDictKey, objd); | ||
1750 | //} | ||
1751 | //} | ||
1752 | // } | ||
1753 | } | 1528 | } |
1754 | /* | ||
1755 | private int TriArrayCallback(IntPtr trimesh, IntPtr refObject, int[] triangleIndex, int triCount) | ||
1756 | { | ||
1757 | String name1 = null; | ||
1758 | String name2 = null; | ||
1759 | |||
1760 | if (!geom_name_map.TryGetValue(trimesh, out name1)) | ||
1761 | { | ||
1762 | name1 = "null"; | ||
1763 | } | ||
1764 | if (!geom_name_map.TryGetValue(refObject, out name2)) | ||
1765 | { | ||
1766 | name2 = "null"; | ||
1767 | } | ||
1768 | |||
1769 | m_log.InfoFormat("TriArrayCallback: A collision was detected between {1} and {2}", 0, name1, name2); | ||
1770 | |||
1771 | return 1; | ||
1772 | } | ||
1773 | |||
1774 | private int TriCallback(IntPtr trimesh, IntPtr refObject, int triangleIndex) | ||
1775 | { | ||
1776 | // String name1 = null; | ||
1777 | // String name2 = null; | ||
1778 | // | ||
1779 | // if (!geom_name_map.TryGetValue(trimesh, out name1)) | ||
1780 | // { | ||
1781 | // name1 = "null"; | ||
1782 | // } | ||
1783 | // | ||
1784 | // if (!geom_name_map.TryGetValue(refObject, out name2)) | ||
1785 | // { | ||
1786 | // name2 = "null"; | ||
1787 | // } | ||
1788 | |||
1789 | // m_log.InfoFormat("TriCallback: A collision was detected between {1} and {2}. Index was {3}", 0, name1, name2, triangleIndex); | ||
1790 | |||
1791 | d.Vector3 v0 = new d.Vector3(); | ||
1792 | d.Vector3 v1 = new d.Vector3(); | ||
1793 | d.Vector3 v2 = new d.Vector3(); | ||
1794 | |||
1795 | d.GeomTriMeshGetTriangle(trimesh, 0, ref v0, ref v1, ref v2); | ||
1796 | // 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); | ||
1797 | |||
1798 | return 1; | ||
1799 | } | ||
1800 | */ | ||
1801 | /// <summary> | 1529 | /// <summary> |
1802 | /// This is our collision testing routine in ODE | 1530 | /// This is our collision testing routine in ODE |
1803 | /// </summary> | 1531 | /// </summary> |
@@ -2988,27 +2716,7 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
2988 | 2716 | ||
2989 | lock (OdeLock) | 2717 | lock (OdeLock) |
2990 | { | 2718 | { |
2991 | // Process 10 frames if the sim is running normal.. | 2719 | while (step_time > HalfOdeStep) |
2992 | // process 5 frames if the sim is running slow | ||
2993 | //try | ||
2994 | //{ | ||
2995 | //d.WorldSetQuickStepNumIterations(world, m_physicsiterations); | ||
2996 | //} | ||
2997 | //catch (StackOverflowException) | ||
2998 | //{ | ||
2999 | // m_log.Error("[PHYSICS]: The operating system wasn't able to allocate enough memory for the simulation. Restarting the sim."); | ||
3000 | // ode.drelease(world); | ||
3001 | //base.TriggerPhysicsBasedRestart(); | ||
3002 | //} | ||
3003 | |||
3004 | // Figure out the Frames Per Second we're going at. | ||
3005 | //(step_time == 0.004f, there's 250 of those per second. Times the step time/step size | ||
3006 | |||
3007 | |||
3008 | // HACK: Using a time dilation of 1.0 to debug rubberbanding issues | ||
3009 | //m_timeDilation = Math.Min((step_time / ODE_STEPSIZE) / (0.09375f / ODE_STEPSIZE), 1.0f); | ||
3010 | |||
3011 | while (step_time > HalfOdeStep) | ||
3012 | { | 2720 | { |
3013 | try | 2721 | try |
3014 | { | 2722 | { |
@@ -3107,10 +2815,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
3107 | tempTick = tempTick2; | 2815 | tempTick = tempTick2; |
3108 | } | 2816 | } |
3109 | 2817 | ||
3110 | //if ((framecount % m_randomizeWater) == 0) | ||
3111 | // randomizeWater(waterlevel); | ||
3112 | |||
3113 | //int RayCastTimeMS = m_rayCastManager.ProcessQueuedRequests(); | ||
3114 | m_rayCastManager.ProcessQueuedRequests(); | 2818 | m_rayCastManager.ProcessQueuedRequests(); |
3115 | 2819 | ||
3116 | if (CollectStats) | 2820 | if (CollectStats) |
@@ -3131,7 +2835,7 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
3131 | 2835 | ||
3132 | foreach (PhysicsActor obj in m_collisionEventActors.Values) | 2836 | foreach (PhysicsActor obj in m_collisionEventActors.Values) |
3133 | { | 2837 | { |
3134 | // m_log.DebugFormat("[PHYSICS]: Assessing {0} {1} for collision events", obj.SOPName, obj.LocalID); | 2838 | // m_log.DebugFormat("[PHYSICS]: Assessing {0} {1} for collision events", obj.SOPName, obj.LocalID); |
3135 | 2839 | ||
3136 | switch ((ActorTypes)obj.PhysicsActorType) | 2840 | switch ((ActorTypes)obj.PhysicsActorType) |
3137 | { | 2841 | { |