C++ Java Unity
Java Reference
ObjectTarget Class Reference

Detailed Description

A type of Trackable that represents a real-world object.

Inheritance diagram for ObjectTarget:
Trackable CylinderTarget ImageTarget ModelTarget MultiTarget VuMarkTarget VuMarkTemplate

Classes

class  MOTION_HINT
 Target property that indicates how the target moves in space. More...
 

Public Member Functions

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 ()
 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

Get the Type for class "ObjectTarget".

String getUniqueTargetId ( )

Get the persistent system-wide unique id for this target.

A target's unique id, which may be generated offline, identifies an ObjectTarget across multiple Vuforia sessions. It is a property of Vuforia's model of the object being tracked, and typically resides on permanent storage as part of loadable DataSet.

Note: Be careful not to confuse getUniqueTargetId() (which is persistent across Vuforia sessions) with Trackable::getId() (which is generated at runtime and not persistent).

Vec3F getSize ( )

Get the size of this target.

Returns
The size of this target, in meters (width, height, depth).
boolean setSize ( Vec3F  size)

Apply a uniform scale to this target that makes it the given size.

The requested size must represent a uniform scaling of the original target's size (within a small margin of error.)

If you try to set a size that is not the result of a uniform scaling of the model stored in the DataSet, this method will fail.

Once the size is changed, the original size is lost. If you need to be able to restore the original size, call getSize() first and store the result.

Note: The DataSet that this Target belongs must not be active when this function is called.

Note: Rescaling should only be used if you have different physical copies of the object at different sizes (for example if you have an image printed at both A4 and A0 sizes). Do not use this method if you want to virtually re-scale the pose returned by the tracker - this should be handled by your own application logic.

Parameters
sizeThe desired size of the target, in meters (width, height, depth).
Returns
true if the size was set successfully, or false if the DataSet is active or the requested size does not represent a uniform scaling of the size of model stored in the DataSet.
boolean setMotionHint ( int  hint)

Set the motion hint to indicate how the target moves in space.

Vuforia may use the hint to optimize tracking performance and/or power consumption.

Setting the motion hint is currently only supported on ModelTarget trackables. The default value for a ModelTarget is specified in the dataset during target generation in the Model Target Generator. For older datasets where no motion hint was defined, the motion hint defaults to STATIC.

For all targets other than ModelTarget, the motion hint value cannot be changed and defaults to ADAPTIVE.

Note: The DataSet this target belongs to must be deactivated when this function is called.

Parameters
hintThe motion hint.
Returns
true if the hint was set successfully, or false if the DataSet is active or the operation is not supported.
int getMotionHint ( )

Get the motion hint of this target.

For more details on the meaning of the value, please see the documentation of setMotionHint().

Returns
The current motion hint of this target.