private static void scaleWormPart(GVRContext gvrContext, GVRSceneObject part, float scaleFactor) { new GVRScaleAnimation(part, AnimationsTime.getScaleTime(), part.getTransform().getScaleX() + scaleFactor) .start(gvrContext.getAnimationEngine()); }
@Override public void run() { mScaleAnimation[iterator] = new GVRScaleAnimation(mMicRunItens[iterator], ANIMATION_TIME, 1); mScaleAnimation[iterator].setRepeatMode(GVRRepeatMode.REPEATED); mScaleAnimation[iterator].setRepeatCount(-1); mScaleAnimation[iterator].setInterpolator(new InterpolatorExpoEaseOut()); mScaleAnimation[iterator].start(getGVRContext().getAnimationEngine()); }
private void scaleWormPart(GVRSceneObject part, float scaleFactor) { new GVRScaleAnimation(part, 0.1f, part.getTransform().getScaleX() + scaleFactor) .setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation arg0) { ScaleWorm.animPlaying = false; } }).start(getGVRContext().getAnimationEngine()); } }
public void collapseFrame() { if (isOpen) { stopAnimations(); scaleCollapse = new GVRScaleAnimation(pivot, ANIMATION_TIME, 1, 0, 1); scaleCollapse.setRepeatMode(GVRRepeatMode.ONCE); scaleCollapse.start(getGVRContext().getAnimationEngine()); rmCollapse = new GVRRelativeMotionAnimation(this, ANIMATION_TIME, 0, ANIMATION_FRAME_RESIZE, 0); rmCollapse.setRepeatMode(GVRRepeatMode.ONCE); rmCollapse.setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation arg0) { mMenuFrame.getRenderData().getMaterial().setOpacity(0); getTransform().setPosition(0f, MenuBox.FRAME_INITITAL_POSITION_Y, FRAME_POSITION_Z); } }); rmCollapse.start(getGVRContext().getAnimationEngine()); isOpen = false; } }
private void playShadowAnimation() { new GVRScaleAnimation(shadow, AnimationsTime.getDropTime(), 2f).setInterpolator(defineInterpolator(motion)).start( getGVRContext().getAnimationEngine()); }
private void animateScale(float scale) { mScaleAnimation = new GVRScaleAnimation(mHover, 1, scale); mScaleAnimation.start(this.getGVRContext().getAnimationEngine()); }
public void hide() { for (int i = 0; i < NUMBER_OF_WAVES; i++) { if (mOpacityAnimation[i] != null) { mOpacityAnimation[i].setRepeatMode(GVRRepeatMode.ONCE); } if (mScaleAnimation[i] != null) { mScaleAnimation[i].setRepeatMode(GVRRepeatMode.ONCE); } } animateOpacityOff(); }
public void expandFrame(final MenuHeader menuHeader) { if (!isOpen) { stopAnimations(); mMenuFrame.getRenderData().getMaterial().setOpacity(0.5f); scaleExpand = new GVRScaleAnimation(pivot, ANIMATION_TIME, 1, FRAME_EXPAND_SCALE_X, 1); scaleExpand.setRepeatMode(GVRRepeatMode.ONCE); scaleExpand.start(this.getGVRContext().getAnimationEngine()); rmExpand = new GVRRelativeMotionAnimation(this, ANIMATION_TIME, 0, -ANIMATION_FRAME_RESIZE, 0); rmExpand.setRepeatMode(GVRRepeatMode.ONCE); rmExpand.start(this.getGVRContext().getAnimationEngine()).setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation arg0) { menuHeader.show(); } }); isOpen = true; } else { menuHeader.show(); } }
private void AnimateScale(float scale) { blurScale = new GVRScaleAnimation(blurObject, ANIMATION_TIME, scale); blurScale.start(this.getGVRContext().getAnimationEngine()); blurScale.setInterpolator(new InterpolatorExpoEaseInOut()); ringScale = new GVRScaleAnimation(ringObject, ANIMATION_TIME, scale); ringScale.start(this.getGVRContext().getAnimationEngine()); ringScale.setInterpolator(new InterpolatorExpoEaseInOut()); }
public void pressedRelese() { opacityAnimationOff = new GVROpacityAnimation(this, TIME_ANIMATION, 0); scaleAnimationSmaller = new GVRScaleAnimation(this, TIME_ANIMATION, SCALE_OBJECT - 0.1f); opacityAnimationOff.start(getGVRContext().getAnimationEngine()); scaleAnimationSmaller.start(getGVRContext().getAnimationEngine()); }
public void pressedRelese() { opacityAnimationOff = new GVROpacityAnimation(this, TIME_ANIMATION, 0); scaleAnimationSmaller = new GVRScaleAnimation(this, TIME_ANIMATION, SCALE_OBJECT - 0.1f); opacityAnimationOff.start(getGVRContext().getAnimationEngine()); scaleAnimationSmaller.start(getGVRContext().getAnimationEngine()); }
public void pressed() { opacityAnimationOn = new GVROpacityAnimation(this, TIME_ANIMATION, 1); scaleAnimationBiger = new GVRScaleAnimation(this, TIME_ANIMATION, SCALE_OBJECT + 0.1f); opacityAnimationOn.start(getGVRContext().getAnimationEngine()); scaleAnimationBiger.start(getGVRContext().getAnimationEngine()); }
private GVRAnimation createUnspotAnimation(float scaleFactor) { scaleParentAnimation = new GVRScaleAnimation(getParent(), 1.2f, scaleFactor) .start(gvrContext .getAnimationEngine()); scaleThisAnimation = new GVRScaleAnimation(this, 1.2f, 1 / scaleFactor).start(gvrContext .getAnimationEngine()); return new GVRRelativeMotionAnimation(getParent(), 1.2f, (float) getInitialPositionVector() .getX() - getParent().getTransform().getPositionX(), (float) getInitialPositionVector().getY() - getParent().getTransform().getPositionY(), (float) getInitialPositionVector().getZ() - getParent().getTransform().getPositionZ()) .setInterpolator(new InterpolatorExpoEaseOut()); }
private GVRAnimation createSpotAnimation() { GVRCameraRig cameraObject = gvrContext.getMainScene().getMainCameraRig(); float distance = (float) Math.max( 0.7 * Util.distance(getInitialPositionVector(), cameraObject.getTransform()), Constants.MINIMUM_DISTANCE_FROM_CAMERA); float[] newPosition = Util.calculatePointBetweenTwoObjects(cameraObject.getTransform(), getParent(), distance); float scaleFactor = Util.getHitAreaScaleFactor(distance); scaleParentAnimation = new GVRScaleAnimation(getParent(), 1.2f, scaleFactor) .start(gvrContext .getAnimationEngine()); scaleThisAnimation = new GVRScaleAnimation(this, 1.2f, 1 / scaleFactor).start(gvrContext .getAnimationEngine()); return new GVRRelativeMotionAnimation(getParent(), 1.2f, newPosition[0] - getParent().getTransform().getPositionX(), newPosition[1] - getParent().getTransform().getPositionY(), newPosition[2] - getParent().getTransform().getPositionZ()) .setInterpolator(new InterpolatorExpoEaseOut()); }
public void closeAction() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIImageCloseSoundID(), 1.0f, 1.0f); currentState = PHOTO_VIEW_CLOSED; if (this.PhotoItemListener != null) { this.PhotoItemListener.dispatchLockRequest(); } new GVRScaleAnimation(this, PHOTO_VIEW_OPEN_ANIMATION_TIME, 1.0f).start(this.gvrContext .getAnimationEngine()); new GVRPositionAnimation(this, PHOTO_VIEW_CLOSE_ANIMATION_TIME, gridItem.x, gridItem.y, gridItem.z) .setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation arg0) { PhotoView.this.applyOpacityConstrants(); if (PhotoView.this.PhotoItemListener != null) { PhotoView.this.PhotoItemListener.dispatchUnlockRequest(); PhotoView.this.PhotoItemListener .itemUnselectedAnimationFinished(PhotoView.this); } } }).start(this.gvrContext.getAnimationEngine()); }
private void openAction() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIImageOpenSoundID(), 1.0f, 1.0f); currentState = PHOTO_VIEW_OPENED; this.getTransform().setScale(1.0f, 1.0f, 1.0f); this.getRenderData().getMaterial().setColor(Color.WHITE); PhotoView.this.PhotoItemListener.dispatchLockRequest(); new GVRScaleAnimation(this, PHOTO_VIEW_OPEN_ANIMATION_TIME, PHOTO_VIEW_FOCUS_SCALE).start(this.gvrContext .getAnimationEngine()); new GVRPositionAnimation(this, PHOTO_VIEW_OPEN_ANIMATION_TIME, centeredGridItem.x, centeredGridItem.y, centeredGridItem.z) .setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation arg0) { if (PhotoView.this.PhotoItemListener != null) { PhotoView.this.PhotoItemListener.dispatchUnlockRequest(); PhotoView.this.PhotoItemListener .itemSelectedAnimationFinished(PhotoView.this); } } }).start(this.gvrContext.getAnimationEngine()); }
@Override public void run() { float duration = 0.71f; unsnapSphere(duration); GVRCameraRig cameraObject = getGVRContext().getMainScene().getMainCameraRig() ; float distance = Constants.SPHERE_SELECTION_DISTANCE; float[] newPosition = Util.calculatePointBetweenTwoObjects( cameraObject.getTransform(), getInitialPositionVector(), distance); float scaleFactor = Util.getHitAreaScaleFactor(distance); scaleParentAnimation = new GVRScaleAnimation(getParent(), duration, scaleFactor).start(getGVRContext() .getAnimationEngine()); scaleThisAnimation = new GVRScaleAnimation(sphereFlag, duration, 1 / scaleFactor).start(getGVRContext() .getAnimationEngine()); new GVRRelativeMotionAnimation(getParent(), duration, newPosition[0] - getParent().getTransform().getPositionX(), newPosition[1] - getParent().getTransform().getPositionY(), newPosition[2] - getParent().getTransform().getPositionZ()) .setInterpolator(new InterpolatorExpoEaseInOut()) .start(getGVRContext().getAnimationEngine()).setOnFinish(new GVROnFinish() { @Override public void finished(GVRAnimation arg0) { SphereFlag.this.moveTogetherDashboard = true; } }); } }, 0.5f);
public void unselectSphere() { answerState = SphereStaticList.RESTORING; stopFloatingSphere(); final SphereFlag sphereFlag = this; float duration = 1.5f; new GVRShaderAnimation(sphereFlag, SphereShader.BLUR_INTENSITY, duration, 1) .start(getGVRContext().getAnimationEngine()); GVRCameraRig cameraObject = getGVRContext().getMainScene().getMainCameraRig(); float distance = (float) (Constants.NEAREST_NON_SELECTED_SPHERE - Constants.NEAREST_SPHERE + Util .distance(getInitialPositionVector(), cameraObject.getTransform())); float[] newPosition = Util.calculatePointBetweenTwoObjects(cameraObject.getTransform(), getParent(), distance); float scaleFactor = Util.getHitAreaScaleFactor(distance); scaleParentAnimation = new GVRScaleAnimation(getParent(), duration, scaleFactor) .start(getGVRContext() .getAnimationEngine()); scaleThisAnimation = new GVRScaleAnimation(sphereFlag, duration, 1 / scaleFactor) .start(getGVRContext() .getAnimationEngine()); new GVRRelativeMotionAnimation(getParent(), duration, newPosition[0] - getParent().getTransform().getPositionX(), newPosition[1] - getParent().getTransform().getPositionY(), newPosition[2] - getParent().getTransform().getPositionZ()) .setInterpolator(new InterpolatorExpoEaseInOut()).start( getGVRContext().getAnimationEngine()); }