本文整理汇总了Java中com.google.vr.sdk.base.HeadTransform.getHeadView方法的典型用法代码示例。如果您正苦于以下问题:Java HeadTransform.getHeadView方法的具体用法?Java HeadTransform.getHeadView怎么用?Java HeadTransform.getHeadView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.vr.sdk.base.HeadTransform
的用法示例。
在下文中一共展示了HeadTransform.getHeadView方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onNewFrame
import com.google.vr.sdk.base.HeadTransform; //导入方法依赖的package包/类
/**
* Prepares OpenGL ES before we draw a frame.
*
* @param headTransform The head transformation in the new frame.
*/
@Override
public void onNewFrame(HeadTransform headTransform) {
setCubeRotation();
// Build the camera matrix and apply it to the ModelView.
Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
headTransform.getHeadView(headView, 0);
// Update the 3d audio engine with the most recent head rotation.
headTransform.getQuaternion(headRotation, 0);
gvrAudioEngine.setHeadRotation(
headRotation[0], headRotation[1], headRotation[2], headRotation[3]);
// Regular update call to GVR audio engine.
gvrAudioEngine.update();
checkGLError("onReadyToDraw");
}
示例2: onNewFrame
import com.google.vr.sdk.base.HeadTransform; //导入方法依赖的package包/类
/**
* Prepares OpenGL ES before we draw a frame.
*
* @param headTransform The head transformation in the new frame.
*/
@Override
public void onNewFrame(HeadTransform headTransform) {
//rotate the cube, mangle is how fast, x,y,z which directions it rotates.
Matrix.rotateM(CubeMatrix0, 0, mAngle, 0.7f, 0.7f, 1.0f);
//rotate cube2, mangle is how fast, x,y,z which directions it rotates.
Matrix.rotateM(CubeMatrix1, 0, -mAngle, 0.7f, 0.7f, 1.0f);
Matrix.rotateM(CubeMatrix2, 0, mAngle, 1.0f, 0.7f, 0.7f);
Matrix.rotateM(CubeMatrix3, 0, -mAngle, 1.0f, 0.7f, 0.7f);
Matrix.rotateM(CubeMatrix4, 0, mAngle, 0.7f, 1.0f, 0.7f);
Matrix.rotateM(CubeMatrix5, 0, -mAngle, 0.7f, 1.0f, 0.7f);
Matrix.rotateM(CubeMatrix6, 0, mAngle, 0.5f, 0.5f, 1.5f);
Matrix.rotateM(CubeMatrix7, 0, -mAngle, 0.5f, 0.5f, 1.5f);
// Build the camera matrix and apply it to the ModelView.
Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
headTransform.getHeadView(headView, 0);
}
示例3: onNewFrame
import com.google.vr.sdk.base.HeadTransform; //导入方法依赖的package包/类
/**
* Prepares OpenGL ES before we draw a frame.
*
* @param headTransform The head transformation in the new frame.
*/
@Override
public void onNewFrame(HeadTransform headTransform) {
//rotate the cube, mangle is how fast, x,y,z which directions it rotates.
Matrix.rotateM(mRotationMatrix, 0, mAngle, 0.7f, 0.7f, 1.0f);
if (moving) {
//so figure out which direction we are facing, using the forward normalized vector.
headTransform.getForwardVector(forward, 0);
Log.v(TAG, "X =" + forward[0] + " Y=" + forward[1] + " Z=" + forward[2]);
MoveX = forward[0] * mSpeed;
MoveY = forward[1] * mSpeed;
MoveZ = -forward[2] * mSpeed; //-Z otherwise, going the wrong direction...
// X Y Z
//Matrix.translateM(camera, 0, 0, 0, 0.1f);
Matrix.translateM(camera, 0, MoveX, MoveY, MoveZ);
//moving = false;
}
//I don't think I need this at all.
headTransform.getHeadView(headView, 0);
}
示例4: onNewFrame
import com.google.vr.sdk.base.HeadTransform; //导入方法依赖的package包/类
/**
* Prepares OpenGL ES before we draw a frame.
*
* @param headTransform The head transformation in the new frame.
*/
@Override
public void onNewFrame(HeadTransform headTransform) {
// Build the Model part of the ModelView matrix.
Matrix.rotateM(modelCube, 0, TIME_DELTA, 0.5f, 0.5f, 1.0f);
// Build the camera matrix and apply it to the ModelView.
Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
headTransform.getHeadView(headView, 0);
// Update the 3d audio engine with the most recent head rotation.
headTransform.getQuaternion(headRotation, 0);
gvrAudioEngine.setHeadRotation(
headRotation[0], headRotation[1], headRotation[2], headRotation[3]);
checkGLError("onReadyToDraw");
}
示例5: onNewFrame
import com.google.vr.sdk.base.HeadTransform; //导入方法依赖的package包/类
/**
* Prepares OpenGL ES before we draw a frame.
*
* @param headTransform The head transformation in the new frame.
*/
@Override
public void onNewFrame(HeadTransform headTransform) {
//rotate the cube, mangle is how fast, x,y,z which directions it rotates.
Matrix.rotateM(mRotationMatrix, 0, mAngle, 0.7f, 0.7f, 1.0f);
// Build the camera matrix and apply it to the ModelView.
Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
headTransform.getHeadView(headView, 0);
}
示例6: onNewFrame
import com.google.vr.sdk.base.HeadTransform; //导入方法依赖的package包/类
@Override
public void onNewFrame(HeadTransform headTransform) {
Matrix.setLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
headTransform.getHeadView(headView, 0);
}