public interface InstantTracker
Modifier and Type | Interface and Description |
---|---|
static interface |
InstantTracker.PointCloudCallback
Interface to receive instant tracking point cloud data as
Vector3 <Float>[] . |
static interface |
InstantTracker.PointCloudNativeCallback
Interface to receive instant tracking point cloud data as pointer to a native float array.
|
static interface |
InstantTracker.ScenePickingCallback
Interface to receive picking results from the InstantTracker class
|
Modifier and Type | Method and Description |
---|---|
boolean |
canStartTracking()
Queries whether the state can be changed from initialization to tracking.
|
void |
convertScreenCoordinateToPointCloudCoordinate(Vector2<Float> screenCoordinate,
InstantTracker.ScenePickingCallback callback)
Queries the point cloud for a 3D position using the provided 2D screen position.
The callback will be invoked synchronously on the call thread. |
void |
convertScreenCoordinateToPointCloudCoordinate(Vector2<Float> screenCoordinate,
InstantTracker.ScenePickingCallback callback,
android.os.Handler handler)
Queries the point cloud for a 3D position using the provided 2D screen position.
The method returns immediately and informs about the result asynchronously using the specified callback and handler. Note: This method is not designed to be called repeatedly, calling it repeatedly(e.g. |
void |
loadExistingInstantTarget(TargetCollectionResource targetCollectionResource,
CompletionCallback completion,
ErrorCallback error,
InstantTargetRestorationConfiguration configuration)
Loads the provided instant target and starts tracking it.
This feature is not available with platform assisted tracking enabled. e.g.: |
void |
loadExistingInstantTarget(TargetCollectionResource targetCollectionResource,
CompletionCallback completion,
ErrorCallback error,
InstantTargetRestorationConfiguration configuration,
android.os.Handler handler)
Loads the provided instant target and starts tracking it.
This feature is not available with platform assisted tracking enabled. e.g.: |
void |
requestCurrentPointCloud(InstantTracker.PointCloudCallback callback)
Queries the current 3D point cloud as
Vector3 <Float>[] . |
void |
requestCurrentPointCloud(InstantTracker.PointCloudCallback callback,
android.os.Handler handler)
Queries the current 3D point cloud as
Vector3 <Float>[] . |
void |
requestCurrentPointCloudNativePointer(InstantTracker.PointCloudNativeCallback callback)
Queries the current 3D point cloud as pointer to a native float array.
|
void |
requestCurrentPointCloudNativePointer(InstantTracker.PointCloudNativeCallback callback,
android.os.Handler handler)
Queries the current 3D point cloud as pointer to a native float array.
|
void |
saveCurrentInstantTarget(String url,
CompletionCallback completion,
ErrorCallback error)
Saves the current scene created by the InstantTracker.
The saved file can then be loaded as TargetCollectionResource using loadExistingInstantTarget(com.wikitude.tracker.TargetCollectionResource, com.wikitude.common.CompletionCallback, com.wikitude.common.ErrorCallback, com.wikitude.tracker.InstantTargetRestorationConfiguration) .This enables that AR experiences can be persistently accessed by multiple users across devices and operating systems. This feature is not available with platform assisted tracking enabled. |
void |
saveCurrentInstantTarget(String url,
CompletionCallback completion,
ErrorCallback error,
android.os.Handler handler)
Saves the current scene created by the InstantTracker.
The saved file can then be loaded as TargetCollectionResource using loadExistingInstantTarget(com.wikitude.tracker.TargetCollectionResource, com.wikitude.common.CompletionCallback, com.wikitude.common.ErrorCallback, com.wikitude.tracker.InstantTargetRestorationConfiguration) .This enables that AR experiences can be persistently accessed by multiple users across devices and operating systems. This feature is not available with platform assisted tracking enabled. |
void |
setDeviceHeightAboveGround(float height)
Sets the current height at which the device is being held above the ground or
other desired tracking surface (e.g.
|
void |
setState(InstantTrackingState state)
Changes the state in which the tracker should run in
|
void |
setTrackingPlaneOrientation(float orientation)
Sets the current orientation at which the instant tracking plane should be displayed.
This can be used to align the instant tracking plane with real world structures (e.g. |
void setState(InstantTrackingState state)
state
- The new state in which the tracker should run in.void setDeviceHeightAboveGround(float height)
InstantTrackingState.Initializing
height
- The current height at which the device is being held.void setTrackingPlaneOrientation(float orientation)
InstantTrackingState.Initializing
orientation
- The Angle in degree.void convertScreenCoordinateToPointCloudCoordinate(Vector2<Float> screenCoordinate, InstantTracker.ScenePickingCallback callback)
convertScreenCoordinateToPointCloudCoordinate(Vector2, ScenePickingCallback, Handler)
for asynchronous querying.InstantTrackerListener.onTracked(com.wikitude.tracker.InstantTracker, com.wikitude.tracker.InstantTarget)
)
may affect the performance of the Instant Tracking.screenCoordinate
- The input screen coordinate in pixels. This value may not be null.callback
- The callback which is invoked once the process is finished. This value may not be null.IllegalArgumentException
- if screenCoordinate or the callback was null.void convertScreenCoordinateToPointCloudCoordinate(Vector2<Float> screenCoordinate, InstantTracker.ScenePickingCallback callback, android.os.Handler handler)
InstantTrackerListener.onTracked(com.wikitude.tracker.InstantTracker, com.wikitude.tracker.InstantTarget)
)
may affect the performance of the Instant Tracking.screenCoordinate
- The input screen coordinate in pixels. This value may not be null.callback
- The callback which is invoked once the process is finished. This value may not be null.handler
- The handler on which the callback should be invoked, or null to use the current thread's looper.IllegalArgumentException
- if screenCoordinate or the callback was null.void requestCurrentPointCloud(InstantTracker.PointCloudCallback callback)
Vector3
<Float>[]
. requestCurrentPointCloud(PointCloudCallback, Handler)
for asynchronous querying.InstantTrackerListener.onTracked(com.wikitude.tracker.InstantTracker, com.wikitude.tracker.InstantTarget)
)
may affect the performance of the Instant Tracking.callback
- The callback which is invoked once the process is finished. This value may not be null.IllegalArgumentException
- if the callback was null.void requestCurrentPointCloud(InstantTracker.PointCloudCallback callback, android.os.Handler handler)
Vector3
<Float>[]
. InstantTrackerListener.onTracked(com.wikitude.tracker.InstantTracker, com.wikitude.tracker.InstantTarget)
)
may affect the performance of the Instant Tracking.callback
- The callback which is invoked once the process is finished. This value may not be null.handler
- The callback which is invoked once the process is finished. This value may not be null.IllegalArgumentException
- if the callback was null.void requestCurrentPointCloudNativePointer(InstantTracker.PointCloudNativeCallback callback)
requestCurrentPointCloudNativePointer(PointCloudNativeCallback, Handler)
for asynchronous querying.InstantTrackerListener.onTracked(com.wikitude.tracker.InstantTracker, com.wikitude.tracker.InstantTarget)
)
may affect the performance of the Instant Tracking.callback
- The callback which is invoked once the process is finished. This value may not be null.void requestCurrentPointCloudNativePointer(InstantTracker.PointCloudNativeCallback callback, android.os.Handler handler)
InstantTrackerListener.onTracked(com.wikitude.tracker.InstantTracker, com.wikitude.tracker.InstantTarget)
)
may affect the performance of the Instant Tracking.callback
- The callback which is invoked once the process is finished. This value may not be null.handler
- The callback which is invoked once the process is finished. This value may not be null.boolean canStartTracking()
void saveCurrentInstantTarget(String url, CompletionCallback completion, ErrorCallback error)
TargetCollectionResource
using loadExistingInstantTarget(com.wikitude.tracker.TargetCollectionResource, com.wikitude.common.CompletionCallback, com.wikitude.common.ErrorCallback, com.wikitude.tracker.InstantTargetRestorationConfiguration)
.saveCurrentInstantTarget(String, CompletionCallback, ErrorCallback, Handler)
.
String savedTargetPath = new File(getExternalFilesDir(null), "savedTarget.wto").getAbsolutePath();
instantTracker.saveCurrentInstantTarget(savedTargetPath, () -> {}, (error) -> {});
...
TargetCollectionResource resource = wikitudeSDK.getTrackerManager().createTargetCollectionResource(savedTargetPath);
instantTracker.loadExistingInstantTarget(resource, () -> {}, (error) -> {}, new InstantTargetRestorationConfiguration());
url
- the path where the target should be saved to. The folder has to exist and potential required permissions have to be granted.completion
- will be triggered when saving the target is done.error
- will be triggered when there was an issue when trying to save the target.CompletionCallback
,
ErrorCallback
,
saveCurrentInstantTarget(String, CompletionCallback, ErrorCallback, Handler)
,
loadExistingInstantTarget(com.wikitude.tracker.TargetCollectionResource, com.wikitude.common.CompletionCallback, com.wikitude.common.ErrorCallback, com.wikitude.tracker.InstantTargetRestorationConfiguration)
void saveCurrentInstantTarget(String url, CompletionCallback completion, ErrorCallback error, android.os.Handler handler)
TargetCollectionResource
using loadExistingInstantTarget(com.wikitude.tracker.TargetCollectionResource, com.wikitude.common.CompletionCallback, com.wikitude.common.ErrorCallback, com.wikitude.tracker.InstantTargetRestorationConfiguration)
.
String savedTargetPath = new File(getExternalFilesDir(null), "savedTarget.wto").getAbsolutePath();
instantTracker.saveCurrentInstantTarget(savedTargetPath, () -> {}, (error) -> {});
...
TargetCollectionResource resource = wikitudeSDK.getTrackerManager().createTargetCollectionResource(savedTargetPath);
instantTracker.loadExistingInstantTarget(resource, () -> {}, (error) -> {}, new InstantTargetRestorationConfiguration());
url
- the path where the target should be saved to. The folder has to exist and potential required permissions have to be granted.completion
- will be triggered when saving the target is done.error
- will be triggered when there was an issue when trying to save the target.handler
- the handler used to deliver the callbacks to a specified thread.CompletionCallback
,
ErrorCallback
,
loadExistingInstantTarget(com.wikitude.tracker.TargetCollectionResource, com.wikitude.common.CompletionCallback, com.wikitude.common.ErrorCallback, com.wikitude.tracker.InstantTargetRestorationConfiguration)
void loadExistingInstantTarget(TargetCollectionResource targetCollectionResource, CompletionCallback completion, ErrorCallback error, InstantTargetRestorationConfiguration configuration)
String savedTargetPath = new File(getExternalFilesDir(null), "savedTarget.wto").getAbsolutePath();
instantTracker.saveCurrentInstantTarget(savedTargetPath, () -> {}, (error) -> {});
...
TargetCollectionResource resource = wikitudeSDK.getTrackerManager().createTargetCollectionResource(savedTargetPath);
instantTracker.loadExistingInstantTarget(resource, () -> {}, (error) -> {}, new InstantTargetRestorationConfiguration());
targetCollectionResource
- the file saved by saveCurrentInstantTarget(java.lang.String, com.wikitude.common.CompletionCallback, com.wikitude.common.ErrorCallback)
as TargetCollectionResource
.completion
- will be triggered when saving the target is done.error
- will be triggered when there was an issue when trying to save the target.configuration
- the configuration applied to the loaded instant target.
The callbacks will be invoked on an internal thread. To specify the Thread that should receive the callback use
loadExistingInstantTarget(TargetCollectionResource, CompletionCallback, ErrorCallback, InstantTargetRestorationConfiguration, Handler)
.CompletionCallback
,
ErrorCallback
,
InstantTargetRestorationConfiguration
,
saveCurrentInstantTarget(java.lang.String, com.wikitude.common.CompletionCallback, com.wikitude.common.ErrorCallback)
,
loadExistingInstantTarget(TargetCollectionResource, CompletionCallback, ErrorCallback, InstantTargetRestorationConfiguration, Handler)
void loadExistingInstantTarget(TargetCollectionResource targetCollectionResource, CompletionCallback completion, ErrorCallback error, InstantTargetRestorationConfiguration configuration, android.os.Handler handler)
String savedTargetPath = new File(getExternalFilesDir(null), "savedTarget.wto").getAbsolutePath();
instantTracker.saveCurrentInstantTarget(savedTargetPath, () -> {}, (error) -> {});
...
TargetCollectionResource resource = wikitudeSDK.getTrackerManager().createTargetCollectionResource(savedTargetPath);
instantTracker.loadExistingInstantTarget(resource, () -> {}, (error) -> {}, new InstantTargetRestorationConfiguration());
targetCollectionResource
- the file saved by saveCurrentInstantTarget(java.lang.String, com.wikitude.common.CompletionCallback, com.wikitude.common.ErrorCallback)
as TargetCollectionResource
.completion
- will be triggered when saving the target is done.error
- will be triggered when there was an issue when trying to save the target.configuration
- the configuration applied to the loaded instant target.CompletionCallback
,
ErrorCallback
,
InstantTargetRestorationConfiguration
,
saveCurrentInstantTarget(java.lang.String, com.wikitude.common.CompletionCallback, com.wikitude.common.ErrorCallback)