aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin
diff options
context:
space:
mode:
authorRobert Adams2012-08-02 16:30:23 -0700
committerRobert Adams2012-08-02 16:30:23 -0700
commit8b04e8a297054a2c16978a1ee3c92460c11eaccc (patch)
tree9a0ace6f6d4bf15753c4e96e1d077abfe684f459 /OpenSim/Region/Physics/BulletSPlugin
parentminor: Comment out "Deleting asset" log messages for now (diff)
downloadopensim-SC-8b04e8a297054a2c16978a1ee3c92460c11eaccc.zip
opensim-SC-8b04e8a297054a2c16978a1ee3c92460c11eaccc.tar.gz
opensim-SC-8b04e8a297054a2c16978a1ee3c92460c11eaccc.tar.bz2
opensim-SC-8b04e8a297054a2c16978a1ee3c92460c11eaccc.tar.xz
BulletSim: Debugging log statements added. Reduced size of updata buffer trying to find a corrupted memory problem. Update DLL and SO.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs4
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs29
2 files changed, 27 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index a4ab702..ebfd85b 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -1331,13 +1331,15 @@ public sealed class BSPrim : PhysicsActor
1331 1331
1332 base.RequestPhysicsterseUpdate(); 1332 base.RequestPhysicsterseUpdate();
1333 } 1333 }
1334 /*
1334 else 1335 else
1335 { 1336 {
1336 // For debugging, we can also report the movement of children 1337 // For debugging, we also report the movement of children
1337 DetailLog("{0},UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}", 1338 DetailLog("{0},UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}",
1338 LocalID, entprop.Position, entprop.Rotation, entprop.Velocity, 1339 LocalID, entprop.Position, entprop.Rotation, entprop.Velocity,
1339 entprop.Acceleration, entprop.RotationalVelocity); 1340 entprop.Acceleration, entprop.RotationalVelocity);
1340 } 1341 }
1342 */
1341 } 1343 }
1342 1344
1343 // I've collided with something 1345 // I've collided with something
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 28d5cb5..011033c 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -390,9 +390,9 @@ public class BSScene : PhysicsScene, IPhysicsParameters
390 // Simulate one timestep 390 // Simulate one timestep
391 public override float Simulate(float timeStep) 391 public override float Simulate(float timeStep)
392 { 392 {
393 int updatedEntityCount; 393 int updatedEntityCount = 0;
394 IntPtr updatedEntitiesPtr; 394 IntPtr updatedEntitiesPtr;
395 int collidersCount; 395 int collidersCount = 0;
396 IntPtr collidersPtr; 396 IntPtr collidersPtr;
397 397
398 LastSimulatedTimestep = timeStep; 398 LastSimulatedTimestep = timeStep;
@@ -411,8 +411,21 @@ public class BSScene : PhysicsScene, IPhysicsParameters
411 411
412 // step the physical world one interval 412 // step the physical world one interval
413 m_simulationStep++; 413 m_simulationStep++;
414 int numSubSteps = BulletSimAPI.PhysicsStep(m_worldID, timeStep, m_maxSubSteps, m_fixedTimeStep, 414 int numSubSteps = 0;
415 out updatedEntityCount, out updatedEntitiesPtr, out collidersCount, out collidersPtr); 415 try
416 {
417 numSubSteps = BulletSimAPI.PhysicsStep(m_worldID, timeStep, m_maxSubSteps, m_fixedTimeStep,
418 out updatedEntityCount, out updatedEntitiesPtr, out collidersCount, out collidersPtr);
419 DetailLog("{0},Simulate,call, substeps={1}, updates={2}, colliders={3}", "0000000000", numSubSteps, updatedEntityCount, collidersCount);
420 }
421 catch (Exception e)
422 {
423 m_log.WarnFormat("{0},PhysicsStep Exception: substeps={1}, updates={2}, colliders={3}, e={4}", LogHeader, numSubSteps, updatedEntityCount, collidersCount, e);
424 DetailLog("{0},PhysicsStepException,call, substeps={1}, updates={2}, colliders={3}", "0000000000", numSubSteps, updatedEntityCount, collidersCount);
425 // updatedEntityCount = 0;
426 collidersCount = 0;
427 }
428
416 429
417 // Don't have to use the pointers passed back since we know it is the same pinned memory we passed in 430 // Don't have to use the pointers passed back since we know it is the same pinned memory we passed in
418 431
@@ -711,7 +724,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters
711 return true; 724 return true;
712 } 725 }
713 726
714 // The calls to the PhysicsActors can't directly call into the physics engine 727 // Calls to the PhysicsActors can't directly call into the physics engine
715 // because it might be busy. We delay changes to a known time. 728 // because it might be busy. We delay changes to a known time.
716 // We rely on C#'s closure to save and restore the context for the delegate. 729 // We rely on C#'s closure to save and restore the context for the delegate.
717 public void TaintedObject(TaintCallback callback) 730 public void TaintedObject(TaintCallback callback)
@@ -1275,5 +1288,11 @@ public class BSScene : PhysicsScene, IPhysicsParameters
1275 1288
1276 #endregion Runtime settable parameters 1289 #endregion Runtime settable parameters
1277 1290
1291 // Invoke the detailed logger and output something if it's enabled.
1292 private void DetailLog(string msg, params Object[] args)
1293 {
1294 PhysicsLogging.Write(msg, args);
1295 }
1296
1278} 1297}
1279} 1298}