From 6f90df64f8bdd64078196a8ccb79a1ef37b3b6d6 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 6 Feb 2006 02:32:42 +0000 Subject: [PATCH] Added getFrameTime(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3835 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/jme/JmeApp.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/jme/JmeApp.java b/src/java/com/threerings/jme/JmeApp.java index 6d344cf19..743266692 100644 --- a/src/java/com/threerings/jme/JmeApp.java +++ b/src/java/com/threerings/jme/JmeApp.java @@ -192,6 +192,15 @@ public class JmeApp } } + /** + * Returns the duration (in seconds) between the previous frame and the + * current frame. + */ + public float getFrameTime () + { + return _frameTime; + } + /** * Instructs the application to stop the main loop, cleanup and exit. */ @@ -408,11 +417,11 @@ public class JmeApp _timer.update(); // run all of the controllers attached to nodes - float timePerFrame = _timer.getTimePerFrame(); - _root.updateGeometricState(timePerFrame, true); + _frameTime = _timer.getTimePerFrame(); + _root.updateGeometricState(_frameTime, true); // update the camera handler - _camhand.update(timePerFrame); + _camhand.update(_frameTime); // update our stats display if we have one if (_stats != null) { @@ -516,6 +525,7 @@ public class JmeApp protected Timer _timer; protected Thread _dispatchThread; protected Queue _evqueue = new Queue(); + protected float _frameTime; protected String _api; protected DisplaySystem _display;