当前位置: 首页>>代码示例>>Java>>正文


Java HeadTransform.getHeadView方法代码示例

本文整理汇总了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");
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:24,代码来源:TreasureHuntActivity.java

示例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);
}
 
开发者ID:JimSeker,项目名称:CardBoardVR,代码行数:25,代码来源:myStereoRenderer.java

示例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);
    }
 
开发者ID:JimSeker,项目名称:CardBoardVR,代码行数:27,代码来源:myStereoRenderer.java

示例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");
}
 
开发者ID:JimSeker,项目名称:CardBoardVR,代码行数:23,代码来源:MainActivity.java

示例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);
}
 
开发者ID:JimSeker,项目名称:CardBoardVR,代码行数:17,代码来源:myStereoRenderer.java

示例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);
}
 
开发者ID:dbrant,项目名称:cardboard-mpo,代码行数:6,代码来源:MainActivity.java


注:本文中的com.google.vr.sdk.base.HeadTransform.getHeadView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。