Search in sources :

Example 16 with AnimationTimer

use of javafx.animation.AnimationTimer in project FXyzLib by Birdasaur.

the class Skybox method startTimer.

private void startTimer() {
    timer = new AnimationTimer() {

        @Override
        public void handle(long now) {
            Transform ct = (camera != null) ? camera.getLocalToSceneTransform() : null;
            if (ct != null) {
                affine.setTx(ct.getTx());
                affine.setTy(ct.getTy());
                affine.setTz(ct.getTz());
            }
        }
    };
    timer.start();
}
Also used : AnimationTimer(javafx.animation.AnimationTimer) Transform(javafx.scene.transform.Transform)

Example 17 with AnimationTimer

use of javafx.animation.AnimationTimer in project bitsquare by bitsquare.

the class GUIProfiler method init.

public static void init() {
    AnimationTimer fpsTimer = new AnimationTimer() {

        @Override
        public void handle(long l) {
            long elapsed = (System.currentTimeMillis() - lastFPSTime);
            if (elapsed > 50)
                log.trace("Profiler: last frame used {}ms", elapsed);
            lastFPSTime = System.currentTimeMillis();
        }
    };
    fpsTimer.start();
}
Also used : AnimationTimer(javafx.animation.AnimationTimer)

Aggregations

AnimationTimer (javafx.animation.AnimationTimer)17 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)14 Group (javafx.scene.Group)14 PerspectiveCamera (javafx.scene.PerspectiveCamera)14 Scene (javafx.scene.Scene)14 KeyCode (javafx.scene.input.KeyCode)14 MouseEvent (javafx.scene.input.MouseEvent)14 PointLight (javafx.scene.PointLight)13 Rotate (javafx.scene.transform.Rotate)11 Point3D (org.fxyz.geometry.Point3D)8 AmbientLight (javafx.scene.AmbientLight)7 KeyFrame (javafx.animation.KeyFrame)5 KeyValue (javafx.animation.KeyValue)5 Timeline (javafx.animation.Timeline)5 OBJWriter (org.fxyz.utils.OBJWriter)5 ArrayList (java.util.ArrayList)3 Application (javafx.application.Application)3 SceneAntialiasing (javafx.scene.SceneAntialiasing)3 Color (javafx.scene.paint.Color)3 PhongMaterial (javafx.scene.paint.PhongMaterial)3