Wikitude Unity Plugin
Public Member Functions | Public Attributes | Properties | List of all members
Wikitude.InstantTracker Class Reference

Instant Trackers provide markerless 3D tracking of a scene, allowing to place augmentations anywhere in the real world. An Instant Tracker can be in two states: Initializing, during which the tracking origin can be set; and Tracking, during which the scene is being tracker. More...

Inheritance diagram for Wikitude.InstantTracker:
Wikitude.TrackerBehaviour

Public Member Functions

void SetState (InstantTrackingState state)
 Request that the tracker change to a new state. When the tracker actually changes to that state, the OnStateChange will be called. More...
 
void ConvertScreenCoordinate (Vector2 screenCoordinate)
 Use this method to perform a hit test on the point cloud coming from the instant tracker. The computation is done on a separate thread and the result is passed to OnScreenConversionComputed. More...
 
void RequestPointCloud ()
 Use this method to request the current point cloud from the instant tracker. The computation is done on a separate thread and the result is passed to OnPointCloudRequestFinished. More...
 

Public Attributes

OnStateChangedEvent OnStateChanged = new OnStateChangedEvent()
 Called whenever the internal state of the tracker is changed, as a result of calling SetState More...
 
OnScreenConversionComputedEvent OnScreenConversionComputed = new OnScreenConversionComputedEvent()
 Called when a screen conversion computation has finished. More...
 
OnPointCloudRequestFinishedEvent OnPointCloudRequestFinished = new OnPointCloudRequestFinishedEvent()
 Called when the point cloud request has finished. More...
 
- Public Attributes inherited from Wikitude.TrackerBehaviour
OnTargetsLoadedEvent OnTargetsLoaded = new OnTargetsLoadedEvent()
 Called when a tracker was successfully initialized. More...
 
OnErrorLoadingTargetsEvent OnErrorLoadingTargets = new OnErrorLoadingTargetsEvent()
 Called when the tracker could not be initialized.

Parameters
errorCodeThe error code associated with the error that occurred.
errorMessageA string that contains more information about why the tracker could not be initialized.
More...
 

Properties

float DeviceHeightAboveGround [get, set]
 Allows changing the estimated height at which the device is currently above the ground in meters. Setting this to an appropriate value will allow the augmentations to have a scale close to the one they would have in reality. Can only be set if the tracker is in the Initializing state. More...
 
InstantTrackingPlaneOrientation TrackingPlaneOrientation [get, set]
 Gets or sets the tracking plane orientation with which instant tracking initializes. If the plane orientation is set to custom, then the TrackingPlaneOrientationAngle will be used. Can only be set if the tracker is in the Initializing state. More...
 
float TrackingPlaneOrientationAngle [get, set]
 Gets or sets the tracking plane orientation angle in degrees. Can only be set while the tracker is in Initializing state. It is only considered if the TrackingPlaneOrientation is set to Custom. Valid values are between -360 and 360 degrees. More...
 

Detailed Description

Instant Trackers provide markerless 3D tracking of a scene, allowing to place augmentations anywhere in the real world. An Instant Tracker can be in two states: Initializing, during which the tracking origin can be set; and Tracking, during which the scene is being tracker.

When Instant Trackers are created at runtime, make sure that all the relevant properties are set before the OnEnable method is called by Unity. At OnEnable, the native tracker is created and all information needs to be available.

Member Function Documentation

void Wikitude.InstantTracker.ConvertScreenCoordinate ( Vector2  screenCoordinate)
inline

Use this method to perform a hit test on the point cloud coming from the instant tracker. The computation is done on a separate thread and the result is passed to OnScreenConversionComputed.

Parameters
screenCoordinateThe 2D screen coordinate that should be converted
void Wikitude.InstantTracker.RequestPointCloud ( )
inline

Use this method to request the current point cloud from the instant tracker. The computation is done on a separate thread and the result is passed to OnPointCloudRequestFinished.

void Wikitude.InstantTracker.SetState ( InstantTrackingState  state)
inline

Request that the tracker change to a new state. When the tracker actually changes to that state, the OnStateChange will be called.

Parameters
stateThe requested state to which the tracker should transition.

Member Data Documentation

OnPointCloudRequestFinishedEvent Wikitude.InstantTracker.OnPointCloudRequestFinished = new OnPointCloudRequestFinishedEvent()

Called when the point cloud request has finished.

Parameters
pointCloudThe array of 3D points that form the current point cloud.
OnScreenConversionComputedEvent Wikitude.InstantTracker.OnScreenConversionComputed = new OnScreenConversionComputedEvent()

Called when a screen conversion computation has finished.

Parameters
successIndicates if the computation succeeded or not.
screenCoordinateThe original screen coordinate that requested the conversion.
pointCloudCoordinateThe converted 3D coordinate in the local space of the trackable.
OnStateChangedEvent Wikitude.InstantTracker.OnStateChanged = new OnStateChangedEvent()

Called whenever the internal state of the tracker is changed, as a result of calling SetState

Parameters
stateThe current state of the tracker.

Property Documentation

float Wikitude.InstantTracker.DeviceHeightAboveGround
getset

Allows changing the estimated height at which the device is currently above the ground in meters. Setting this to an appropriate value will allow the augmentations to have a scale close to the one they would have in reality. Can only be set if the tracker is in the Initializing state.

InstantTrackingPlaneOrientation Wikitude.InstantTracker.TrackingPlaneOrientation
getset

Gets or sets the tracking plane orientation with which instant tracking initializes. If the plane orientation is set to custom, then the TrackingPlaneOrientationAngle will be used. Can only be set if the tracker is in the Initializing state.

float Wikitude.InstantTracker.TrackingPlaneOrientationAngle
getset

Gets or sets the tracking plane orientation angle in degrees. Can only be set while the tracker is in Initializing state. It is only considered if the TrackingPlaneOrientation is set to Custom. Valid values are between -360 and 360 degrees.