rlm@4: package com.aurellem.capture; rlm@4: rlm@4: import com.jme3.system.Timer; rlm@4: rlm@4: public class IsoTimer extends Timer { rlm@4: rlm@4: private float framerate; rlm@4: private int ticks; rlm@4: rlm@4: public IsoTimer(float framerate){ rlm@4: this.framerate = framerate; rlm@4: this.ticks = 0;} rlm@4: rlm@4: public long getTime() { rlm@4: return (long) (this.ticks / this.framerate);} rlm@4: rlm@4: public long getResolution() { rlm@4: return 1000000000L;} rlm@4: rlm@4: public float getFrameRate() { rlm@4: return this.framerate;} rlm@4: rlm@4: public float getTimePerFrame() { rlm@4: return (float) (1.0f / this.framerate);} rlm@4: rlm@4: public void update() {this.ticks++;} rlm@4: rlm@4: public void reset() {this.ticks = 0;} rlm@4: rlm@4: }