BulletSim: add parameter to have Bullet output performance statistics

every so many frames. Default to off.
This commit is contained in:
Robert Adams
2013-01-01 17:25:41 -08:00
parent b14b65ea95
commit aa236b2020
4 changed files with 11 additions and 7 deletions

View File

@@ -161,6 +161,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
private int m_physicsLoggingFileMinutes;
private bool m_physicsLoggingDoFlush;
private bool m_physicsPhysicalDumpEnabled;
public float PhysicsMetricDumpFrames { get; set; }
// 'true' of the vehicle code is to log lots of details
public bool VehicleLoggingEnabled { get; private set; }
public bool VehiclePhysicalLoggingEnabled { get; private set; }
@@ -526,6 +527,9 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
collidersCount = 0;
}
if ((m_simulationStep % PhysicsMetricDumpFrames) == 0)
PE.DumpPhysicsStatistics(World);
// Get a value for 'now' so all the collision and update routines don't have to get their own.
SimulationNowTime = Util.EnvironmentTickCount();