aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRobert Adams2013-01-01 17:25:41 -0800
committerRobert Adams2013-01-01 17:27:34 -0800
commitaa236b2020a16c464a854be2b02ca49ea637cb27 (patch)
treedfa2173e0ac4f1b66a88352557c3846e9d02eae9
parentBulletSim: move selection of the unmanaged Bullet DLL from BSPlugin (diff)
downloadopensim-SC_OLD-aa236b2020a16c464a854be2b02ca49ea637cb27.zip
opensim-SC_OLD-aa236b2020a16c464a854be2b02ca49ea637cb27.tar.gz
opensim-SC_OLD-aa236b2020a16c464a854be2b02ca49ea637cb27.tar.bz2
opensim-SC_OLD-aa236b2020a16c464a854be2b02ca49ea637cb27.tar.xz
BulletSim: add parameter to have Bullet output performance statistics
every so many frames. Default to off.
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs2
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs4
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs8
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs4
4 files changed, 11 insertions, 7 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs
index aea10ee..30a7bee 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs
@@ -970,7 +970,7 @@ private sealed class BulletConstraintXNA : BulletConstraint
970 p.linkConstraintERP = o[0].XlinkConstraintERP; 970 p.linkConstraintERP = o[0].XlinkConstraintERP;
971 p.linkConstraintCFM = o[0].XlinkConstraintCFM; 971 p.linkConstraintCFM = o[0].XlinkConstraintCFM;
972 p.linkConstraintSolverIterations = o[0].XlinkConstraintSolverIterations; 972 p.linkConstraintSolverIterations = o[0].XlinkConstraintSolverIterations;
973 p.physicsLoggingFrames = o[0].physicsLoggingFrames; 973 p.physicsLoggingFrames = o[0].XphysicsLoggingFrames;
974 DefaultCollisionConstructionInfo ccci = new DefaultCollisionConstructionInfo(); 974 DefaultCollisionConstructionInfo ccci = new DefaultCollisionConstructionInfo();
975 975
976 DefaultCollisionConfiguration cci = new DefaultCollisionConfiguration(); 976 DefaultCollisionConfiguration cci = new DefaultCollisionConfiguration();
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
index 1735be2..8ad78ca 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
@@ -198,7 +198,7 @@ public struct ConfigurationParameters
198 public float XlinkConstraintCFM; 198 public float XlinkConstraintCFM;
199 public float XlinkConstraintSolverIterations; 199 public float XlinkConstraintSolverIterations;
200 200
201 public float physicsLoggingFrames; 201 public float XphysicsLoggingFrames;
202 202
203 public const float numericTrue = 1f; 203 public const float numericTrue = 1f;
204 public const float numericFalse = 0f; 204 public const float numericFalse = 0f;
@@ -415,7 +415,7 @@ public abstract void SetForceUpdateAllAabbs(BulletWorld world, bool force);
415 415
416// ===================================================================================== 416// =====================================================================================
417// btDynamicsWorld entries 417// btDynamicsWorld entries
418// public abstract bool AddObjectToWorld(BulletWorld world, BulletBody obj, Vector3 pos, Quaternion rot); 418// public abstract bool AddObjectToWorld(BulletWorld world, BulletBody obj, Vector3 pos, Quaternion rot);
419public abstract bool AddObjectToWorld(BulletWorld world, BulletBody obj); 419public abstract bool AddObjectToWorld(BulletWorld world, BulletBody obj);
420 420
421public abstract bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj); 421public abstract bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj);
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index 339722e..69ac8cd 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
@@ -492,11 +492,11 @@ public static class BSParam
492 (s) => { return LinkConstraintSolverIterations; }, 492 (s) => { return LinkConstraintSolverIterations; },
493 (s,p,l,v) => { LinkConstraintSolverIterations = v; } ), 493 (s,p,l,v) => { LinkConstraintSolverIterations = v; } ),
494 494
495 new ParameterDefn("LogPhysicsStatisticsFrames", "Frames between outputting detailed phys stats. (0 is off)", 495 new ParameterDefn("PhysicsMetricFrames", "Frames between outputting detailed phys metrics. (0 is off)",
496 0f, 496 0f,
497 (s,cf,p,v) => { s.UnmanagedParams[0].physicsLoggingFrames = cf.GetInt(p, (int)v); }, 497 (s,cf,p,v) => { s.PhysicsMetricDumpFrames = cf.GetFloat(p, (int)v); },
498 (s) => { return (float)s.UnmanagedParams[0].physicsLoggingFrames; }, 498 (s) => { return (float)s.PhysicsMetricDumpFrames; },
499 (s,p,l,v) => { s.UnmanagedParams[0].physicsLoggingFrames = (int)v; } ), 499 (s,p,l,v) => { s.PhysicsMetricDumpFrames = (int)v; } ),
500 }; 500 };
501 501
502 // Convert a boolean to our numeric true and false values 502 // Convert a boolean to our numeric true and false values
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 3340cda..7017194 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -161,6 +161,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
161 private int m_physicsLoggingFileMinutes; 161 private int m_physicsLoggingFileMinutes;
162 private bool m_physicsLoggingDoFlush; 162 private bool m_physicsLoggingDoFlush;
163 private bool m_physicsPhysicalDumpEnabled; 163 private bool m_physicsPhysicalDumpEnabled;
164 public float PhysicsMetricDumpFrames { get; set; }
164 // 'true' of the vehicle code is to log lots of details 165 // 'true' of the vehicle code is to log lots of details
165 public bool VehicleLoggingEnabled { get; private set; } 166 public bool VehicleLoggingEnabled { get; private set; }
166 public bool VehiclePhysicalLoggingEnabled { get; private set; } 167 public bool VehiclePhysicalLoggingEnabled { get; private set; }
@@ -526,6 +527,9 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
526 collidersCount = 0; 527 collidersCount = 0;
527 } 528 }
528 529
530 if ((m_simulationStep % PhysicsMetricDumpFrames) == 0)
531 PE.DumpPhysicsStatistics(World);
532
529 // Get a value for 'now' so all the collision and update routines don't have to get their own. 533 // Get a value for 'now' so all the collision and update routines don't have to get their own.
530 SimulationNowTime = Util.EnvironmentTickCount(); 534 SimulationNowTime = Util.EnvironmentTickCount();
531 535