Mercurial > jmeCapture
view src/com/aurellem/capture/IsoTimer.java @ 42:b1bc965a38d2
use reflection to set timer for MotionTrack for now
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 03 Nov 2011 18:47:21 -0700 |
parents | edaa7e7806e4 |
children | 6484a820e27d |
line wrap: on
line source
1 package com.aurellem.capture;3 import com.jme3.system.Timer;5 public class IsoTimer extends Timer {7 private float framerate;8 private int ticks;10 public IsoTimer(float framerate){11 this.framerate = framerate;12 this.ticks = 0;}14 public long getTime() {15 return (long) (this.ticks / this.framerate);}17 public long getResolution() {18 return 1000000000L;}20 public float getFrameRate() {21 return this.framerate;}23 public float getTimePerFrame() {24 return (float) (1.0f / this.framerate);}26 public void update() {this.ticks++;}28 public void reset() {this.ticks = 0;}30 }