C++ Java Unity
Java Reference
Device Class Reference

Detailed Description

Singleton representation of the device Vuforia is currently running on.

Vuforia supports many different hardware configurations, from mobile apps running on standard mobile or handheld hardware, VR enclosures for mobile phones, and dedicated VR and AR eyewear devices.

This class a provides management and configuration functions for the specific configuration (viewer) that Vuforia is currently running on.

Changes made here primarily affect how the RenderingPrimitives are created and structured.

Inheritance diagram for Device:
EyewearDevice

Classes

class  MODE
 

Public Member Functions

boolean equals (Object obj)
 
Type getType ()
 Get the Type of this instance (may be a subclass of Device). More...
 
boolean isOfType (Type type)
 Get whether this Device instance's type equals or has been derived from the given type. More...
 
boolean setMode (int m)
 Set the rendering mode. More...
 
int getMode ()
 Get the current rendering mode. More...
 
void setViewerActive (boolean active)
 Activate or deactivate the selected viewer. More...
 
boolean isViewerActive ()
 Returns true if a viewer is active, false otherwise. More...
 
ViewerParametersList getViewerList ()
 Get the list of ViewerParameters known to the system. More...
 
boolean selectViewer (ViewerParameters vp)
 Select the viewer to use. More...
 
ViewerParameters getSelectedViewer ()
 Get the ViewerParameters for the currently selected viewer. More...
 
void setConfigurationChanged ()
 Tell Vuforia that the configuration has changed, so new RenderingPrimitives need to be generated. More...
 
RenderingPrimitives getRenderingPrimitives ()
 Get a copy of the RenderingPrimitives for the current configuration. More...
 

Static Public Member Functions

static Device getInstance ()
 Get the singleton instance. More...
 
static Type getClassType ()
 Get the Type for class "Device". More...
 

Member Function Documentation

boolean equals ( Object  obj)
static Device getInstance ( )
static

Get the singleton instance.

This function can be used immediately after Vuforia::init() has succeeded. See the "Lifecycle of a Vuforia app" section on the main Vuforia reference page for more information. Lifecycle of a Vuforia app

static Type getClassType ( )
static

Get the Type for class "Device".

Type getType ( )

Get the Type of this instance (may be a subclass of Device).

boolean isOfType ( Type  type)

Get whether this Device instance's type equals or has been derived from the given type.

boolean setMode ( int  m)

Set the rendering mode.

Note: It is not possible to set the mode to AR until a CameraDevice has been initialised.

Note: Calling this method changes the RenderingPrimitives. If you have cached the result of a previous call to getRenderingPrimitives(), you will need to retrieve new RenderingPrimitives by calling getRenderingPrimitives() again.

Returns
true if the mode was set, otherwise false (check application logs for failure details).
int getMode ( )

Get the current rendering mode.

void setViewerActive ( boolean  active)

Activate or deactivate the selected viewer.

The viewer to activate must first be selected with selectViewer().

Note: Calling this method changes the RenderingPrimitives. If you have cached the result of a previous call to getRenderingPrimitives(), you will need to retrieve new RenderingPrimitives by calling getRenderingPrimitives() again.

boolean isViewerActive ( )

Returns true if a viewer is active, false otherwise.

ViewerParametersList getViewerList ( )

Get the list of ViewerParameters known to the system.

boolean selectViewer ( ViewerParameters  vp)

Select the viewer to use.

Parameters
vpViewerParameters for the viewer, either one taken from getViewerList() or using CustomViewerParamaters .
Returns
true on success, otherwise false (check application logs for failure details).
ViewerParameters getSelectedViewer ( )

Get the ViewerParameters for the currently selected viewer.

void setConfigurationChanged ( )

Tell Vuforia that the configuration has changed, so new RenderingPrimitives need to be generated.

RenderingPrimitives getRenderingPrimitives ( )

Get a copy of the RenderingPrimitives for the current configuration.

The RenderingPrimitives returned from this function are immutable, and tailored to the current device environment.

RenderingPrimitives can be retrieved at the earliest after the first call to Vuforia::onSurfaceChanged().

New RenderingPrimitives will be created whenever the device environment changes in one of the following ways:

If you have cached a copy of the RenderingPrimitives and you make any of the above changes, you will need use this method to get an updated copy of the RenderingPrimitives that reflects the new device environment.

Note: Platform-specific lifecycle transitions (e.g. Pause/Resume) may also cause the configuration to change, so it is advisable to retrieve new RenderingPrimitives after those transitions.

Note: If AR mode has been requested via setMode(), RenderingPrimitives will not be valid until a CameraDevice has been initialised.

Note: This method returns a copy, which has an associated cost. Performant apps should avoid calling this method if the configuration has not changed.