void onScrollOverModel(GVRCollider holder, float scrollValue) { if (null != currentDisplayedModel && currentDisplayedModel.getModel(context).getCollider() == holder) { Log.d(TAG, "Angle mover applied"); if (scrollValue > 0) new GVRRotationByAxisAnimation(currentDisplayedModel.getModel (context), 0.1f, 35, 0, 1, 0).start(context.getAnimationEngine()); else new GVRRotationByAxisAnimation(currentDisplayedModel.getModel (context), 0.1f, 35, 0, -1, 0).start(context.getAnimationEngine()); } }
public void rotate(final float angleFactor) { GVRRotationByAxisAnimation rotationAnimation = new GVRRotationByAxisAnimation(place, 0.1f, angleFactor, 0, 1, 0); rotationAnimation.setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation arg0) { Main.enableAnimationStar(); if(angleFactor > 0){ StarPreviewInfo.changeRotationFactor(StarPreviewInfo.Direction.left); } else { StarPreviewInfo.changeRotationFactor(StarPreviewInfo.Direction.right); } } }); rotationAnimation.start(getGVRContext().getAnimationEngine()); } }
private void startAnimation() { animation = new GVRRotationByAxisAnimation(styrocosaurus, 25, 360, 0, 1, 0).start(gvrContext.getAnimationEngine()); animation.setRepeatMode(1); animation.setRepeatCount(-1); isPlayed = true; swipeIndicator.setStop(true); }
public void rotateWorm(MovementDirection movementDirection) { if (!isRotatingWorm) { isRotatingWorm = true; float angle = getRotatingAngle(movementDirection); new GVRRotationByAxisAnimation(head, .1f, angle, 0, 1, 0).start( getGVRContext().getAnimationEngine()).setOnFinish( new GVROnFinish() { @Override public void finished(GVRAnimation arg0) { isRotatingWorm = false; } }); } }
private void rotateGamepadOnY(float angle) { GVRRotationByAxisAnimation parentRotation = new GVRRotationByAxisAnimation(this.getParent(), 0.4f, angle, 1, 0, 0); parentRotation.setRepeatMode(GVRRepeatMode.ONCE); parentRotation.setRepeatCount(1); parentRotation.start(this.getGVRContext().getAnimationEngine()); }
@Override public void onSwipeForward() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(dinosaur, 4f, 45, 0, 1, 0).start(gvrContext.getAnimationEngine()); }
@Override public void onSwipeBack() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(trex, 4f, -45, 0, 1, 0).start(gvrContext.getAnimationEngine()); }
@Override public void onSwipeForward() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(trex, 4f, 45, 0, 1, 0).start(gvrContext.getAnimationEngine()); }
@Override public void onSwipeBack() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(dinosaur, 4f, -45, 0, 1, 0).start(gvrContext.getAnimationEngine()); } });
@Override public void onSwipeForward() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(ankylosaurus, 4f, 45, 0, 1, 0).start(gvrContext.getAnimationEngine()); }
@Override public void onSwipeBack() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(ankylosaurus, 4f, -45, 0, 1, 0).start(gvrContext.getAnimationEngine()); }
@Override public void onSwipeBack() { if (!isPlayed) { AudioClip.getInstance(getGVRContext().getContext()).playSound( AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(styrocosaurus, 4f, -45, 0, 1, 0) .start(gvrContext.getAnimationEngine()); swipeIndicator.setStop(true); } }
@Override public void finished(GVRAnimation animation) { new GVRRotationByAxisAnimation(SceneItem.this, duration * 3, -180, 0, 1, 0) .start(getGVRContext().getAnimationEngine()) .setInterpolator(InterpolatorStrongEaseInOut.getInstance()).setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation animation) { new GVRRelativeMotionAnimation(SceneItem.this, duration, initialPosition[0] - newPosition[0], initialPosition[1] - newPosition[1], initialPosition[2] - newPosition[2]) .start(getGVRContext().getAnimationEngine()) .setInterpolator(InterpolatorBackEaseIn.getInstance()) .setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation animation) { isAnimating = false; } }); } }); } });
@Override public void onSwipeForward() { if (!isPlayed) { AudioClip.getInstance(getGVRContext().getContext()).playSound( AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(styrocosaurus, 4f, 45, 0, 1, 0) .start(gvrContext.getAnimationEngine()); swipeIndicator.setStop(true); } }
@Override public void finished(GVRAnimation animation) { new GVRRotationByAxisAnimation(SceneItem.this, duration * 3, 180, 0, 1, 0) .start(getGVRContext().getAnimationEngine()) .setInterpolator(InterpolatorStrongEaseInOut.getInstance()).setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation animation) { new GVRRelativeMotionAnimation(SceneItem.this, duration, initialPosition[0] - newPosition[0], initialPosition[1] - newPosition[1], initialPosition[2] - newPosition[2]) .start(getGVRContext().getAnimationEngine()) .setInterpolator(InterpolatorBackEaseIn.getInstance()) .setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation animation) { isAnimating = false; } }); } }); } });
public void rotate() { star.getTransform().setPosition(evPositionX, evPositionY, evPositionZ); star.getTransform().setRotation(evRotationW, evPositionX, evPositionY, evPositionZ); rotationAnimation = new GVRRotationByAxisAnimation(star, AnimationsTime.getRotationTime(), StarPreviewInfo.getRotation(), 0, 1, 0); rotationAnimation.setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation arg0) { showCleanButton(); } }); rotationAnimation.start(getGVRContext().getAnimationEngine()); } }