Class InstantTracker
A class to control InstantTrackers.
Inheritance
Namespace: wikitude.sdk.uwp
Assembly: wikitude.sdk.dll
Syntax
public sealed class InstantTracker
Methods
canStartTracking()
Queries whether the state can be changed from initialization to tracking.
Declaration
public bool canStartTracking()
Returns
Type | Description |
---|---|
System.Boolean |
convertScreenCoordinate(Pointf, ScreenCoordinateConversionHandler)
Use this method to perform a hit test on the point cloud coming from the instant tracker.
This operation is performed on a separate thread and the ScreenCoordinateConversionHandler is called from that thread. In case there is no point at the given screen coordinate, the bool property in the completion handler is set to false. Otherwise the given 3D coordinate can be used to position an augmentation at this point. Because this operation uses screen coordinates, please make sure that surface changed is called at least once before invoking this method.
Declaration
public void convertScreenCoordinate(Pointf screenCoordinate_, ScreenCoordinateConversionHandler completionHandler_)
Parameters
Type | Name | Description |
---|---|---|
Pointf | screenCoordinate_ | The screen coordinate for which a hit test should be performed. |
ScreenCoordinateConversionHandler | completionHandler_ | The delegate that should be called when the hit test computation finishes. This will be called from another thread. |
loadExistingInstantTarget(TargetCollectionResource, InstantTargetRestorationConfiguration, InstantTrackerLoadSuccessHandler, InstantTrackerLoadErrorHandler)
Loads the provided instant target and starts tracking it.
Declaration
public void loadExistingInstantTarget(TargetCollectionResource instantTargetResource_, InstantTargetRestorationConfiguration instantTargetRestorationConfiguration_, InstantTrackerLoadSuccessHandler successHandler_, InstantTrackerLoadErrorHandler errorHandler_)
Parameters
Type | Name | Description |
---|---|---|
TargetCollectionResource | instantTargetResource_ | The target collection resource that points to a .wto file (either on the device or a remote server). Please refer to createTargetCollectionResource(String) for more information. |
InstantTargetRestorationConfiguration | instantTargetRestorationConfiguration_ | This handler is used to provide further information on how the previously stored instant target should be restored. Please refer to the InstantTargetRestorationConfiguration class reference for more information. |
InstantTrackerLoadSuccessHandler | successHandler_ | The delegate that is called once the instant target is fully restored and ready for recognition. |
InstantTrackerLoadErrorHandler | errorHandler_ | The delegate that is called in case the instant target could not be restored. The given NSError contains more information why the operation failed. |
saveCurrentInstantTarget(String, InstantTrackerSaveSuccessHandler, InstantTrackerSaveErrorHandler)
Saves the current scene created by the InstantTracker.
The saved file can then be loaded as TargetCollectionResource using loadExistingInstantTarget(TargetCollectionResource, InstantTargetRestorationConfiguration, InstantTrackerLoadSuccessHandler, InstantTrackerLoadErrorHandler).
This enables that AR experiences can be persistently accessed by multiple users across devices and operating systems.
Declaration
public void saveCurrentInstantTarget(string instantTargetDestinationPath_, InstantTrackerSaveSuccessHandler successHandler_, InstantTrackerSaveErrorHandler errorHandler_)
Parameters
Type | Name | Description |
---|---|---|
System.String | instantTargetDestinationPath_ | Path to save the InstantTarget. Must be a valid path where the application is allowed to write. |
InstantTrackerSaveSuccessHandler | successHandler_ | The delegate that is called when the InstantTarget is successfully saved. |
InstantTrackerSaveErrorHandler | errorHandler_ | The delegate that is called when the method fails. |
setActiveInstantTrackingState(InstantTrackingState)
Changes the tracking state of the tracker.
The tracking state is not changed immediately, and the changedState callback on the InstantTrackerObserver can be used to get notified of exactly when that happens.
Declaration
public void setActiveInstantTrackingState(InstantTrackingState state_)
Parameters
Type | Name | Description |
---|---|---|
InstantTrackingState | state_ | The new state to which the instant tracker should switch to. |
setDeviceHeightAboveGround(Single)
Allows changing the estimated height at which the device is currently above the ground.
Setting this to an appropriate value will allow the augmentations to have a scale close to the one they would have in reality.
Declaration
public void setDeviceHeightAboveGround(float height_)
Parameters
Type | Name | Description |
---|---|---|
System.Single | height_ | The estimated device height above the ground in meters. |
Events
ChangedInitializationPose
This event is fired when the InitializationPose has changed. Happens only while the InstantTracker is in initialization state.
Declaration
public event ChangedInitializationPoseEventHandler ChangedInitializationPose
Event Type
Type | Description |
---|---|
ChangedInitializationPoseEventHandler |
ChangedState
This event is fired when the state of the InstantTracker has changed.
Declaration
public event ChangedStateEventHandler ChangedState
Event Type
Type | Description |
---|---|
ChangedStateEventHandler |
DidTrack
This event is fired when the InstantTracker tracked a change.
Declaration
public event DidTrackEventHandler DidTrack
Event Type
Type | Description |
---|---|
DidTrackEventHandler |
FailedStateChange
This event is fired when the InstantTracker failed to change state.
Declaration
public event InstantTrackerFailedStateChangeHandler FailedStateChange
Event Type
Type | Description |
---|---|
InstantTrackerFailedStateChangeHandler |
LostPlane
This event is fired whenever a previously known Plane is not found anymore.
Declaration
public event InstantTrackerLostPlaneEventHandler LostPlane
Event Type
Type | Description |
---|---|
InstantTrackerLostPlaneEventHandler |
RecognizedPlane
This event is fired when the InstantTracker recognized a new Plane that was previously unknown.
Declaration
public event InstantTrackerRecognizedPlaneEventHandler RecognizedPlane
Event Type
Type | Description |
---|---|
InstantTrackerRecognizedPlaneEventHandler |
StartedTracking
This event is fired when the InstantTracker started tracking.
Declaration
public event StartedTrackingEventHandler StartedTracking
Event Type
Type | Description |
---|---|
StartedTrackingEventHandler |
StoppedTracking
This event is fired when the InstantTracker stopped tracking.
Declaration
public event StoppedTrackingEventHandler StoppedTracking
Event Type
Type | Description |
---|---|
StoppedTrackingEventHandler |
TrackedPlane
This event is fired whenever a previously known Plane was tracked again.
Declaration
public event InstantTrackerTrackedPlaneEventHandler TrackedPlane
Event Type
Type | Description |
---|---|
InstantTrackerTrackedPlaneEventHandler |