private float getRemainValue() { float result; float xRotation = this.getTransform().getRotationPitch(); xRotation = Math.abs(xRotation); result = xRotation % ITEM_DEGREE; return result; }
public static void logRotation(GVRSceneObject object) { Log.d("RotationUtil", " RotationPitch :" + object.getTransform().getRotationPitch()); Log.d("RotationUtil", " RotationRoll :" + object.getTransform().getRotationRoll()); Log.d("RotationUtil", " RotationYaw :" + object.getTransform().getRotationYaw()); Log.d("RotationUtil", " RotationW :" + object.getTransform().getRotationW()); Log.d("RotationUtil", " RotationX :" + object.getTransform().getRotationX()); Log.d("RotationUtil", " RotationY :" + object.getTransform().getRotationY()); Log.d("RotationUtil", " RotationZ :" + object.getTransform().getRotationZ()); }
public void onStep() { actualRotation = this.getTransform().getRotationPitch(); distanceDegree = Util.getDistanceDegree(oldRotation, actualRotation, updateClockWise()); amountRotation = amountRotation + distanceDegree; updateIndexIfNecessary(); oldRotation = actualRotation; }
private void handlerRotationGamepad(boolean left, boolean right) { float xRot = this.getParent().getTransform().getRotationPitch(); if (!left && !right) { if (isRotated) { rotateBackToNormal(xRot); isRotated = false; } } else { if (!isRotated) { rotateLayDown(xRot); isRotated = true; } } }
@Override public void onSwipe(GVRTouchPadGestureListener.Action action, float velocityX) { if (gameStopped() || (mController.getControllerType() == GVRControllerType.CONTROLLER)) { return; } int normal = MathUtils.calculateForce(velocityX); float[] forward = MathUtils.calculateRotation( mCamera.getHeadTransform().getRotationPitch(), mCamera.getHeadTransform().getRotationYaw()); float[] force = {normal * forward[0], normal * forward[1], normal * forward[2]}; try { GVRTransform trans = mCamera.getTransform(); GVRSceneObject ball = MainHelper.createBall(mBallProto, 5 * forward[0] + trans.getPositionX(), 5 * forward[1] + trans.getPositionY(), 5 * forward[2] + trans.getPositionZ(), force); mScene.addSceneObject(ball); mNumBalls++; mBallsLabel.setText("Balls: " + (MAX_BALLS - mNumBalls)); } catch (IOException ioe) { ioe.printStackTrace(); } }
return; GVRTransform trans = rotateObject.getTransform(); float xrot = trans.getRotationPitch(); float yrot = trans.getRotationYaw(); float xpos = trans.getPositionX();