C++ Java Unity
Java Reference
ModelTarget Class Reference

Detailed Description

A type of ObjectTarget that recognizes and tracks objects by shape using existing 3D models.

A Model Target tracks a real world object by its shape, based on a 3D model of the object.

In order to initialize tracking of a Model Target, the user is required to position their device so that the object to be tracked appears in the camera at a particular position and orientation. This initialization pose is called a Guide View. To assist in this process, your application will typically render an overlay in the camera image representing the position and orientation of the object for the active Guide View. (Usually you will do this by rendering the image returned by GuideView::getImage()).

A Model Target dataset may contain multiple objects and/or multiple Guide Views.

  • If you have a Model Target dataset containing a single object with multiple Guide Views, you can switch between the Guide Views using setActiveGuideViewIndex().
  • If you have an Advanced Model Target dataset with multiple objects and/or multiple Guide Views, the activated Guide View changes automatically when recognized.
  • If you have an Advanced 360 Model Target dataset, no Guide View access is necessary.

Note: It is not possible to modify a ModelTarget while its DataSet is active. See the DataSet class for more information.

Inheritance diagram for ModelTarget:
ObjectTarget Trackable

Public Member Functions

boolean equals (Object obj)
 
Obb3D getBoundingBox ()
 Get the bounding box of this target. More...
 
GuideViewList getGuideViews ()
 Returns a list of guide views (write access). More...
 
boolean setActiveGuideViewIndex (int idx)
 Set the index of the Guide View you want to be active. More...
 
int getActiveGuideViewIndex ()
 Get the index of the currently active GuideView. More...
 
- Public Member Functions inherited from ObjectTarget
boolean equals (Object obj)
 
String getUniqueTargetId ()
 Get the persistent system-wide unique id for this target. More...
 
Vec3F getSize ()
 Get the size of this target. More...
 
boolean setSize (Vec3F size)
 Apply a uniform scale to this target that makes it the given size. More...
 
boolean setMotionHint (int hint)
 Set the motion hint to indicate how the target moves in space. More...
 
int getMotionHint ()
 Get the motion hint of this target. More...
 
- Public Member Functions inherited from Trackable
Object getUserData ()
 
boolean setUserData (Object userData)
 
boolean equals (Object obj)
 
Type getType ()
 Get the Type for this instance (typically a subclass of Trackable). More...
 
boolean isOfType (Type type)
 Check whether this instance is of the given Type or any of its subclasses. More...
 
int getId ()
 Get a unique id for this Trackable. More...
 
String getName ()
 Get the name of this Trackable's name. More...
 

Static Public Member Functions

static Type getClassType ()
 Return the Type for class "ModelTarget". More...
 
- Static Public Member Functions inherited from ObjectTarget
static Type getClassType ()
 Get the Type for class "ObjectTarget". More...
 
- Static Public Member Functions inherited from Trackable
static Type getClassType ()
 Get the Type of class 'Trackable'. More...
 

Member Function Documentation

boolean equals ( Object  obj)
static Type getClassType ( )
static

Return the Type for class "ModelTarget".

Obb3D getBoundingBox ( )

Get the bounding box of this target.

Note: A call to setSize() will change the bounding box. If you have cached the result of getBoundingBox(), you will need to call it again to obtain an updated bounding box after every call to setSize().

Returns
An axis-aligned box that completely encloses the 3D geometry that this ModelTarget represents, including any scaling applied via setSize().
GuideViewList getGuideViews ( )

Returns a list of guide views (write access).

Return a list of the GuideViews defined for this Model Target.

boolean setActiveGuideViewIndex ( int  idx)

Set the index of the Guide View you want to be active.

Note: It is possible to use this function even when the dataset is deactivated.

Note: The default active GuideView is the first one in the dataset, i.e. the one with index 0.

Note: If you are using an Advanced Model Target dataset containing either multiple Model Targets and/or multiple Guide Views, the active Guide View index is set automatically when a Model Target/Guide View is recognized.

Note: If you are using an Advanced 360 Model Target, setting an active Guide View is not necessary.

Parameters
idxThe index of the GuideView to set as active, in the range 0..(getGuideViews().size()-1) .
Returns
true on success, false on failure (check application logs for failure details).
int getActiveGuideViewIndex ( )

Get the index of the currently active GuideView.

Note: The default active GuideView is the first one in the dataset, i.e. the one with index 0 for Model Targets. Advanced Model Targets will not have an active Guide View set until one is recognized.

Returns
The index of the active GuideView in the range 0..(getGuideViews().size()-1), or -1 in case no Guide View is active.