public void stopFloatingSphere() { gvrContext.getAnimationEngine().stop(floatingAnimation); isFloatingSphere = false; }
private void stop(GVRAnimation animation) { if (animation != null) { this.getGVRContext().getAnimationEngine().stop(animation); } }
private void stop(GVRAnimation animation) { if (animation != null) { this.getGVRContext().getAnimationEngine().stop(animation); } }
private void stop(GVRAnimation opacityAnimation) { if (opacityAnimation != null) { this.getGVRContext().getAnimationEngine().stop(opacityAnimation); } }
private void stopAnimations() { if (scaleExpand != null) { this.getGVRContext().getAnimationEngine().stop(scaleExpand); } if (rmExpand != null) { this.getGVRContext().getAnimationEngine().stop(rmExpand); } if (scaleCollapse != null) { this.getGVRContext().getAnimationEngine().stop(scaleCollapse); } if (rmCollapse != null) { this.getGVRContext().getAnimationEngine().stop(rmCollapse); } }
public void changeInterpolatorTo(GVRInterpolator interpolator) { animationInterpolator = interpolator; getGVRContext().getAnimationEngine().stop(appleAnimation); startAppleAnimation(); }
public void animationsTime(){ getGVRContext().getAnimationEngine().stop(appleAnimation); startAppleAnimation(); } }
private void stopAnimation() { gvrContext.getAnimationEngine().stop(animation); AudioClip.getInstance(getGVRContext().getContext()) .pauseSound(streamID); animation = null; isPlayed = false; }
private void animateArrowOff() { if (opacityAnimationOff != null) { getGVRContext().getAnimationEngine().stop(opacityAnimationOff); } else { opacityAnimationOff = new GVROpacityAnimation(this, TIME_TO_OFF, 0); } opacityAnimationOff.start(getGVRContext().getAnimationEngine()); }
public void animateArrowOn() { if (finishAnimationOn && !lockOff) { if (opacityAnimationOn != null) { getGVRContext().getAnimationEngine().stop(opacityAnimationOn); } else { opacityAnimationOn = new GVROpacityAnimation(this, 1f, 1); } executeAnimationOn(); } else { lockOff = true; lastSwip = System.currentTimeMillis(); getGVRContext().getPeriodicEngine().runAfter(getRunnableOff(), TIME_TO_OFF +0.1f); } }
public void hide() { apple.getTransform().setPositionY(APPLE_INITIAL_POSITION_Y); apple.getRenderData().getMaterial().setOpacity(0f); getGVRContext().getAnimationEngine().stop(appleAnimation); }
public void rotateAroundCamera(float duration, float degree) { if (wormParentAnimation != null) { getGVRContext().getAnimationEngine().stop(wormParentAnimation); } wormParentAnimation = new GVRRotationByAxisWithPivotAnimation( wormParent.getTransform(), duration, degree, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f) .start(getGVRContext().getAnimationEngine()); }
public void snapSphere(float[] hit) { if (isUnsnappingSphere) { gvrContext.getAnimationEngine().stop(snapAnimation); isUnsnappingSphere = false; } if(hit != null) snapAnimation = new GVRRelativeMotionAnimation(this, 1.2f, hit[0] - getTransform().getPositionX(), hit[1] - getTransform().getPositionY(), 0f).start(gvrContext.getAnimationEngine()); }
public void showEvent() { if (animOpacity != null) { this.getGVRContext().getAnimationEngine().stop(animOpacity); } animOpacity = new GVROpacityAnimation(buttonHover, 0.6f, 1); animOpacity.setRepeatMode(GVRRepeatMode.ONCE); animOpacity.setRepeatCount(1); animOpacity.setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation gvrAnimation) { buttonHover.getRenderData().getMaterial().setOpacity(0); } }); animOpacity.start(getGVRContext().getAnimationEngine()); } }
public void setSelectedAnimation(int index) { // No Animation if (index == 0) { if (currentAnimation != null) { context.getAnimationEngine().stop(currentAnimation); currentAnimation = null; } } else { index -= 1; if (currentDisplayedModel != null && currentDisplayedModel.getAnimation().getAnimationCount() > 0) currentAnimation = currentDisplayedModel.getAnimation().getAnimation(index); currentAnimation.setRepeatMode(GVRRepeatMode.REPEATED); currentAnimation.setRepeatCount(-1); currentAnimation.start(context.getAnimationEngine()); } }
public void moveToCursor() { if (followCursorAnimation != null) { getGVRContext().getAnimationEngine().stop(followCursorAnimation); } GVRCameraRig cameraObject = getGVRContext().getMainScene().getMainCameraRig(); float desiredDistance = (float) Math.max( 0.7 * Util.distance(getParent(), cameraObject.getTransform()), Constants.MINIMUM_DISTANCE_FROM_CAMERA); float[] lookAt = getGVRContext().getMainScene().getMainCameraRig().getLookAt(); Vector3D lookAtVector = new Vector3D(lookAt[0], lookAt[1], lookAt[2]); final float desiredX = (float) lookAtVector.getX() * desiredDistance; final float desiredY = (float) lookAtVector.getY() * desiredDistance + CURSOR_POSITION_OFFSET_Y; final float desiredZ = (float) lookAtVector.getZ() * desiredDistance; float x = desiredX - getParent().getTransform().getPositionX(); float y = desiredY - getParent().getTransform().getPositionY(); float z = desiredZ - getParent().getTransform().getPositionZ(); followCursorAnimation = new GVRRelativeMotionAnimation(getParent(), 0.8f, x, y, z) .setInterpolator(new InterpolatorExpoEaseOut()).start( getGVRContext().getAnimationEngine()); }
public void restoreSpherePosition(float duration) { if (followCursorAnimation != null) { getGVRContext().getAnimationEngine().stop(followCursorAnimation); } float x = (float) getInitialPositionVector().getX() - getParent().getTransform().getPositionX(); float y = (float) getInitialPositionVector().getY() - getParent().getTransform().getPositionY(); float z = (float) getInitialPositionVector().getZ() - getParent().getTransform().getPositionZ(); followCursorAnimation = new GVRRelativeMotionAnimation(getParent(), duration, x, y, z) .setInterpolator(new InterpolatorExpoEaseInOut()) .start(getGVRContext().getAnimationEngine()).setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation arg0) { answerState = SphereStaticList.MOVEABLE; animateFloating(); } }); }