aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs28
1 files changed, 16 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 740f339..1cc607a 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -491,7 +491,6 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
491 491
492 // Some of the prims operate with special vehicle properties 492 // Some of the prims operate with special vehicle properties
493 ProcessVehicles(timeStep); 493 ProcessVehicles(timeStep);
494 numTaints += _taintOperations.Count;
495 ProcessTaints(); // the vehicles might have added taints 494 ProcessTaints(); // the vehicles might have added taints
496 495
497 // step the physical world one interval 496 // step the physical world one interval
@@ -500,7 +499,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
500 499
501 try 500 try
502 { 501 {
503 // DumpVehicles(); // DEBUG 502 if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG
504 if (PhysicsLogging.Enabled) beforeTime = Util.EnvironmentTickCount(); 503 if (PhysicsLogging.Enabled) beforeTime = Util.EnvironmentTickCount();
505 504
506 numSubSteps = BulletSimAPI.PhysicsStep2(World.ptr, timeStep, m_maxSubSteps, m_fixedTimeStep, 505 numSubSteps = BulletSimAPI.PhysicsStep2(World.ptr, timeStep, m_maxSubSteps, m_fixedTimeStep,
@@ -509,7 +508,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
509 if (PhysicsLogging.Enabled) simTime = Util.EnvironmentTickCountSubtract(beforeTime); 508 if (PhysicsLogging.Enabled) simTime = Util.EnvironmentTickCountSubtract(beforeTime);
510 DetailLog("{0},Simulate,call, frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}", 509 DetailLog("{0},Simulate,call, frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}",
511 DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, updatedEntityCount, collidersCount); 510 DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, updatedEntityCount, collidersCount);
512 // DumpVehicles(); // DEBUG 511 if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG
513 } 512 }
514 catch (Exception e) 513 catch (Exception e)
515 { 514 {
@@ -521,7 +520,6 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
521 collidersCount = 0; 520 collidersCount = 0;
522 } 521 }
523 522
524
525 // Don't have to use the pointers passed back since we know it is the same pinned memory we passed in 523 // Don't have to use the pointers passed back since we know it is the same pinned memory we passed in
526 524
527 // Get a value for 'now' so all the collision and update routines don't have to get their own 525 // Get a value for 'now' so all the collision and update routines don't have to get their own
@@ -724,6 +722,9 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
724 { 722 {
725 if (_taintOperations.Count > 0) // save allocating new list if there is nothing to process 723 if (_taintOperations.Count > 0) // save allocating new list if there is nothing to process
726 { 724 {
725 /*
726 // Code to limit the number of taints processed per step. Meant to limit step time.
727 // Unsure if a good idea as code assumes that taints are done before the step.
727 int taintCount = m_taintsToProcessPerStep; 728 int taintCount = m_taintsToProcessPerStep;
728 TaintCallbackEntry oneCallback = new TaintCallbackEntry(); 729 TaintCallbackEntry oneCallback = new TaintCallbackEntry();
729 while (_taintOperations.Count > 0 && taintCount-- > 0) 730 while (_taintOperations.Count > 0 && taintCount-- > 0)
@@ -752,13 +753,17 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
752 } 753 }
753 } 754 }
754 } 755 }
755 /* 756 if (_taintOperations.Count > 0)
757 {
758 DetailLog("{0},BSScene.ProcessTaints,leftTaintsOnList,numNotProcessed={1}", DetailLogZero, _taintOperations.Count);
759 }
760 */
756 // swizzle a new list into the list location so we can process what's there 761 // swizzle a new list into the list location so we can process what's there
757 List<TaintCallbackEntry> oldList; 762 List<TaintCallbackEntry> oldList;
758 lock (_taintLock) 763 lock (_taintLock)
759 { 764 {
760 oldList = _taintedObjects; 765 oldList = _taintOperations;
761 _taintedObjects = new List<TaintCallbackEntry>(); 766 _taintOperations = new List<TaintCallbackEntry>();
762 } 767 }
763 768
764 foreach (TaintCallbackEntry tcbe in oldList) 769 foreach (TaintCallbackEntry tcbe in oldList)
@@ -774,7 +779,6 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
774 } 779 }
775 } 780 }
776 oldList.Clear(); 781 oldList.Clear();
777 */
778 } 782 }
779 } 783 }
780 784
@@ -1043,7 +1047,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
1043 (s) => { return (float)s.m_maxUpdatesPerFrame; }, 1047 (s) => { return (float)s.m_maxUpdatesPerFrame; },
1044 (s,p,l,v) => { s.m_maxUpdatesPerFrame = (int)v; } ), 1048 (s,p,l,v) => { s.m_maxUpdatesPerFrame = (int)v; } ),
1045 new ParameterDefn("MaxTaintsToProcessPerStep", "Number of update taints to process before each simulation step", 1049 new ParameterDefn("MaxTaintsToProcessPerStep", "Number of update taints to process before each simulation step",
1046 100f, 1050 500f,
1047 (s,cf,p,v) => { s.m_taintsToProcessPerStep = cf.GetInt(p, (int)v); }, 1051 (s,cf,p,v) => { s.m_taintsToProcessPerStep = cf.GetInt(p, (int)v); },
1048 (s) => { return (float)s.m_taintsToProcessPerStep; }, 1052 (s) => { return (float)s.m_taintsToProcessPerStep; },
1049 (s,p,l,v) => { s.m_taintsToProcessPerStep = (int)v; } ), 1053 (s,p,l,v) => { s.m_taintsToProcessPerStep = (int)v; } ),
@@ -1097,13 +1101,13 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
1097 (s,cf,p,v) => { s.m_params[0].linearDamping = cf.GetFloat(p, v); }, 1101 (s,cf,p,v) => { s.m_params[0].linearDamping = cf.GetFloat(p, v); },
1098 (s) => { return s.m_params[0].linearDamping; }, 1102 (s) => { return s.m_params[0].linearDamping; },
1099 (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].linearDamping, p, l, v); }, 1103 (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].linearDamping, p, l, v); },
1100 (s,o,v) => { BulletSimAPI.SetDamping2(o.PhysBody.ptr, v, v); } ), 1104 (s,o,v) => { BulletSimAPI.SetDamping2(o.PhysBody.ptr, v, s.m_params[0].angularDamping); } ),
1101 new ParameterDefn("AngularDamping", "Factor to damp angular movement per second (0.0 - 1.0)", 1105 new ParameterDefn("AngularDamping", "Factor to damp angular movement per second (0.0 - 1.0)",
1102 0f, 1106 0f,
1103 (s,cf,p,v) => { s.m_params[0].angularDamping = cf.GetFloat(p, v); }, 1107 (s,cf,p,v) => { s.m_params[0].angularDamping = cf.GetFloat(p, v); },
1104 (s) => { return s.m_params[0].angularDamping; }, 1108 (s) => { return s.m_params[0].angularDamping; },
1105 (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].angularDamping, p, l, v); }, 1109 (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].angularDamping, p, l, v); },
1106 (s,o,v) => { BulletSimAPI.SetDamping2(o.PhysBody.ptr, v, v); } ), 1110 (s,o,v) => { BulletSimAPI.SetDamping2(o.PhysBody.ptr, s.m_params[0].linearDamping, v); } ),
1107 new ParameterDefn("DeactivationTime", "Seconds before considering an object potentially static", 1111 new ParameterDefn("DeactivationTime", "Seconds before considering an object potentially static",
1108 0.2f, 1112 0.2f,
1109 (s,cf,p,v) => { s.m_params[0].deactivationTime = cf.GetFloat(p, v); }, 1113 (s,cf,p,v) => { s.m_params[0].deactivationTime = cf.GetFloat(p, v); },
@@ -1473,7 +1477,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
1473 { 1477 {
1474 PhysicsLogging.Write(msg, args); 1478 PhysicsLogging.Write(msg, args);
1475 // Add the Flush() if debugging crashes. Gets all the messages written out. 1479 // Add the Flush() if debugging crashes. Gets all the messages written out.
1476 PhysicsLogging.Flush(); 1480 // PhysicsLogging.Flush();
1477 } 1481 }
1478 // Used to fill in the LocalID when there isn't one. It's the correct number of characters. 1482 // Used to fill in the LocalID when there isn't one. It's the correct number of characters.
1479 public const string DetailLogZero = "0000000000"; 1483 public const string DetailLogZero = "0000000000";