Wikitude Unity Plugin
|
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...
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... | |
bool | CanStartTracking () |
Queries whether the state can be changed from initialization to tracking. 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... | |
void | IsPlatformAssistedTrackingSupported (Action< SmartAvailability > callback) |
Starts an async query to check if this device offers platform tracking capabilities to be used by SMART. This should only be called after WikitudeCamera is initialized, during the Start method. More... | |
void | SaveCurrentInstantTarget (string path, Action< string > successHandler=null, Action< Error > errorHandler=null) |
Use this method to persist the currently tracked instant tracking session as a file. Saving the current session as an instant target happens on a background thread. In case the given directory does not exist, the error handler is called with a description and more details. In case the directory exists and a file with the same name in it exists, it will be overridden. The file type is .wto. More... | |
void | LoadInstantTarget (TargetCollectionResource instantTargetResource, InstantTargetRestorationConfiguration configuration, Action< string > successHandler=null, Action< Error > errorHandler=null) |
Use this method to load a previously stored instant target. Loading an instant target happens on a background thread. More... | |
void | LoadInstantTarget (TargetCollectionResource instantTargetResource, InstantTargetRestorationConfiguration configuration) |
Use this method to load a previously stored instant target. Loading an instant target happens on a background thread. More... | |
Public Attributes | |||
OnStateChangedEvent | OnStateChanged = new OnStateChangedEvent() | ||
Called whenever the internal state of the tracker is changed, as a result of calling SetState More... | |||
OnFailedStateChangeEvent | OnFailedStateChange = new OnFailedStateChangeEvent() | ||
Called after an instant tracker failed to change its state internally. More... | |||
OnErrorEvent | OnError = new OnErrorEvent() | ||
Called whenever the instant tracker encounters an unexpected error. 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 targets could not be loaded.
| |||
OnInitializationErrorEvent | OnInitializationError = new OnInitializationErrorEvent() | ||
Called when the tracker could not be initialized.
| |||
Properties | |
bool | SMARTEnabled [get, set] |
Gets or sets whether SMART should to be used or not. More... | |
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... | |
TrackerEfficiencyMode | TrackerEfficiencyMode [get, set] |
Defines the efficiency mode for the tracker. Has to be set before OnEnable is called, otherwise it will have no effect. More... | |
bool | PlaneDetectionEnabled [get, set] |
Defines if plane detecion is enabled for the tracker. More... | |
PlaneFilter | PlaneFilter [get, set] |
Defines a plane filter for the tracker. More... | |
bool | ConvexHullEnabled [get, set] |
Defines if a convex hull is enabled for the tracker. More... | |
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.
|
inline |
Queries whether the state can be changed from initialization to tracking.
For Wikitude's instant tracking algorithm, this functionality currently always returns true because the state change is always possible. For platform assisted tracking (ARKit or ARCore), this function performs a hit test internally to check whether the state can be switched or not.
|
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.
screenCoordinate | The 2D screen coordinate that should be converted |
|
inline |
Starts an async query to check if this device offers platform tracking capabilities to be used by SMART. This should only be called after WikitudeCamera is initialized, during the Start method.
callback | The callback that will be called when the query finishes. |
|
inline |
Use this method to load a previously stored instant target. Loading an instant target happens on a background thread.
instantTargetResource | The target collection resource that points to a .wto file (either on the device or a remote server). |
configuration | The configuration object that should be used when loading the target. |
successHandler | A completion handler that is called once the instant target is fully restored and ready for recognition. |
errorHandler | A completion handler that is called in case the instant target could not be restored. The given Error contains more information why the operation failed. |
|
inline |
Use this method to load a previously stored instant target. Loading an instant target happens on a background thread.
instantTargetResource | The target collection resource that points to a .wto file (either on the device or a remote server). |
configuration | The configuration object that should be used when loading the target. |
|
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.
|
inline |
Use this method to persist the currently tracked instant tracking session as a file. Saving the current session as an instant target happens on a background thread. In case the given directory does not exist, the error handler is called with a description and more details. In case the directory exists and a file with the same name in it exists, it will be overridden. The file type is .wto.
path | A path including the file name to which the current session should be saved to. |
successHandler | A completion handler that is called if the current session could be successfully stored at the given path. This handler might be called from a background thread. |
errorHandler | A completion handler that is called in case the current session could not be successfully stored at the given path. The given Error contains more information why the operation failed. |
|
inline |
Request that the tracker change to a new state. When the tracker actually changes to that state, the OnStateChange will be called.
state | The requested state to which the tracker should transition. |
OnErrorEvent Wikitude.InstantTracker.OnError = new OnErrorEvent() |
Called whenever the instant tracker encounters an unexpected error.
OnFailedStateChangeEvent Wikitude.InstantTracker.OnFailedStateChange = new OnFailedStateChangeEvent() |
Called after an instant tracker failed to change its state internally.
failedState | The state the tracker failed to change to. |
error | An error object describing the reason why the state change failed. |
OnPointCloudRequestFinishedEvent Wikitude.InstantTracker.OnPointCloudRequestFinished = new OnPointCloudRequestFinishedEvent() |
Called when the point cloud request has finished.
pointCloud | The array of 3D points that form the current point cloud. |
OnScreenConversionComputedEvent Wikitude.InstantTracker.OnScreenConversionComputed = new OnScreenConversionComputedEvent() |
Called when a screen conversion computation has finished.
success | Indicates if the computation succeeded or not. |
screenCoordinate | The original screen coordinate that requested the conversion. |
pointCloudCoordinate | The 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
state | The current state of the tracker. |
|
getset |
Defines if a convex hull is enabled for the tracker.
|
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.
|
getset |
Defines if plane detecion is enabled for the tracker.
|
getset |
Defines a plane filter for the tracker.
|
getset |
Gets or sets whether SMART should to be used or not.
|
getset |
Defines the efficiency mode for the tracker. Has to be set before OnEnable is called, otherwise it will have no effect.
|
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.
|
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.