public boolean isStopped() { if (animator != null) { return !animator.isAnimating(); } else { return true; } }
private void perspectiveAnim(float v) { if (isAnimationEnabled()) { if (!animator.isAnimating()) { animator.start(); } fromPerspective = perspective; toPerspective = v; deltaPerspective = (toPerspective - fromPerspective) / 15f; } else { perspective = v; } }
private void zoomAnim(float initV, float v) { if (isAnimationEnabled()) { if (!animator.isAnimating()) { animator.start(); } fromZoom = initV; zoom = initV; toZoom = v; deltaZoom = (toZoom - fromZoom) / 20f; } else { zoom = v; } }
private void scaleAnim(float initV, float v) { if (isAnimationEnabled()) { System.out.println("animating: " + isAnimationEnabled()); if (!animator.isAnimating()) { animator.start(); } fromScale = initV; scale = initV; toScale = v; deltaScale = (toScale - fromScale) / 15f; } else { System.out.println("not animating"); scale = v; } }
public void stop() { mAnimator.setIgnoreExceptions(true); mAnimator.pause(); mAnimator.stop(); while (mAnimator.isAnimating()) Thread.yield(); }
public void start() { mAnimator = new FPSAnimator(this.getGLAutoDrawable(), mFramesPerSecond); mAnimator.setUpdateFPSFrames(60, null); mAnimator.start(); while (!mAnimator.isAnimating()) Thread.yield(); }
private void centerAnim(Vector3f fromCenter, Vector3f toCenter) { if (isAnimationEnabled()) { if (!animator.isAnimating()) { animator.start(); } this.fromCenter = fromCenter; this.center = fromCenter; this.toCenter = toCenter; deltaCenter = new Vector3f(toCenter).sub(fromCenter).div(15f); } else { this.center = toCenter; } }
if (animator != null && !isAnimating() && animator.isAnimating()) { animator.stop();