if ((int) currentPos.x == (int) newPos.x && (int) currentPos.y == (int) newPos.y && (int) currentPos.z == (int) newPos.z) { newPos.x = (float) Math.random() * 10 - 5; newPos.y = (float) Math.random() * 10 - 5; newPos.z = (float) Math.random() * 10 - 5; }
    protected void update(float interpolation) {//      update world data        timer.update();        input.update(timer.getTimePerFrame() * 10);                        //update individual sprites         if ((int) currentPos.x == (int) newPos.x             && (int) currentPos.y == (int) newPos.y             && (int) currentPos.z == (int) newPos.z) {             newPos.x = (float) Math.random() * 10 - 5;             newPos.y = (float) Math.random() * 10 - 5;             newPos.z = (float) Math.random() * 10 - 5;         }         currentPos.x -= (currentPos.x - newPos.x)             / (timer.getFrameRate() / 2);         currentPos.y -= (currentPos.y - newPos.y)             / (timer.getFrameRate() / 2);         currentPos.z -= (currentPos.z - newPos.z)             / (timer.getFrameRate() / 2);                      lightNode.setLocalTranslation(currentPos);         scene.updateWorldData(timer.getTimePerFrame());    }