C++ Java Unity
C++ Reference
ObjectTarget Class Referenceabstract

Detailed Description

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

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

Public Types

enum  MOTION_HINT {
  STATIC,
  ADAPTIVE
}
 Target property that indicates how the target moves in space. More...
 

Public Member Functions

virtual const char * getUniqueTargetId () const =0
 Get the persistent system-wide unique id for this target. More...
 
virtual Vec3F getSize () const =0
 Get the size of this target. More...
 
virtual bool setSize (const Vec3F &size)=0
 Apply a uniform scale to this target that makes it the given size. More...
 
virtual bool setMotionHint (MOTION_HINT hint)=0
 Set the motion hint to indicate how the target moves in space. More...
 
virtual MOTION_HINT getMotionHint () const =0
 Get the motion hint of this target. More...
 
- Public Member Functions inherited from Trackable
virtual Type getType () const =0
 Get the Type for this instance (typically a subclass of Trackable). More...
 
virtual bool isOfType (Type type) const =0
 Check whether this instance is of the given Type or any of its subclasses. More...
 
virtual int getId () const =0
 Get a unique id for this Trackable. More...
 
virtual const char * getName () const =0
 Get the name of this Trackable's name. More...
 
virtual bool setUserData (void *userData)=0
 Set user data for this Trackable. More...
 
virtual void * getUserData () const =0
 Get the user data that was previously set using setUserData(). More...
 
virtual ~Trackable ()
 

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 Enumeration Documentation

Target property that indicates how the target moves in space.

Enumerator
STATIC 

Optimize performance for objects that remain at the same location throughout the experience. Setting this value allows Vuforia to reduce CPU and power consumption when PositionalDeviceTracker is enabled.

ADAPTIVE 

Automatically optimize performance for experiences ranging from mostly static objects to fully dynamic objects.

Note
Some target types do not support the full motion range, e.g. ModelTarget only allows limited object motion. Refer to the specific target documentation for more information on their behavior.

Member Function Documentation

static Type getClassType ( )
static

Get the Type for class "ObjectTarget".

virtual const char* getUniqueTargetId ( ) const
pure virtual

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).
virtual Vec3F getSize ( ) const
pure virtual

Get the size of this target.

Returns
The size of this target, in meters (width, height, depth).
virtual bool setSize ( const Vec3F size)
pure virtual

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.
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.
virtual bool setMotionHint ( MOTION_HINT  hint)
pure virtual

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.
virtual MOTION_HINT getMotionHint ( ) const
pure virtual

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.