![]() |
KudanAR - Unity
1.6.0
|
Inherits Kudan.AR.TrackerBase.
Public Member Functions | |
Tracker (Renderer background) | |
Constructor for the Tracker class. On mobile devices, it needs a reference to the background in order to render to the target texture and display the camera feed. More... | |
override bool | InitPlugin () |
Initialise the plugin. More... | |
override void | DeinitPlugin () |
Deinitialise the plugin. More... | |
override float | GetNativePluginVersion () |
Get the native plugin version number. This is the version number of the native framework used for the current platform, not the version of the plugin itself. More... | |
override void | SetApiKey (string key, string bundleId) |
Sets the API key to be checked by licensing later. More... | |
override int | GetNumCameras () |
Gets the total number of cameras connected to the device, including any built-in and any external webcams. More... | |
override bool | StartInputFromImage (Texture2D image) |
Start input from a static image. This is useful for debugging purposes. More... | |
override bool | StartInputFromCamera (int deviceIndex, int targetWidth, int targetHeight) |
Start input from a given camera device. More... | |
override void | StopInput () |
Stop all input. If tracking is running, this will also stop tracking. To restart input, StartInputFromCamera will need to be used again, followed by StartTracking. More... | |
override bool | AddTrackable (byte[] data, string id, bool extensible) |
Adds a single trackable to the tracker from image data, names it with the given string, and applies any settings. More... | |
override bool | AddTrackableSet (byte[] data, string id) |
Adds a .KARMarker data set to the tracker with a given name. More... | |
override void | UpdateTracking () |
Update tracking for the current platform. More... | |
override void | StartTracking () |
Start the tracker. If tracker is already running, a warning message will be logged instead. More... | |
override void | StopTracking () |
Stop the tracker. If tracking is already stopped, a warning message will be logged instead. More... | |
override bool | EnableTrackingMethod (int trackingMethodId) |
Enable the given tracking method. More... | |
override bool | DisableTrackingMethod (int trackingMethodId) |
Disable the given tracking method. More... | |
override bool | GetMarkerRecoveryStatus () |
Returns whether or not Marker Recovery is enabled on the tracker. More... | |
override void | SetMarkerRecoveryStatus (bool status) |
Sets the marker recovery status. Enabling this feature allows for quicker re-detection if a marker is lost as well as making it easier to re-detect the marker from shallower angles and greater distances. This is a feature that we recommend everyone should generally enable. N.B. Enabling this feature will use a fraction more CPU power. More... | |
override void | SetMarkerExtensibilityStatus (bool status) |
Sets the marker extensibility status. Enabling this feature allows the tracker to extend markers by using the space surrounding the marker. This allows for detection and tracking at much greater distances, though this should only be used with markers that are stationary. More... | |
override bool | GetMarkerExtensibilityStatus () |
Returns whether or not Extended Detection and Tracking is enabled on the tracker. More... | |
override void | SetMaximumSimultaneousTracking (int maxToTrack) |
Set the maximum number of trackables which can be tracked at the same time. More... | |
override void | OnApplicationFocus (bool focusStatus) |
OnApplicationFocus is called when the application gains or loses focus. When the user goes back to the home screen or to another app, focus is lost, and this method is called with the argument set to false. When the user re-opens the app and focus is gained, this method is called with the argument set to true. More... | |
override void | OnApplicationPause (bool pauseStatus) |
Method called when the app loses focus. Only needed on Android. More... | |
override void | ArbiTrackStart (Vector3 position, Quaternion orientation) |
Start ArbiTrack on the current platform. More... | |
override void | ArbiTrackStop () |
Stop ArbiTrack and return to placement mode. More... | |
override bool | ArbiTrackIsTracking () |
Checks if arbitrary tracking is currently running. More... | |
override void | ArbiTrackGetPose (out Vector3 position, out Quaternion orientation) |
Gets the current position and orientation of the markerless driver being tracked. More... | |
override void | FloorPlaceGetPose (out Vector3 position, out Quaternion orientation) |
Gets the current position and orientation of the floor, relative to the device. More... | |
override void | NativeRender () |
override void | PostRender () |
Method called just after the current frame has been drawn. Used only on the Android platform. More... | |
override void | updateCam () |
Update the camera being used by the editor plugin. For the native equivalent, see UpdateBackground for iOS, or updateAndroidTracking for Android. More... | |
void | UpdateRotation () |
Update the projection matrix depending on the orientation of the device. This accounts for Unity's own auto-rotation to keep everything the right way up. Only used on mobile. More... | |
![]() | |
string | GetPluginVersion () |
Gets the current plugin version. More... | |
int | GetNumTrackables () |
Gets the number of trackables. More... | |
Trackable | GetTrackable (int index) |
Gets a trackable at given index. More... | |
bool | IsTrackingRunning () |
Determines whether tracking is running. More... | |
void | RemoveTrackable (string name) |
Removes a trackable with a given name. More... | |
void | ClearTrackables () |
Clears trackables. More... | |
void | SetupRenderingCamera (float cameraNearPlane, float cameraFarPlane) |
Sets up the rendering camera. More... | |
bool | AddTrackableSet (string path, string id) |
Adds the trackable from a given path with a given ID. More... | |
Texture | GetTrackingTexture () |
Gets the tracking texture. More... | |
int | GetNumDetectedTrackables () |
Gets the number of detected trackables. More... | |
Trackable | GetDetectedTrackable (int index) |
Gets detected trackable at the given index. More... | |
Matrix4x4 | GetProjectionMatrix () |
Gets the projection matrix. More... | |
Trackable[] | GetDetectedTrackablesAsArray () |
Gets the detected trackables as array. More... | |
void | SetArbiTrackFloorHeight (float floorHeight) |
Static Public Member Functions | |
static Matrix4x4 | ConvertNativeFloatsToMatrix (float[] r, float cameraAspect) |
Convert floats to a 4x4 Matrix. More... | |
Static Protected Member Functions | |
static Vector3 | ConvertNativeFloatsToVector3 (float x, float y, float z) |
Convert floats to a 3-Dimensional Vector. More... | |
static Quaternion | ConvertNativeFloatsToQuaternion (float x, float y, float z, float w) |
Convert floats to a Quaternion. More... | |
Additional Inherited Members | |
![]() | |
List< Trackable > | _trackables = new List<Trackable>() |
List of trackables the user has loaded. More... | |
float | _cameraNearPlane = 0.3f |
The default camera near plane value. More... | |
float | _cameraFarPlane = 1000f |
The default camera far plane value. More... | |
float | _floorHeight = 200.0f |
ArbiTracker default floor height. More... | |
System.Threading.Thread | _trackingThread |
The tracking thread. More... | |
bool | _isTrackingRunning |
Is tracking currently running? More... | |
Texture | _finalTexture |
The texture used to render to the camera. More... | |
Matrix4x4 | _projectionMatrix |
The projection matrix. More... | |
List< Trackable > | _detected = new List<Trackable>() |
List of detected trackables. More... | |
float | _cameraRate |
The camera rate, number of times the camera feed refreshes each second. More... | |
float | _trackerRate |
The tracker rate, the number of times the tracker updates each second. More... | |
float | _appRate |
The app rate, the number of times the app updates each second. More... | |
Texture | _clonedTexture |
The cloned texture. More... | |
![]() | |
float | CameraFrameRate [get] |
Gets the camera frame rate. More... | |
float | TrackerFrameRate [get] |
Gets the tracker frame rate. More... | |
float | AppFrameRate [get] |
Gets the app frame rate. More... | |
|
inline |
Constructor for the Tracker class. On mobile devices, it needs a reference to the background in order to render to the target texture and display the camera feed.
background | The Renderer component attached to the background GameObject. |
|
inlinevirtual |
Adds a single trackable to the tracker from image data, names it with the given string, and applies any settings.
true
, if trackable was successfully added to the tracker, false
otherwise.data | The array of image data. |
id | A name applied to the trackable to identify it in the tracker while the app is running. |
extensible | If set to true the loaded trackable will use extended tracking. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Adds a .KARMarker data set to the tracker with a given name.
true<c>/c>, if the data set was successfully added to the tracker, false
otherwise.
data | The array of byte data from the data set. |
id | A string used to identify the data set while the app is running. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Gets the current position and orientation of the markerless driver being tracked.
position | The position of the markerless transform driver. |
orientation | The orientation of the markerless transform driver. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Checks if arbitrary tracking is currently running.
true<c>/c>, if ArbiTrack is running false
if not.
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Start ArbiTrack on the current platform.
position | Position to start tracking at. |
orientation | Orientation to start tracking at. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Stop ArbiTrack and return to placement mode.
Implements Kudan.AR.TrackerBase.
|
inlinestatic |
Convert floats to a 4x4 Matrix.
r | An array of 16 native floats. |
cameraAspect | The aspect ratio of the camera. |
|
inlinestaticprotected |
Convert floats to a Quaternion.
x | The x coefficient. |
y | The y coefficient. |
z | The z coefficient. |
w | The w coefficient. |
|
inlinestaticprotected |
Convert floats to a 3-Dimensional Vector.
x | The x coordinate. |
y | The y coordinate. |
z | The z coordinate. |
|
inlinevirtual |
Deinitialise the plugin.
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Disable the given tracking method.
true<c>/c>, if the tracking method was disabled successfully, false
otherwise.
trackingMethodId | ID of the tracking method to disable. Tracking methods are: 0 = Marker, 1 = Markerless. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Enable the given tracking method.
true<c>/c>, if the tracking method was enabled successfully, false
otherwise.
trackingMethodId | ID of the tracking method to enable. Tracking methods are: 0 = Marker, 1 = Markerless. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Gets the current position and orientation of the floor, relative to the device.
position | Position of the floor, relative to the camera. |
orientation | Orientation of the floor, relative to the camera. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Returns whether or not Extended Detection and Tracking is enabled on the tracker.
true
, if marker extensibility status was gotten, false
otherwise.Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Returns whether or not Marker Recovery is enabled on the tracker.
true<c>/c>, if Marker Recovery is enabled. false
if not.
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Get the native plugin version number. This is the version number of the native framework used for the current platform, not the version of the plugin itself.
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Gets the total number of cameras connected to the device, including any built-in and any external webcams.
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Initialise the plugin.
true
, if the plugin initialised successfully, false
otherwise.Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
OnApplicationFocus is called when the application gains or loses focus. When the user goes back to the home screen or to another app, focus is lost, and this method is called with the argument set to false. When the user re-opens the app and focus is gained, this method is called with the argument set to true.
NOTE: On Android, when the on-screen keyboard is enabled, it causes a OnApplicationFocus( false ) event. Additionally, if you press Home at the moment the keyboard is enabled, the OnApplicationFocus() event is not called, but OnApplicationPause() is called instead.
focusStatus | True if the app has gained focus, false if it has lost focus. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Method called when the app loses focus. Only needed on Android.
pauseStatus | True if GameObjects have focus, False otherwise. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Method called just after the current frame has been drawn. Used only on the Android platform.
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Sets the API key to be checked by licensing later.
key | The full API Key, including hypens. The string must be an exact match to what is provided by Kudan. |
bundleId | The Bundle ID of your project. This is ignored. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Sets the marker extensibility status. Enabling this feature allows the tracker to extend markers by using the space surrounding the marker. This allows for detection and tracking at much greater distances, though this should only be used with markers that are stationary.
status | Set to true if Extended Detection and Tracking should be enabled, false if not. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Sets the marker recovery status. Enabling this feature allows for quicker re-detection if a marker is lost as well as making it easier to re-detect the marker from shallower angles and greater distances. This is a feature that we recommend everyone should generally enable. N.B. Enabling this feature will use a fraction more CPU power.
status | Set to true if Marker Recovery should be enabled, false if not. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Set the maximum number of trackables which can be tracked at the same time.
maxToTrack |
The maximum number of trackables which can be simultaneously tracked
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Start input from a given camera device.
true
, if input was successfully started from a camera device, false
otherwise.deviceIndex | The index of the camera to get input from. Back-facing devices always come first in the list. On a smart device with a back-facing and front-facing camera, the back-facing camera will have index 0, and the front-facing camera will have index 1. On a desktop device, the index corresponds to the connected USB webcams, if there are any. |
targetWidth | Width component of the target resolution, in pixels. |
targetHeight | Height component of the target resolution, in pixels. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Start input from a static image. This is useful for debugging purposes.
true
, if input was successfully started from the image, false
otherwise.image | The image that will be put into the tracker. If it contains a marker, the marker will be detected. |
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Start the tracker. If tracker is already running, a warning message will be logged instead.
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Stop all input. If tracking is running, this will also stop tracking. To restart input, StartInputFromCamera will need to be used again, followed by StartTracking.
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Stop the tracker. If tracking is already stopped, a warning message will be logged instead.
Implements Kudan.AR.TrackerBase.
|
inlinevirtual |
Update the camera being used by the editor plugin. For the native equivalent, see UpdateBackground for iOS, or updateAndroidTracking for Android.
Reimplemented from Kudan.AR.TrackerBase.
|
inline |
Update the projection matrix depending on the orientation of the device. This accounts for Unity's own auto-rotation to keep everything the right way up. Only used on mobile.
|
inlinevirtual |
Update tracking for the current platform.
Implements Kudan.AR.TrackerBase.