Loading...
Searching...
No Matches
VuforiaApplication Class Reference

The VuforiaApplication class provides a way to initialize and deinitialize Vuforia as well register to lifecycle events. More...

Public Member Functions

void Deinit ()
 Deinitialize Vuforia Engine.
 
VuforiaBehaviour GetVuforiaBehaviour ()
 The VuforiaBehaviour is used to control Vuforia at runtime, per scene Returns null if there is no VuforiaBehaviour in the scene.
 
void Initialize ()
 Initialize Vuforia. Used when "delayed initialization" has been selected in the VuforiaConfiguration, otherwise this happens automatically While running in the Unity Editor, it takes couple frames to initialize.
 
void Initialize (FusionProviderOption fusionProviderOption)
 Initialize Vuforia while specifying a configuration for the Fusion Provider. Used when "delayed initialization" has been selected in the VuforiaConfiguration.
 
void Initialize (string driverName, IntPtr userData)
 Initialize Vuforia while setting up the name of the library that is loaded dynamically and used 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:
 
void SetHint (int hint, bool value)
 Advanced option to set an internal hint code before initialization.
 

Static Public Member Functions

static string GetVuforiaLibraryVersion ()
 Returns the version of the Vuforia SDK.
 

Properties

static VuforiaApplication Instance [get]
 
bool IsInitialized [get]
 Returns true if the Vuforia Engine was successfully initialized.
 
bool IsRunning [get]
 Returns true if the Vuforia Engine has been started and is currently running.
 
Action OnBeforeVuforiaInitialized
 Use this callback for configuring tasks before initializing Vuforia Engine. The callback is triggered before Vuforia Engine is initialized, provided that Delayed Initialization is enabled, or before performing an initialization after a deinitialization of Vuforia Engine.
 
Action< VuforiaInitErrorOnVuforiaInitialized
 Triggered when Vuforia Engine has initialized.
 
Action OnVuforiaStarted
 Triggered after Vuforia has started delivering frame updates.
 

Events

Action OnVuforiaDeinitialized
 Triggered when Vuforia has been deinitialized.
 
Action< VuforiaEngineErrorOnVuforiaError
 Triggered when a lifecycle-related engine error occurs after initialization.
 
Action< bool > OnVuforiaPaused
 Triggered when Vuforia is paused True when Vuforia was paused.
 
Action OnVuforiaStopped
 Triggered when Vuforia has been stopped.
 

Detailed Description

The VuforiaApplication class provides a way to initialize and deinitialize Vuforia as well register to lifecycle events.

Member Function Documentation

◆ Deinit()

void Deinit ( )
inline

Deinitialize Vuforia Engine.

◆ GetVuforiaBehaviour()

VuforiaBehaviour GetVuforiaBehaviour ( )
inline

The VuforiaBehaviour is used to control Vuforia at runtime, per scene Returns null if there is no VuforiaBehaviour in the scene.

Returns

◆ GetVuforiaLibraryVersion()

static string GetVuforiaLibraryVersion ( )
inlinestatic

Returns the version of the Vuforia SDK.

◆ Initialize() [1/3]

void Initialize ( )
inline

Initialize Vuforia. Used when "delayed initialization" has been selected in the VuforiaConfiguration, otherwise this happens automatically While running in the Unity Editor, it takes couple frames to initialize.

◆ Initialize() [2/3]

void Initialize ( FusionProviderOption fusionProviderOption)
inline

Initialize Vuforia while specifying a configuration for the Fusion Provider. Used when "delayed initialization" has been selected in the VuforiaConfiguration.

Parameters
fusionProviderOptionThe Fusion Provider configuration.

◆ Initialize() [3/3]

void Initialize ( string driverName,
IntPtr userData )
inline

Initialize Vuforia while setting up the name of the library that is loaded dynamically and used 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

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 VuforiaApplication.Instance.Deinit()
  • Call VuforiaApplication.Instance.Initialize()

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

Parameters
driverNameFull file name of the Driver library. Setting this to null or empty string, will disable the use of the Driver functionality.
userDataOptional 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. This value can be accessed at any time throughout the Vuforia lifecycle, so it MUST be valid until Vuforia is de-initialized. Set to IntPtr.Zero if not needed.

◆ SetHint()

void SetHint ( int hint,
bool value )
inline

Advanced option to set an internal hint code before initialization.

Parameters
hint
value

Property Documentation

◆ Instance

VuforiaApplication Instance
staticget

◆ IsInitialized

bool IsInitialized
get

Returns true if the Vuforia Engine was successfully initialized.

◆ IsRunning

bool IsRunning
get

Returns true if the Vuforia Engine has been started and is currently running.

◆ OnBeforeVuforiaInitialized

Action OnBeforeVuforiaInitialized
addremove

Use this callback for configuring tasks before initializing Vuforia Engine. The callback is triggered before Vuforia Engine is initialized, provided that Delayed Initialization is enabled, or before performing an initialization after a deinitialization of Vuforia Engine.

◆ OnVuforiaInitialized

Action<VuforiaInitError> OnVuforiaInitialized
addremove

Triggered when Vuforia Engine has initialized.

◆ OnVuforiaStarted

Action OnVuforiaStarted
addremove

Triggered after Vuforia has started delivering frame updates.

Event Documentation

◆ OnVuforiaDeinitialized

Action OnVuforiaDeinitialized

Triggered when Vuforia has been deinitialized.

◆ OnVuforiaError

Action<VuforiaEngineError> OnVuforiaError

Triggered when a lifecycle-related engine error occurs after initialization.

◆ OnVuforiaPaused

Action<bool> OnVuforiaPaused

Triggered when Vuforia is paused True when Vuforia was paused.

◆ OnVuforiaStopped

Action OnVuforiaStopped

Triggered when Vuforia has been stopped.