@Override public void onNewFrame(HeadTransform headTransform) { headTransform.getHeadView(mHeadViewMatrix, 0); headTransform.getForwardVector(mForwardVector, 0); currentContent.update(); Util.checkGLError("Error On New Frame"); }
@Override public void onCardboardTrigger() { float[] e = new float[16]; mHeadTransform.getEulerAngles(e, 10); Log.d("natalia", "cardboard trig " + String.valueOf(e[0])); mVibrator.vibrate(50); }
@Override public void onNewFrame(HeadTransform headTransform) { Matrix.rotateM(mModelCube, 0, TIME_DELTA, 0.5f, 0.5f, 1.0f); // Build the camera matrix and apply it to the ModelView. Matrix.setLookAtM(mCamera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); headTransform.getHeadView(headView, 0); checkGLError("onReadyToDraw"); float[] mtx = new float[16]; GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); surface.updateTexImage(); surface.getTransformMatrix(mtx); mHeadTransform = headTransform; headTransform.getHeadView(headView, 0); }