C++ Java Unity
Unity Reference
ModelTargetBehaviour Class Reference

This class serves both as an augmentation definition for a ModelTarget in the editor as well as a tracked ModelTarget result at runtime More...

Inheritance diagram for ModelTargetBehaviour:
DataSetTrackableBehaviour TrackableBehaviour WorldCenterTrackableBehaviour VuforiaMonoBehaviour

Public Types

enum  GuideViewDisplayMode {
  NoGuideView,
  GuideView2D,
  GuideView3D
}
 The different modes how Vuforia will provide guide view rendering: More...
 
- Public Types inherited from TrackableBehaviour
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

Vector3 GetSize ()
 Returns the size of this target in scene units More...
 
void SetBoundingBox (Vector3 minBBox, Vector3 maxBBox)
 Set the Bounding Box (only in editor mode). More...
 
void SetHeight (float height)
 Set the height (z-dimension) of the target in scene units. This will scale the target uniformly. More...
 
void SetLength (float length)
 Set the length (x-dimension) of the target in scene units. This will scale the target uniformly. More...
 
void SetWidth (float width)
 Set the width (y-dimension) of the target in scene units. This will scale the target uniformly. More...
 
- Public Member Functions inherited from TrackableBehaviour
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...
 

Public Attributes

Texture2D m2DGuideViewImage = null
 
Material m2DGuideViewMaterial
 
Material m3DGuideViewMaterial
 
GameObject m3DGuideViewModel = null
 

Protected Member Functions

override void Awake ()
 
override bool CorrectScaleImpl ()
 Scales the Trackable uniformly More...
 
override 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...
 
override bool SetScale (Vector3 scale)
 Sets the local scale factor of the ModelTarget as a uniform multiplicator of the original model size More...
 
- Protected Member Functions inherited from TrackableBehaviour
bool EnforceUniformScaling ()
 Scales the Trackable uniformly 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...
 

Properties

GuideViewDisplayMode GuideViewMode [get, set]
 
ModelTarget ModelTarget [get]
 The ModelTarget that this ModelTargetBehaviour augments More...
 
- Properties inherited from TrackableBehaviour
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...
 
- Properties inherited from WorldCenterTrackableBehaviour
Trackable Trackable [get]
 The Trackable created at runtime that is augmented by this TrackableBehaviour More...
 

Additional Inherited Members

- Protected Attributes inherited from DataSetTrackableBehaviour
string mDataSetPath = ""
 
- Protected Attributes inherited from TrackableBehaviour
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...
 

Detailed Description

This class serves both as an augmentation definition for a ModelTarget in the editor as well as a tracked ModelTarget result at runtime

Member Enumeration Documentation

enum GuideViewDisplayMode
strong

The different modes how Vuforia will provide guide view rendering:

  • No guide view rendering (in case there is custom application logic to display some form of snapping view)
  • 2D guide view using the integrated or overwritten texture
  • 3D guide view using the integrated or overwritten 3D model
Enumerator
NoGuideView 

Using camel-case for enum here, so that Unity automatically creates nice strings for in editor display e.g. "NoGuideView" becomes "No Guide View"

GuideView2D 
GuideView3D 

Member Function Documentation

override void Awake ( )
protectedvirtual

Reimplemented from DataSetTrackableBehaviour.

override bool CorrectScaleImpl ( )
protectedvirtual

Scales the Trackable uniformly

Reimplemented from TrackableBehaviour.

Vector3 GetSize ( )

Returns the size of this target in scene units

override void InternalUnregisterTrackable ( )
protectedvirtual

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.

Implements TrackableBehaviour.

void SetBoundingBox ( Vector3  minBBox,
Vector3  maxBBox 
)

Set the Bounding Box (only in editor mode).

Parameters
minBBoxbounding box min position
maxBBoxbounding box max position
void SetHeight ( float  height)

Set the height (z-dimension) of the target in scene units. This will scale the target uniformly.

Parameters
heightheight value
void SetLength ( float  length)

Set the length (x-dimension) of the target in scene units. This will scale the target uniformly.

Parameters
lengthlength value
override bool SetScale ( Vector3  scale)
protectedvirtual

Sets the local scale factor of the ModelTarget as a uniform multiplicator of the original model size

Parameters
scaleThe uniform scale of the 3d object with respect to its original size
Returns
returns whether changing size was successful

Reimplemented from TrackableBehaviour.

void SetWidth ( float  width)

Set the width (y-dimension) of the target in scene units. This will scale the target uniformly.

Parameters
widthwidth value

Member Data Documentation

Texture2D m2DGuideViewImage = null
Material m2DGuideViewMaterial
Material m3DGuideViewMaterial
GameObject m3DGuideViewModel = null

Property Documentation

GuideViewDisplayMode GuideViewMode
getset