本文整理汇总了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;未经允许,请勿转载。 |
请发表评论