Record the frame time as the different between the last and current
frames. JME's timer was using a running average: good for calculating frame rates, bad for updates. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3906 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -417,7 +417,9 @@ public class JmeApp
|
||||
_timer.update();
|
||||
|
||||
// run all of the controllers attached to nodes
|
||||
_frameTime = _timer.getTimePerFrame();
|
||||
_frameTime = (_lastTick == 0L) ? 0f : (float)(frameTick - _lastTick) /
|
||||
_timer.getResolution();
|
||||
_lastTick = frameTick;
|
||||
_root.updateGeometricState(_frameTime, true);
|
||||
|
||||
// update the camera handler
|
||||
@@ -525,6 +527,7 @@ public class JmeApp
|
||||
protected Timer _timer;
|
||||
protected Thread _dispatchThread;
|
||||
protected Queue _evqueue = new Queue();
|
||||
protected long _lastTick;
|
||||
protected float _frameTime;
|
||||
|
||||
protected String _api;
|
||||
|
||||
Reference in New Issue
Block a user