Most visited

Recently visited

ViroViewGVR

public class ViroViewGVR
extends ViroView

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.viro.core.ViroView
           ↳ com.viro.core.ViroViewGVR


ViroViewGVR is a ViroView for rendering content in stereo for VR headsets using the Google GVR SDK. This includes both Google Cardboard and Daydream headsets. ViroViewGVR handles all GVR initialization.

Summary

Public constructors

ViroViewGVR(Context context, RendererStartListener rendererStartListener, Runnable vrExitListener)

Create a new ViroViewGVR with the default RendererConfiguration.

ViroViewGVR(Context context, RendererStartListener rendererStartListener, Runnable vrExitListener, RendererConfiguration config)

Create a new ViroViewGVR with the given RendererConfiguration, which determines the rendering techniques and rendering fidelity to use for this View.

Public methods

void recenterTracking()

For VR applications, re-centers the head orientation.

void setScene(Scene scene)

Set the Scene this ViroView should render.

void setVRExitRunnable(Runnable vrExitRunnable)

Runnable to invoke when the user manually exits VR mode by tapping on GVR's close button.

void setVRModeEnabled(boolean vrModeEnabled)

For VR applications, set this to true to render in stereo mode.

Public constructors

ViroViewGVR

ViroViewGVR (Context context, 
                RendererStartListener rendererStartListener, 
                Runnable vrExitListener)

Create a new ViroViewGVR with the default RendererConfiguration.

Parameters
context Context: The activity context.

rendererStartListener RendererStartListener: Callback invoked when the renderer has finished initializing. Optional, may be null.

vrExitListener Runnable: Runnable to invoke when the user manually exits VR mode by tapping on GVR's close button. Optional, may be null.

ViroViewGVR

ViroViewGVR (Context context, 
                RendererStartListener rendererStartListener, 
                Runnable vrExitListener, 
                RendererConfiguration config)

Create a new ViroViewGVR with the given RendererConfiguration, which determines the rendering techniques and rendering fidelity to use for this View.

Parameters
context Context: The activity context.

rendererStartListener RendererStartListener: Callback invoked when the renderer has finished initializing. Optional, may be null.

vrExitListener Runnable: Runnable to invoke when the user manually exits VR mode by tapping on GVR's close button. Optional, may be null.

config RendererConfiguration: The RendererConfiguration to use.

Public methods

recenterTracking

void recenterTracking ()

For VR applications, re-centers the head orientation. This resets the yaw to zero, but leaves pitch and roll unmodified.

setScene

void setScene (Scene scene)

Set the Scene this ViroView should render. ARScene should be used for augmented reality applications.

Parameters
scene Scene: The Scene to render in this ViroView.

setVRExitRunnable

void setVRExitRunnable (Runnable vrExitRunnable)

Runnable to invoke when the user manually exits VR mode by tapping on GVR's close button.

Parameters
vrExitRunnable Runnable: Runnable

setVRModeEnabled

void setVRModeEnabled (boolean vrModeEnabled)

For VR applications, set this to true to render in stereo mode. Stereo renders two images: one for the left eye and one for the right, each perturbed slightly to simulate depth. This mode is meant to be used in a VR headset. Set to false to render to the entire screen, for use when users do not have a headset.

Defaults to true.

Parameters
vrModeEnabled boolean: True to enable VR mode.

Hooray!