C++ Java Unity
Unity Reference
TrackableBehaviour Class Referenceabstract

The base class for all TrackableBehaviours in Vuforia This class serves both as an augmentation definition for a Trackable in the editor as well as a tracked Trackable result at runtime More...

Inheritance diagram for TrackableBehaviour:
VuforiaMonoBehaviour AnchorBehaviour DataSetTrackableBehaviour CylinderTargetBehaviour ImageTargetBehaviour ModelTargetBehaviour MultiTargetBehaviour ObjectTargetBehaviour VuMarkBehaviour

Public Types

enum  Status {
  NO_POSE = 0,
  LIMITED = 1,
  DETECTED = 2,
  TRACKED = 3,
  EXTENDED_TRACKED = 4
}
 The tracking status of the TrackableBehaviour. More...
 
enum  StatusInfo {
  NORMAL = 0,
  UNKNOWN = 1,
  INITIALIZING = 2,
  RELOCALIZING = 3,
  EXCESSIVE_MOTION = 4,
  INSUFFICIENT_FEATURES = 5,
  INSUFFICIENT_LIGHT = 6,
  NO_DETECTION_RECOMMENDING_GUIDANCE = 7
}
 Information on the tracking status. Gives the primary reason about the problem with tracking (STATUS::NO_POSE or STATUS::LIMITED). More...
 

Public Member Functions

virtual void OnFrameIndexUpdate (int newFrameIndex)
 Is triggered by the StateManager after each render frame More...
 
virtual void OnTrackerUpdate (Status newStatus, StatusInfo newStatusInfo)
 Is triggered by the TrackerBehavior after it has updated. More...
 
void RegisterTrackableEventHandler (ITrackableEventHandler trackableEventHandler)
 This method registers a new Tracker event handler at the Tracker. These handlers are called as soon as ALL Trackables have been updated in this frame. More...
 
bool UnregisterTrackableEventHandler (ITrackableEventHandler trackableEventHandler)
 This method unregisters a Tracker event handler. Returns "false" if event handler does not exist. More...
 

Protected Member Functions

virtual bool CorrectScaleImpl ()
 Overwrite this method when a specific scale should be enforced. More...
 
bool EnforceUniformScaling ()
 Scales the Trackable uniformly More...
 
abstract void InternalUnregisterTrackable ()
 This method disconnects the TrackableBehaviour from it's associated trackable. Use it only if you know what you are doing - e.g. when you want to destroy a trackable, but reuse the TrackableBehaviour. More...
 
virtual bool SetScale (Vector3 size)
 Set scale-value of this game object based on one dimension. The largest dimension is used as scale value. More...
 
bool SetScaleFromHeight (float height, float aspectRatio)
 Set scale-value of this game object based on the target height. This method should be used only for 2D-targets More...
 
bool SetScaleFromWidth (float width, float aspectRatio)
 Set scale-value of this game object based on the target width. This method should be used only for 2D-targets More...
 

Protected Attributes

bool mInitializedInEditor = false
 
bool mPreserveChildSize = false
 
Vector3 mPreviousScale = Vector3.zero
 This value is used to identify non-uniform scaling of the trackable. More...
 
Status mStatus = Status.NO_POSE
 
StatusInfo mStatusInfo = StatusInfo.UNKNOWN
 
Trackable mTrackable
 
string mTrackableName = ""
 For dataset-trackables this value is retrieved from the dataset and it is used for detecting that the specified trackable in the dataset is not valid anymore. More...
 

Properties

Status CurrentStatus [get]
 The tracking status of the TrackableBehaviour More...
 
StatusInfo CurrentStatusInfo [get]
 Information on the tracking status. Gives the primary reason about the problem with tracking (STATUS::NO_POSE or STATUS::LIMITED). More...
 
virtual Trackable Trackable [get]
 The Trackable created at runtime that is augmented by this TrackableBehaviour More...
 
string TrackableName [get]
 The name of the Trackable. More...
 

Detailed Description

The base class for all TrackableBehaviours in Vuforia This class serves both as an augmentation definition for a Trackable in the editor as well as a tracked Trackable result at runtime

Member Enumeration Documentation

enum Status
strong

The tracking status of the TrackableBehaviour.

Enumerator
NO_POSE 

Pose for the trackable could not be delivered.

LIMITED 

The tracking is limited.

DETECTED 

The trackable was detected.

TRACKED 

The trackable was tracked.

EXTENDED_TRACKED 

The trackable was extended tracked.

enum StatusInfo
strong

Information on the tracking status. Gives the primary reason about the problem with tracking (STATUS::NO_POSE or STATUS::LIMITED).

Enumerator
NORMAL 

Status is normal

UNKNOWN 

Unknown reason for limited status.

INITIALIZING 

Not enough information yet for accurate tracking.

RELOCALIZING 

The tracking system is currently relocalizing.

EXCESSIVE_MOTION 

Moving too fast for accurate tracking.

INSUFFICIENT_FEATURES 

Not enough features for accurate tracking.

INSUFFICIENT_LIGHT 

Not enough light for accurate tracking.

NO_DETECTION_RECOMMENDING_GUIDANCE 

Could not snap the target

Member Function Documentation

virtual bool CorrectScaleImpl ( )
protectedvirtual

Overwrite this method when a specific scale should be enforced.

Reimplemented in ModelTargetBehaviour, ObjectTargetBehaviour, VuMarkBehaviour, CylinderTargetBehaviour, and ImageTargetBehaviour.

bool EnforceUniformScaling ( )
protected

Scales the Trackable uniformly

abstract void InternalUnregisterTrackable ( )
protectedpure virtual

This method disconnects the TrackableBehaviour from it's associated trackable. Use it only if you know what you are doing - e.g. when you want to destroy a trackable, but reuse the TrackableBehaviour.

Implemented in ModelTargetBehaviour, ObjectTargetBehaviour, VuMarkBehaviour, CylinderTargetBehaviour, ImageTargetBehaviour, AnchorBehaviour, and MultiTargetBehaviour.

virtual void OnFrameIndexUpdate ( int  newFrameIndex)
virtual

Is triggered by the StateManager after each render frame

Parameters
newFrameIndexFrame index of processed frame, multiple render frames can have the same frame index

Reimplemented in CylinderTargetBehaviour.

virtual void OnTrackerUpdate ( Status  newStatus,
StatusInfo  newStatusInfo 
)
virtual

Is triggered by the TrackerBehavior after it has updated.

void RegisterTrackableEventHandler ( ITrackableEventHandler  trackableEventHandler)

This method registers a new Tracker event handler at the Tracker. These handlers are called as soon as ALL Trackables have been updated in this frame.

virtual bool SetScale ( Vector3  size)
protectedvirtual

Set scale-value of this game object based on one dimension. The largest dimension is used as scale value.

Parameters
sizeSize ofo 3d object
Returns
returns whether changing size was successful

Reimplemented in ModelTargetBehaviour.

bool SetScaleFromHeight ( float  height,
float  aspectRatio 
)
protected

Set scale-value of this game object based on the target height. This method should be used only for 2D-targets

Parameters
heighttarget height
aspectRatioaspect ratio of target (height/width)
Returns
returns whether changing size was successful
bool SetScaleFromWidth ( float  width,
float  aspectRatio 
)
protected

Set scale-value of this game object based on the target width. This method should be used only for 2D-targets

Parameters
widthtarget width
aspectRatioaspect ratio of target (height/width)
Returns
uniform scale value of game object
bool UnregisterTrackableEventHandler ( ITrackableEventHandler  trackableEventHandler)

This method unregisters a Tracker event handler. Returns "false" if event handler does not exist.

Member Data Documentation

bool mInitializedInEditor = false
protected
bool mPreserveChildSize = false
protected
Vector3 mPreviousScale = Vector3.zero
protected

This value is used to identify non-uniform scaling of the trackable.

Status mStatus = Status.NO_POSE
protected
StatusInfo mStatusInfo = StatusInfo.UNKNOWN
protected
Trackable mTrackable
protected
string mTrackableName = ""
protected

For dataset-trackables this value is retrieved from the dataset and it is used for detecting that the specified trackable in the dataset is not valid anymore.

Property Documentation

Status CurrentStatus
get

The tracking status of the TrackableBehaviour

StatusInfo CurrentStatusInfo
get

Information on the tracking status. Gives the primary reason about the problem with tracking (STATUS::NO_POSE or STATUS::LIMITED).

virtual Trackable Trackable
get

The Trackable created at runtime that is augmented by this TrackableBehaviour

string TrackableName
get

The name of the Trackable.