diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index 04c4722b37..f1fa38eeee 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -151,25 +151,35 @@ namespace OpenSim.Region.Physics.OdePlugin
public const string ODETotalFrameMsStatName = "ODETotalFrameMS";
///
- /// The amount of time spent in native code that actually steps through the simulation.
+ /// Stat name for the amount of time spent in native code that actually steps through the simulation.
///
public const string ODENativeStepFrameMsStatName = "ODENativeStepFrameMS";
///
- /// Stat name for recording the number of milliseconds that ODE spends in native collision code.
+ /// Stat name for the number of milliseconds that ODE spends in native collision code.
///
public const string ODENativeCollisionFrameMsStatName = "ODENativeCollisionFrameMS";
///
- /// Stat name for recording the number of milliseconds that ODE spends in native space collision code.
+ /// Stat name for the number of milliseconds that ODE spends in native space collision code.
///
public const string ODENativeSpaceCollisionFrameMsStatName = "ODENativeSpaceCollisionFrameMS";
///
- /// Stat name for recording the number of milliseconds that ODE spends in native geom collision code.
+ /// Stat name for the number of milliseconds that ODE spends in native geom collision code.
///
public const string ODENativeGeomCollisionFrameMsStatName = "ODENativeGeomCollisionFrameMS";
+ ///
+ /// Stat name for the milliseconds spent updating avatar position and velocity
+ ///
+ public const string ODEAvatarUpdateFrameMsStatName = "ODEAvatarUpdateFrameMS";
+
+ ///
+ /// Stat name for the milliseconds spent updating prim position and velocity
+ ///
+ public const string ODEPrimUpdateFrameMsStatName = "ODEPrimUpdateFrameMS";
+
///
/// Stat name for the number of avatar collisions with another entity.
///
@@ -2838,7 +2848,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public override float Simulate(float timeStep)
{
int startFrameTick = CollectStats ? Util.EnvironmentTickCount() : 0;
- int quickStepTick = 0;
+ int tempTick = 0;;
if (framecount >= int.MaxValue)
framecount = 0;
@@ -3014,12 +3024,12 @@ namespace OpenSim.Region.Physics.OdePlugin
m_global_contactcount = 0;
if (CollectStats)
- quickStepTick = Util.EnvironmentTickCount();
+ tempTick = Util.EnvironmentTickCount();
d.WorldQuickStep(world, ODE_STEPSIZE);
if (CollectStats)
- m_stats[ODENativeStepFrameMsStatName] += Util.EnvironmentTickCountSubtract(quickStepTick);
+ m_stats[ODENativeStepFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick);
d.JointGroupEmpty(contactgroup);
}
@@ -3031,6 +3041,9 @@ namespace OpenSim.Region.Physics.OdePlugin
timeLeft -= ODE_STEPSIZE;
}
+ if (CollectStats)
+ tempTick = Util.EnvironmentTickCount();
+
foreach (OdeCharacter actor in _characters)
{
if (actor.bad)
@@ -3054,6 +3067,12 @@ namespace OpenSim.Region.Physics.OdePlugin
defects.Clear();
}
+ if (CollectStats)
+ {
+ m_stats[ODEAvatarUpdateFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick);
+ tempTick = Util.EnvironmentTickCount();
+ }
+
//if (timeStep < 0.2f)
foreach (OdePrim prim in _activeprims)
@@ -3067,6 +3086,9 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
+ if (CollectStats)
+ m_stats[ODEPrimUpdateFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick);
+
//DumpJointInfo();
// Finished with all sim stepping. If requested, dump world state to file for debugging.
@@ -4135,6 +4157,8 @@ namespace OpenSim.Region.Physics.OdePlugin
m_stats[ODENativeGeomCollisionFrameMsStatName] = 0;
m_stats[ODEAvatarContactsStatsName] = 0;
m_stats[ODEPrimContactsStatName] = 0;
+ m_stats[ODEAvatarUpdateFrameMsStatName] = 0;
+ m_stats[ODEPrimUpdateFrameMsStatName] = 0;
}
}
}
\ No newline at end of file