C++ Java Unity
Unity Reference
VuforiaUnity Class Reference

A static utility class that exposes helper functions from Vuforia More...

Public Types

enum  InitError {
  INIT_LICENSE_ERROR_BAD_REQUEST = -12,
  INIT_VUFORIA_DRIVER_FAILED = -11,
  INIT_EXTERNAL_DEVICE_NOT_DETECTED = -10,
  INIT_LICENSE_ERROR_PRODUCT_TYPE_MISMATCH = -9,
  INIT_LICENSE_ERROR_CANCELED_KEY = -8,
  INIT_LICENSE_ERROR_NO_NETWORK_TRANSIENT = -7,
  INIT_LICENSE_ERROR_NO_NETWORK_PERMANENT = -6,
  INIT_LICENSE_ERROR_INVALID_KEY = -5,
  INIT_LICENSE_ERROR_MISSING_KEY = -4,
  INIT_NO_CAMERA_ACCESS = -3,
  INIT_DEVICE_NOT_SUPPORTED = -2,
  INIT_ERROR = -1,
  INIT_ONGOING = 0,
  INIT_SUCCESS = 100
}
 InitError is an error value that is returned by Vuforia if something goes wrong at initialization. More...
 
enum  StorageType {
  STORAGE_APP,
  STORAGE_APPRESOURCE,
  STORAGE_ABSOLUTE
}
 Storage type is used to interpret a given path string. More...
 
enum  VuforiaHint {
  HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS = 0,
  HINT_MAX_SIMULTANEOUS_OBJECT_TARGETS = 1,
  HINT_DELAYED_LOADING_OBJECT_DATASETS = 2,
  HINT_ASYNC_FETCH_OF_LATEST_CALIBRATION = 3,
  HINT_MODEL_TARGET_RECO_WHILE_EXTENDED_TRACKED = 4,
  HINT_STATIC_DEVICE_TRACKER = 5
}
 Use when calling setHint() More...
 

Static Public Member Functions

static void Deinit ()
 Deinitializes Vuforia More...
 
static string GetVuforiaLibraryVersion ()
 Returns the version of the Vuforia SDK More...
 
static bool IsRendererDirty ()
 Checks if the GL surface has changed More...
 
static void OnPause ()
 Executes AR-specific tasks upon pausing the Unity application More...
 
static void OnResume ()
 Executes AR-specific tasks upon resuming the Unity application More...
 
static bool SetDriverLibrary (string libraryName, IntPtr userData)
 Sets up the name of the library that Vuforia loads dynamically and uses as an external source of camera or other input data. The library must support the Vuforia Driver API and it must be placed inside the app package to be loaded properly. The exact path depends on the platform: More...
 
static bool SetDriverLibrary (string libraryName)
 Sets up the name of the library that Vuforia loads dynamically and uses as an external source of camera or other input data. The library must support the Vuforia Driver API and it must be placed inside the app package to be loaded properly. The exact path depends on the platform: More...
 
static bool SetHint (VuforiaHint hint, int value)
 Sets a hint for the Vuforia SDK Hints help the SDK to understand the developer's needs. However, depending on the device or SDK version the hints might not be taken into consideration. Returns false if the hint is unknown or deprecated. More...
 
static bool SetHint (uint hint, int value)
 Sets a hint for the Vuforia SDK Hints help the SDK to understand the developer's needs. However, depending on the device or SDK version the hints might not be taken into consideration. Returns false if the hint is unknown or deprecated. More...
 
static bool SetHolographicAppCoordinateSystem (System.IntPtr appSpecifiedCS)
 
static void SetHoloLensApiAbstraction (IHoloLensApiAbstraction holoLensApiAbstraction)
 
static void SetRendererDirty ()
 Raises a flag that the rendering functionality needs to be reconfigured e.g. when the projection matrix of the camera was changed externally. More...
 

Detailed Description

A static utility class that exposes helper functions from Vuforia

Member Enumeration Documentation

enum InitError
strong

InitError is an error value that is returned by Vuforia if something goes wrong at initialization.

Enumerator
INIT_LICENSE_ERROR_BAD_REQUEST 

Unable to verify license key due to bad request.

INIT_VUFORIA_DRIVER_FAILED 

Vuforia Driver library failed to open.

INIT_EXTERNAL_DEVICE_NOT_DETECTED 

Dependent external device not detected/plugged in.

INIT_LICENSE_ERROR_PRODUCT_TYPE_MISMATCH 

Provided license key is not valid for this product.

INIT_LICENSE_ERROR_CANCELED_KEY 

Provided license key is no longer valid.

INIT_LICENSE_ERROR_NO_NETWORK_TRANSIENT 

Unable to verify license key due to network (Transient Error)

INIT_LICENSE_ERROR_NO_NETWORK_PERMANENT 

Unable to verify license key due to network (Permanent Error)

INIT_LICENSE_ERROR_INVALID_KEY 

Invalid license key passed to SDK.

INIT_LICENSE_ERROR_MISSING_KEY 

License key is missing.

INIT_NO_CAMERA_ACCESS 

Cannot access the camera.

INIT_DEVICE_NOT_SUPPORTED 

The device is not supported by Vuforia.

INIT_ERROR 

Another (unknown) initialization error has occured.

INIT_ONGOING 

Initialization is currently in progress

INIT_SUCCESS 

Initialization has successfully completed

enum StorageType
strong

Storage type is used to interpret a given path string.

Enumerator
STORAGE_APP 

Indicates a relative path to an app local storage location.

STORAGE_APPRESOURCE 

Indicates a relative path to a resource bundled with the application.

STORAGE_ABSOLUTE 

Indicates an absolute path.

enum VuforiaHint
strong

Use when calling setHint()

Enumerator
HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS 

Specify the number of Image Targets that are handled by the tracker at once (default 1).

HINT_MAX_SIMULTANEOUS_OBJECT_TARGETS 

Specify the number of Object Targets that are handled by the tracker at once (default 1).

HINT_DELAYED_LOADING_OBJECT_DATASETS 

Enable/disable delayed loading for object target dataset a value of 0 means disabled, 1 means enabled (default 0).

HINT_ASYNC_FETCH_OF_LATEST_CALIBRATION 

Asynchronously fetch the latest device calibration profile

This hint enables asynchronous fetching of the latest device calibration profile from the cloud, which does not block Vuforia's initialization until the calibration profile is successfully acquired. Skipping the blocking attempt to get the latest profile can cause the SDK to run in a non-optimized mode on the first run. By default, acquiring of the latest device calibration profile may block Vuforia's initialization for up to a maximum timeout of 10 seconds or until a new profile is successfully acquired from the cloud. Please note that the hint should be set before Vuforia's initialization to be effective. To enable asynchronous fetching set the hint value to 1. To disable asynchronous fetching set the hint value to 0. Default is: 0.

HINT_MODEL_TARGET_RECO_WHILE_EXTENDED_TRACKED 

Turn on recognition engine for a trained dataset while extended tracking a model

This hint enables the recognition engine when extended tracking an existing target. It needs to be set afer the ObjectTracker has been initialized. Valid values for the hint are 0 or 1. When set to 0, the recognition engine is stopped for trained datasets after a model target has been found and is never turned on again automatically. The datset needs to be deactivated and activated, or the tracker stopped and started, in order to turn on recognition again. When set to 1, recognition is turned on as soon as an existing target is only extended tracked. If the recogntition engine finds a new target in the image frame, tracking will be switched to the newly identifed target, resulting in tracking loss of the prior model target Default is: 1

HINT_STATIC_DEVICE_TRACKER 

Configures the device tracker for statically mounted devices, e.g. a mobile device on a tripod looking at an object. In such a case, standard Vuforia fusion tracking will not succeed to initialize for lack of movement. This hint configures the device tracker to return static poses to stabilize tracking e.g. in case of the object being occluded. Valid values for the hint are 0 or 1 When set to 0, the device tracker is initialised normally. When set to 1, the device tracker is changed into the static mode. Default is: 0

Note
This hint can only be set before the DeviceTracker has been initialized

Member Function Documentation

static void Deinit ( )
static

Deinitializes Vuforia

static string GetVuforiaLibraryVersion ( )
static

Returns the version of the Vuforia SDK

static bool IsRendererDirty ( )
static

Checks if the GL surface has changed

static void OnPause ( )
static

Executes AR-specific tasks upon pausing the Unity application

static void OnResume ( )
static

Executes AR-specific tasks upon resuming the Unity application

static bool SetDriverLibrary ( string  libraryName,
IntPtr  userData 
)
static

Sets up the name of the library that Vuforia loads dynamically and uses as an external source of camera or other input data. The library must support the Vuforia Driver API and it must be placed inside the app package to be loaded properly. The exact path depends on the platform:

  • Android: [apk-root-dir]/lib/[architecture]/library.so
  • UWP: [appx-root-dir]/library.dll
  • iOS: [appx-root-dir]/Frameworks/library.framework

This function MUST be called before Vuforia::init() to have any effect. Once the library name has been set and Vuforia::init() is called, Vuforia will try to initialize and use the functionality provided by the Driver.

To disable the Vuforia Driver functionality the following must be done:

  • Call Vuforia::deinit()
  • Call Vuforia::setDriverLibrary() with nullptr or empty string as the libraryName.
  • Call Vuforia::init()

This functionality is currently only supported on Android and UWP platforms.

Parameters
libraryNamelibraryName Full file name of the Driver library. Setting this to nullptr or empty string, will disable the use of the Driver functionalty during subsequent calls to Vuforia::init().
userDataArbitrary user defined data to be passed into the library, when it gets loaded. Vuforia only forwards the data and doesn't process it in any way.
Returns
true if Vuforia was in uninitialized state and the parameter was therefore set successfully
static bool SetDriverLibrary ( string  libraryName)
static

Sets up the name of the library that Vuforia loads dynamically and uses as an external source of camera or other input data. The library must support the Vuforia Driver API and it must be placed inside the app package to be loaded properly. The exact path depends on the platform:

  • Android: [apk-root-dir]/lib/[architecture]/library.so
  • UWP: [appx-root-dir]/library.dll

This function MUST be called before Vuforia::init() to have any effect. Once the library name has been set and Vuforia::init() is called, Vuforia will try to initialize and use the functionality provided by the Driver.

To disable the Vuforia Driver functionality the following must be done:

  • Call Vuforia::deinit()
  • Call Vuforia::setDriverLibrary() with nullptr or empty string as the libraryName.
  • Call Vuforia::init()

This functionality is currently only supported on Android and UWP platforms.

Parameters
libraryNameibraryName Full file name of the Vuforia Driver library. Setting this to nullptr or empty string, will disable the use of the Vuforia Driver functionalty during subsequent calls to Vuforia::init().
Returns
true if Vuforia was in uninitialized state and the parameter was therefore set successfully
static bool SetHint ( VuforiaHint  hint,
int  value 
)
static

Sets a hint for the Vuforia SDK Hints help the SDK to understand the developer's needs. However, depending on the device or SDK version the hints might not be taken into consideration. Returns false if the hint is unknown or deprecated.

static bool SetHint ( uint  hint,
int  value 
)
static

Sets a hint for the Vuforia SDK Hints help the SDK to understand the developer's needs. However, depending on the device or SDK version the hints might not be taken into consideration. Returns false if the hint is unknown or deprecated.

static bool SetHolographicAppCoordinateSystem ( System.IntPtr  appSpecifiedCS)
static
static void SetHoloLensApiAbstraction ( IHoloLensApiAbstraction  holoLensApiAbstraction)
static
static void SetRendererDirty ( )
static

Raises a flag that the rendering functionality needs to be reconfigured e.g. when the projection matrix of the camera was changed externally.