C++ Java Unity
Unity Reference
VuforiaARController Class Reference

The VuforiaBehaviour class handles tracking and triggers native video background rendering. The class updates all Trackables in the scene. More...

Inheritance diagram for VuforiaARController:
ARController

Public Types

enum  WorldCenterMode {
  SPECIFIC_TARGET,
  FIRST_TARGET,
  DEVICE
}
 The world center mode defines how the relative coordinates between Trackables and camera are translated into Unity world coordinates. If a world center is present the virtual camera in the Unity scene is transformed with respect to that. The world center mode is set through the Unity inspector. More...
 

Public Member Functions

ScreenOrientation GetSurfaceOrientation ()
 This method returns the surface orientation. More...
 
Rect GetVideoBackgroundRectInViewPort ()
 The are in the viewport that is covered by the video background. More...
 
void RegisterBackgroundTextureChangedCallback (Action callback)
 Register for a callback that is invoked when the background texture is changed. More than one callback can be registered. More...
 
void RegisterBeforeVuforiaTrackersInitializedCallback (Action callback)
 Register for a callback that is invoked even before Vuforia has initialized the trackers. This should be used in particular when override the fusion mode in the configuration. Should be called from an Awake() method to not miss the exact callback time between the two. More than one callback can be registered. More...
 
void RegisterOnPauseCallback (Action< bool > callback)
 Register for a callback that is invoked before Vuforia is pausing when the application is paused, and after Vuforia resumes when the application resumes. This can be used e.g. for restoring a focus mode after an application pause. More than one callback can be registered. More...
 
void RegisterTrackablesUpdatedCallback (Action callback)
 Register for a callback that is invoked after the state of all trackables has been updated during a frame. More than one callback can be registered. More...
 
void RegisterVideoBgConfigChangedCallback (Action onVbConfigChangedAction)
 This method registers a new video background event handler at the Tracker. These handlers are called as soon as the video background config has changed More...
 
void RegisterVuforiaInitializedCallback (Action callback)
 Register for a callback that is invoked after Vuforia has initialized and before the camera has started. Should be called from an Awake() method to not miss the exact callback time between the two. More than one callback can be registered. More...
 
void RegisterVuforiaStartedCallback (Action callback)
 Register for a callback that is invoked after Vuforia has completely started, including camera and trackers. More than one callback can be registered. More...
 
void SetWorldCenter (TrackableBehaviour trackable)
 This method is used to set the world center in "USER" mode. More...
 
void SetWorldCenterMode (WorldCenterMode value)
 This method is used to set the world center mode. More...
 
void UnregisterBackgroundTextureChangedCallback (Action callback)
 Unregister a previously registered callback. More...
 
void UnregisterBeforeVuforiaTrackersInitializedCallback (Action callback)
 Unregister a previously registered callback. More...
 
void UnregisterOnPauseCallback (Action< bool > callback)
 Unregister a previously registered callback. More...
 
void UnregisterTrackablesUpdatedCallback (Action callback)
 Unregister a previously registered callback. More...
 
bool UnregisterVideoBgConfigChangedCallback (Action onVbConfigChangedAction)
 This method registers a new video background event handler at the Tracker. Returns "false" if event handler does not exist. More...
 
void UnregisterVuforiaInitializedCallback (Action callback)
 Unregister a previously registered callback. More...
 
void UnregisterVuforiaStartedCallback (Action callback)
 Unregister a previously registered callback. More...
 
void UpdateState (bool forceUpdate, bool reapplyOldState)
 Updates the scene with the latest tracking data and calls various callbacks More...
 

Static Public Member Functions

static void RegisterARController ()
 

Properties

CameraDevice.CameraDeviceMode CameraDeviceMode [get]
 This property is used to query the currently set camera device mode (DEFAULT, SPEED or QUALITY) More...
 
bool HasStarted [get]
 If Vuforia has started successfully More...
 
static VuforiaARController Instance [get]
 
TrackableBehaviour WorldCenter [get]
 This property is used to query the world center Trackable (will return null in "NONE" mode). More...
 
WorldCenterMode WorldCenterModeSetting [get]
 This property is used to query the active world center mode. More...
 

Detailed Description

The VuforiaBehaviour class handles tracking and triggers native video background rendering. The class updates all Trackables in the scene.

Member Enumeration Documentation

enum WorldCenterMode
strong

The world center mode defines how the relative coordinates between Trackables and camera are translated into Unity world coordinates. If a world center is present the virtual camera in the Unity scene is transformed with respect to that. The world center mode is set through the Unity inspector.

Enumerator
SPECIFIC_TARGET 

User defines a single Trackable that defines the world center.

FIRST_TARGET 

Tracker uses the first Trackable that comes into view as the world center (world center changes during runtime).

DEVICE 

The device/camera is considered the world center, trackables are positioned with respect to it.

Member Function Documentation

ScreenOrientation GetSurfaceOrientation ( )

This method returns the surface orientation.

Rect GetVideoBackgroundRectInViewPort ( )

The are in the viewport that is covered by the video background.

static void RegisterARController ( )
static
void RegisterBackgroundTextureChangedCallback ( Action  callback)

Register for a callback that is invoked when the background texture is changed. More than one callback can be registered.

void RegisterBeforeVuforiaTrackersInitializedCallback ( Action  callback)

Register for a callback that is invoked even before Vuforia has initialized the trackers. This should be used in particular when override the fusion mode in the configuration. Should be called from an Awake() method to not miss the exact callback time between the two. More than one callback can be registered.

void RegisterOnPauseCallback ( Action< bool >  callback)

Register for a callback that is invoked before Vuforia is pausing when the application is paused, and after Vuforia resumes when the application resumes. This can be used e.g. for restoring a focus mode after an application pause. More than one callback can be registered.

void RegisterTrackablesUpdatedCallback ( Action  callback)

Register for a callback that is invoked after the state of all trackables has been updated during a frame. More than one callback can be registered.

void RegisterVideoBgConfigChangedCallback ( Action  onVbConfigChangedAction)

This method registers a new video background event handler at the Tracker. These handlers are called as soon as the video background config has changed

void RegisterVuforiaInitializedCallback ( Action  callback)

Register for a callback that is invoked after Vuforia has initialized and before the camera has started. Should be called from an Awake() method to not miss the exact callback time between the two. More than one callback can be registered.

void RegisterVuforiaStartedCallback ( Action  callback)

Register for a callback that is invoked after Vuforia has completely started, including camera and trackers. More than one callback can be registered.

void SetWorldCenter ( TrackableBehaviour  trackable)

This method is used to set the world center in "USER" mode.

void SetWorldCenterMode ( WorldCenterMode  value)

This method is used to set the world center mode.

void UnregisterBackgroundTextureChangedCallback ( Action  callback)

Unregister a previously registered callback.

void UnregisterBeforeVuforiaTrackersInitializedCallback ( Action  callback)

Unregister a previously registered callback.

void UnregisterOnPauseCallback ( Action< bool >  callback)

Unregister a previously registered callback.

void UnregisterTrackablesUpdatedCallback ( Action  callback)

Unregister a previously registered callback.

bool UnregisterVideoBgConfigChangedCallback ( Action  onVbConfigChangedAction)

This method registers a new video background event handler at the Tracker. Returns "false" if event handler does not exist.

void UnregisterVuforiaInitializedCallback ( Action  callback)

Unregister a previously registered callback.

void UnregisterVuforiaStartedCallback ( Action  callback)

Unregister a previously registered callback.

void UpdateState ( bool  forceUpdate,
bool  reapplyOldState 
)

Updates the scene with the latest tracking data and calls various callbacks

Parameters
forceUpdateForces updates to be made even if called multiple times during a single frame
reapplyOldStateUpdates the scene again even when the state has not changed. This can be useful if the camera has been moved, but no new tracking state has been reported yet.

Property Documentation

CameraDevice.CameraDeviceMode CameraDeviceMode
get

This property is used to query the currently set camera device mode (DEFAULT, SPEED or QUALITY)

bool HasStarted
get

If Vuforia has started successfully

VuforiaARController Instance
staticget
TrackableBehaviour WorldCenter
get

This property is used to query the world center Trackable (will return null in "NONE" mode).

WorldCenterMode WorldCenterModeSetting
get

This property is used to query the active world center mode.