• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GvrView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.vr.sdk.base.GvrView的典型用法代码示例。如果您正苦于以下问题:Java GvrView类的具体用法?Java GvrView怎么用?Java GvrView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GvrView类属于com.google.vr.sdk.base包,在下文中一共展示了GvrView类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initializeGvrView

import com.google.vr.sdk.base.GvrView; //导入依赖的package包/类
public void initializeGvrView() {
	setContentView(R.layout.common_ui);

	GvrView gvrView = (GvrView) findViewById(R.id.gvr_view);
	gvrView.setEGLConfigChooser(8, 8, 8, 8, 16, 8);

	gvrView.setRenderer(this);
	gvrView.setTransitionViewEnabled(true);
	gvrView.setDistortionCorrectionEnabled(!USE_VERTEX_DISPLACEMENT_LENS_DISTORTION);
	gvrView.setOnCardboardBackListener(
			new Runnable() {
				@Override
				public void run() {
					onBackPressed();
				}
			});
	setGvrView(gvrView);
}
 
开发者ID:mobialia,项目名称:jmini3d-vr-demo,代码行数:19,代码来源:VRActivity.java


示例2: onCreate

import com.google.vr.sdk.base.GvrView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  setContentView(R.layout.common_ui);

  GvrView gvrView = (GvrView) findViewById(R.id.gvr_view);
  gvrView.setRenderer(this);
  gvrView.enableCardboardTriggerEmulation();
  setGvrView(gvrView);

  AndroidCompat.setVrModeEnabled(this, true);

  vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

  renderer = new CardboardRenderer(getApplicationContext());

  presenter = new Presenter(new ContentfulInteractor(this));
  presenter.bind(this);
}
 
开发者ID:contentful-labs,项目名称:contentful-cardboard,代码行数:21,代码来源:MainActivity.java


示例3: initializeGvrView

import com.google.vr.sdk.base.GvrView; //导入依赖的package包/类
public void initializeGvrView() {
  setContentView(R.layout.common_ui);

  GvrView gvrView = (GvrView) findViewById(R.id.gvr_view);
  gvrView.setEGLConfigChooser(8, 8, 8, 8, 16, 8);

  gvrView.setRenderer(this);
  gvrView.setTransitionViewEnabled(true);
  gvrView.setOnCardboardBackButtonListener(
      new Runnable() {
        @Override
        public void run() {
          onBackPressed();
        }
      });

  if (gvrView.setAsyncReprojectionEnabled(true)) {
    // Async reprojection decouples the app framerate from the display framerate,
    // allowing immersive interaction even at the throttled clockrates set by
    // sustained performance mode.
    AndroidCompat.setSustainedPerformanceMode(this, true);
  }

  setGvrView(gvrView);
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:26,代码来源:TreasureHuntActivity.java


示例4: initializeGvrView

import com.google.vr.sdk.base.GvrView; //导入依赖的package包/类
private void initializeGvrView() {
    setContentView(R.layout.common_ui);

    GvrView gvrView = (GvrView) findViewById(R.id.gvr_view);
    gvrView.setEGLConfigChooser(8, 8, 8, 8, 16, 8);

    gvrView.setRenderer(this);
    gvrView.setTransitionViewEnabled(true);
    gvrView.setOnCardboardBackButtonListener(
            new Runnable() {
                @Override
                public void run() {
                    onBackPressed();
                }
            });
    setGvrView(gvrView);
}
 
开发者ID:davrempe,项目名称:cardboardAR-lib,代码行数:18,代码来源:GarActivity.java


示例5: initializeGvrView

import com.google.vr.sdk.base.GvrView; //导入依赖的package包/类
public void initializeGvrView() {
  setContentView(R.layout.common_ui);

  GvrView gvrView = (GvrView) findViewById(R.id.gvr_view);
  gvrView.setEGLConfigChooser(8, 8, 8, 8, 16, 8);

  gvrView.setRenderer(this);
  gvrView.setTransitionViewEnabled(true);
  gvrView.setOnCardboardBackButtonListener(
      new Runnable() {
        @Override
        public void run() {
          onBackPressed();
        }
      });
  setGvrView(gvrView);
}
 
开发者ID:zhangjingpu,项目名称:youkes_vr,代码行数:18,代码来源:TreasureHuntActivity.java


示例6: onCreate

import com.google.vr.sdk.base.GvrView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.common_ui);

    //setup the cardbardview and set the renderer for it.
    GvrView gvrView = (GvrView) findViewById(R.id.cardboard_view);
    gvrView.setRenderer(new myStereoRenderer());
    setGvrView(gvrView);

    //this is overlay code from google, that allows us to put text on the "screen" easily.
    overlayView = (CardboardOverlayView) findViewById(R.id.overlay);
    overlayView.show3DToast("Welcome to the demo.");

    vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
}
 
开发者ID:JimSeker,项目名称:CardBoardVR,代码行数:17,代码来源:MainActivity.java


示例7: onCreate

import com.google.vr.sdk.base.GvrView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.common_ui);

    //setup the cardbardview and set the renderer for it.
    GvrView gvrView = (GvrView) findViewById(R.id.cardboard_view);
    mStereoRenderer = new myStereoRenderer();
    gvrView.setRenderer(mStereoRenderer);
    setGvrView(gvrView);

    //this is overlay code from google, that allows us to put text on the "screen" easily.
    overlayView = (CardboardOverlayView) findViewById(R.id.overlay);
    overlayView.show3DToast("Welcome to the demo.");

    vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

}
 
开发者ID:JimSeker,项目名称:CardBoardVR,代码行数:19,代码来源:MainActivity.java


示例8: onCreate

import com.google.vr.sdk.base.GvrView; //导入依赖的package包/类
/**
 * Sets the view to our CardboardView and initializes the transformation matrices we will use
 * to render our scene.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.common_ui);
    GvrView gvrView = (GvrView) findViewById(R.id.cardboard_view);
    gvrView.setEGLConfigChooser(8, 8, 8, 8, 16, 8);
    gvrView.setTransitionViewEnabled(true);
    gvrView.setRenderer(this);
    setGvrView(gvrView);

    modelCube = new float[16];
    camera = new float[16];
    view = new float[16];
    modelViewProjection = new float[16];
    modelView = new float[16];
    modelFloor = new float[16];
    // Model first appears directly in front of user.
    modelPosition = new float[]{0.0f, 0.0f, -MAX_MODEL_DISTANCE / 2.0f};
    headRotation = new float[4];
    headView = new float[16];
    vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

    overlayView = (CardboardOverlayView) findViewById(R.id.overlay);
    overlayView.show3DToast("Pull the magnet when you find an object.");

    // Initialize 3D audio engine.
    gvrAudioEngine = new GvrAudioEngine(this, GvrAudioEngine.RenderingMode.BINAURAL_HIGH_QUALITY);
}
 
开发者ID:JimSeker,项目名称:CardBoardVR,代码行数:34,代码来源:MainActivity.java


示例9: MyScreenController

import com.google.vr.sdk.base.GvrView; //导入依赖的package包/类
public MyScreenController(GvrActivity ctx) {
	buttonLeft = new VRTextureButton(2, 2, "arrow_left.png", new VRTextureButton.VRClickListener() {
		@Override
		public void onClickListener() {
			sceneIndex--;
			if (sceneIndex < 0) {
				sceneIndex = scenes.size() - 1;
			}
		}
	});
	buttonLeft.setPosition(-3, -3, -10);
	buttonRight = new VRTextureButton(2, 2, "arrow_right.png", new VRTextureButton.VRClickListener() {
		@Override
		public void onClickListener() {
			sceneIndex++;
			if (sceneIndex >= scenes.size()) {
				sceneIndex = 0;
			}
		}
	});
	buttonRight.setPosition(3, -3, -10);

	//
	// The distortion correction can be done at the vertex level adding a Shader Plugin to the scene
	//
	ShaderPlugin lensDistortionCorrection = null;
	if (VRActivity.USE_VERTEX_DISPLACEMENT_LENS_DISTORTION) {
		GvrView gvrView = ctx.getGvrView();
		float coefs[] = PincushionUtils.approximateInverse(gvrView.getGvrViewerParams().getDistortion());
		float maxRadius = PincushionUtils.getMaxRadius(gvrView.getScreenParams(), gvrView.getGvrViewerParams());
		lensDistortionCorrection = new LensDistortionShaderPlugin(coefs[0], coefs[1], coefs[2], coefs[3], coefs[4], coefs[5], maxRadius * maxRadius);
	}

	Scene scene = new ObjLoaderScene(ctx);
	scene.addChild(buttonLeft.object3d);
	scene.addChild(buttonRight.object3d);
	if (VRActivity.USE_VERTEX_DISPLACEMENT_LENS_DISTORTION) {
		scene.setShaderPlugin(lensDistortionCorrection);
	}
	scenes.add(scene);

	scene = new CubesScene(ctx);
	scene.addChild(buttonLeft.object3d);
	scene.addChild(buttonRight.object3d);
	if (VRActivity.USE_VERTEX_DISPLACEMENT_LENS_DISTORTION) {
		scene.setShaderPlugin(lensDistortionCorrection);
	}
	scenes.add(scene);

	sceneHUD = new CrossHudScene();
}
 
开发者ID:mobialia,项目名称:jmini3d-vr-demo,代码行数:52,代码来源:MyScreenController.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EntitySpider类代码示例发布时间:2022-05-23
下一篇:
Java Video类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap